diff --git a/.gitattributes b/.gitattributes index bb80e3f44875cded1947d2784bdedfa06b1e3246..1d11208454657caaae47be4fad9dde3f90b6e8de 100644 --- a/.gitattributes +++ b/.gitattributes @@ -268,3 +268,9 @@ venv/Lib/site-packages/rpds/rpds.cp314-win_amd64.pyd filter=lfs diff=lfs merge=l venv/Lib/site-packages/streamlit/__pycache__/emojis.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text venv/Lib/site-packages/streamlit/__pycache__/material_icon_names.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text venv/Lib/site-packages/streamlit/elements/lib/__pycache__/column_types.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/streamlit/static/static/media/MaterialSymbols-Rounded.1hm6dVzH.woff2 filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/streamlit/static/static/media/SourceSansVF-Italic.ttf.Bt9VkdQ3.woff2 filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/streamlit/static/static/media/SourceSansVF-Upright.ttf.BsWL4Kly.woff2 filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/streamlit/static/static/media/SourceSerifVariable-Italic.ttf.CVdzAtxO.woff2 filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/streamlit/static/static/media/SourceSerifVariable-Roman.ttf.mdpVL9bi.woff2 filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/streamlit/testing/v1/__pycache__/element_tree.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text diff --git a/venv/Lib/site-packages/streamlit-1.60.0.dist-info/INSTALLER b/venv/Lib/site-packages/streamlit-1.60.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/Lib/site-packages/streamlit-1.60.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/Lib/site-packages/streamlit-1.60.0.dist-info/METADATA b/venv/Lib/site-packages/streamlit-1.60.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..7c2b8004de404e613304cf2e56f29f123dcf841b --- /dev/null +++ b/venv/Lib/site-packages/streamlit-1.60.0.dist-info/METADATA @@ -0,0 +1,224 @@ +Metadata-Version: 2.4 +Name: streamlit +Version: 1.60.0 +Summary: A faster way to build and share data apps +Author-email: Snowflake Inc +License-Expression: Apache-2.0 +Project-URL: Homepage, https://streamlit.io +Project-URL: Documentation, https://docs.streamlit.io/ +Project-URL: Source Code, https://github.com/streamlit/streamlit +Project-URL: Bug Tracker, https://github.com/streamlit/streamlit/issues +Project-URL: Release Notes, https://docs.streamlit.io/develop/quick-reference/changelog +Project-URL: Community, https://discuss.streamlit.io/ +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Science/Research +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Topic :: Database :: Front-Ends +Classifier: Topic :: Office/Business :: Financial :: Spreadsheet +Classifier: Topic :: Scientific/Engineering :: Information Analysis +Classifier: Topic :: Scientific/Engineering :: Visualization +Classifier: Topic :: Software Development :: Libraries :: Application Frameworks +Classifier: Topic :: Software Development :: Widget Sets +Requires-Python: >=3.10 +Description-Content-Type: text/markdown +Requires-Dist: altair!=5.4.0,!=5.4.1,<7,>=4.0 +Requires-Dist: blinker<2,>=1.5.0 +Requires-Dist: click<9,>=7.0 +Requires-Dist: gitpython!=3.1.19,<4,>=3.0.7 +Requires-Dist: numpy<3,>=1.23 +Requires-Dist: packaging>=20 +Requires-Dist: pandas<4,>=1.4.0 +Requires-Dist: pillow<13,>=7.1.0 +Requires-Dist: pydeck<1,>=0.8.0b4 +Requires-Dist: protobuf<8,>=3.20 +Requires-Dist: pyarrow<25,>=7.0 +Requires-Dist: requests<3,>=2.27 +Requires-Dist: tenacity<10,>=8.1.0 +Requires-Dist: toml<2,>=0.10.1 +Requires-Dist: typing-extensions<5,>=4.10.0 +Requires-Dist: starlette<2,>=0.40.0 +Requires-Dist: uvicorn<1,>=0.30.0 +Requires-Dist: httptools<1,>=0.6.3 +Requires-Dist: anyio<5,>=4.0.0 +Requires-Dist: python-multipart<1,>=0.0.10 +Requires-Dist: websockets<17,>=12.0.0 +Requires-Dist: itsdangerous<3,>=2.1.2 +Requires-Dist: watchdog<7,>=2.1.5; platform_system != "Darwin" +Provides-Extra: snowflake +Requires-Dist: snowflake-snowpark-python[modin]>=1.17.0; extra == "snowflake" +Requires-Dist: snowflake-connector-python>=3.3.0; extra == "snowflake" +Provides-Extra: pdf +Requires-Dist: streamlit-pdf>=1.0.0; extra == "pdf" +Provides-Extra: auth +Requires-Dist: Authlib>=1.3.2; extra == "auth" +Requires-Dist: httpx>=0.24.1; extra == "auth" +Provides-Extra: charts +Requires-Dist: matplotlib>=3.0.0; extra == "charts" +Requires-Dist: graphviz>=0.19.0; extra == "charts" +Requires-Dist: plotly>=4.0.0; extra == "charts" +Requires-Dist: orjson>=3.5.0; extra == "charts" +Provides-Extra: sql +Requires-Dist: SQLAlchemy>=2.0.0; extra == "sql" +Provides-Extra: performance +Requires-Dist: orjson>=3.5.0; extra == "performance" +Requires-Dist: uvloop>=0.15.2; (sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy") and extra == "performance" +Provides-Extra: all +Requires-Dist: streamlit[auth,charts,pdf,performance,snowflake,sql]; extra == "all" +Requires-Dist: rich>=11.0.0; extra == "all" + +
+ +Streamlit logo + +# Welcome to Streamlit 👋 + +**A faster way to build and share data apps.** + +## What is Streamlit? + +Streamlit lets you transform Python scripts into interactive web apps in minutes, instead of weeks. Build dashboards, generate reports, or create chat apps. Once you’ve created an app, you can use our [Community Cloud platform](https://streamlit.io/cloud) to deploy, manage, and share your app. + +### Why choose Streamlit? + +- **Simple and Pythonic:** Write beautiful, easy-to-read code. +- **Fast, interactive prototyping:** Let others interact with your data and provide feedback quickly. +- **Live editing:** See your app update instantly as you edit your script. +- **Open-source and free:** Join a vibrant community and contribute to Streamlit's future. + +## Installation + +Open a terminal and run: + +```bash +$ pip install streamlit +$ streamlit hello +``` + +If this opens our sweet _Streamlit Hello_ app in your browser, you're all set! If not, head over to [our docs](https://docs.streamlit.io/get-started) for specific installs. + +The app features a bunch of examples of what you can do with Streamlit. Jump to the [quickstart](#quickstart) section to understand how that all works. + +Streamlit Hello + +## Quickstart + +### A little example + +Create a new file named `streamlit_app.py` in your project directory with the following code: +```python +import streamlit as st +x = st.slider("Select a value") +st.write(x, "squared is", x * x) +``` + +Now run it to open the app! +``` +$ streamlit run streamlit_app.py +``` + +Little example + +### Give me more! + +Streamlit comes in with [a ton of additional powerful elements](https://docs.streamlit.io/develop/api-reference) to spice up your data apps and delight your viewers. Some examples: + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
Input widgetsDataframesChartsLayoutMulti-page appsFun
+ + +Our vibrant creators community also extends Streamlit capabilities using  🧩 [Streamlit Components](https://streamlit.io/components). + +## Get inspired + +There's so much you can build with Streamlit: +- 🤖  [LLMs & chatbot apps](https://streamlit.io/gallery?category=llms) +- 🧬  [Science & technology apps](https://streamlit.io/gallery?category=science-technology) +- 💬  [NLP & language apps](https://streamlit.io/gallery?category=nlp-language) +- 🏦  [Finance & business apps](https://streamlit.io/gallery?category=finance-business) +- 🗺  [Geography & society apps](https://streamlit.io/gallery?category=geography-society) +- and more! + +**Check out [our gallery!](https://streamlit.io/gallery)** 🎈 + +## Community Cloud + +Deploy, manage and share your apps for free using our [Community Cloud](https://streamlit.io/cloud)! Sign-up [here](https://share.streamlit.io/signup).

+ + +## Resources + +- Explore our [docs](https://docs.streamlit.io) to learn how Streamlit works. +- Ask questions and get help in our [community forum](https://discuss.streamlit.io). +- Read our [blog](https://blog.streamlit.io) for tips from developers and creators. +- Extend Streamlit's capabilities by installing or creating your own [Streamlit Components](https://streamlit.io/components). +- Help others find and play with your app by using the Streamlit GitHub badge in your repository: +```markdown +[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](URL_TO_YOUR_APP) +``` +[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://share.streamlit.io/streamlit/roadmap) + +## Contribute + +🎉 Thanks for your interest in helping improve Streamlit! 🎉 + +We have paused accepting pull requests from outside the Streamlit maintainer team. You can still +make a valuable contribution by [reporting bugs](https://github.com/streamlit/streamlit/issues/new?template=bug_report.yml), +[requesting features](https://github.com/streamlit/streamlit/issues/new?template=feature_request.yml), +[improving or upvoting existing issues](https://github.com/streamlit/streamlit/issues?q=is%3Aissue%20state%3Aopen%20sort%3Areactions-%2B1-desc), +[commenting on open specs](https://github.com/streamlit/streamlit/issues?q=state%3Aopen%20label%3Achange%3Aspec), creating +[custom components](https://docs.streamlit.io/develop/concepts/custom-components/components-v2), +and contributing to [streamlit-extras](https://github.com/arnaudmiribel/streamlit-extras). + +Read our [contribution guide](https://github.com/streamlit/streamlit/blob/develop/CONTRIBUTING.md) +for details. + +## License + +Streamlit is completely free and open-source and licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license. diff --git a/venv/Lib/site-packages/streamlit-1.60.0.dist-info/RECORD b/venv/Lib/site-packages/streamlit-1.60.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..193ab70a30af04464bc736ede762c9035ae98d11 --- /dev/null +++ b/venv/Lib/site-packages/streamlit-1.60.0.dist-info/RECORD @@ -0,0 +1,1327 @@ +../../Scripts/streamlit.exe,sha256=oWnbRZMen2rgLeuPqfw8Quv-eWocLkN7enxKb9KobN0,108368 +streamlit-1.60.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +streamlit-1.60.0.dist-info/METADATA,sha256=EEI1Qia4Bi8FRDcjn0p1D7i_AQtg_NIz7Dsgsp163ms,10369 +streamlit-1.60.0.dist-info/RECORD,, +streamlit-1.60.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +streamlit-1.60.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91 +streamlit-1.60.0.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53 +streamlit-1.60.0.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10 +streamlit/.agents/meta-skill/developing-with-streamlit/SKILL.md,sha256=5Ntbrz6rRxSC4PdvILePHnmU5AXfYYHJD4w--xU3vcg,1650 +streamlit/.agents/meta-skill/developing-with-streamlit/scripts/__pycache__/discover.cpython-314.pyc,, +streamlit/.agents/meta-skill/developing-with-streamlit/scripts/discover.py,sha256=4qWgGLUGFquFeViwBGUTYmPjrIO6COGqfV-mnGyewLg,11227 +streamlit/.agents/skills/developing-with-streamlit/SKILL.md,sha256=SGqwUoM20Unm8qLHU9jyUufrASYMcfnG815YXPWXvDA,17270 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/README.md,sha256=vx45iUV6WRhJCJjTox_C9kgzTejn5w9uWoQ0yeqxZJw,6372 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-companies/__pycache__/streamlit_app.cpython-314.pyc,, +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-companies/pyproject.toml,sha256=7vagiUVJNgJYFss4lSNWxaBUAgzmzrNlchSjeRNJNow,281 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-companies/streamlit_app.py,sha256=unkm1UtuYOLPaPjmLhm-mgl6OVFRKyurAwG8SYToUmQ,13243 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-compute/__pycache__/streamlit_app.cpython-314.pyc,, +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-compute/pyproject.toml,sha256=C0cT95f_MljFQTHeaTPuA1MvjvGX43uMggJNl4f6B6A,270 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-compute/streamlit_app.py,sha256=cfHAEXmdA6RxTDpcl4QDAhHrlqcq4-xljb5CtjUabFE,14359 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-feature-usage/__pycache__/streamlit_app.cpython-314.pyc,, +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-feature-usage/pyproject.toml,sha256=mk-Qa-yFqj3ASgMslFz2Q0dSr2RJE5kfB2I8ODayg_A,271 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-feature-usage/streamlit_app.py,sha256=U8ukoGZFEuLWNsBR2mHuqEtrXuTGg133g_4Bt3VTGvE,11423 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-metrics/__pycache__/streamlit_app.cpython-314.pyc,, +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-metrics/pyproject.toml,sha256=IuBEdcVbGubv99M21AjKzHXFw4tI3ru1su2uk25z6TM,276 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-metrics/streamlit_app.py,sha256=oFP6u3a7vffx38GDn_ZyKBR_k0Ll-8BSTKjosO6cOYo,14670 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-seattle-weather/__pycache__/streamlit_app.cpython-314.pyc,, +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-seattle-weather/pyproject.toml,sha256=9hAk6LQFTkppbhfFe5AlfrqIuTStaOexjh_ieMEkj5I,271 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-seattle-weather/streamlit_app.py,sha256=yPasV_E93URM-i_ELN4vuvx5sIzaVkeAG6-EBpFGiWE,7454 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-stock-peers/__pycache__/streamlit_app.cpython-314.pyc,, +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-stock-peers/pyproject.toml,sha256=nbM0mbM6xXWWkCCnDj8YU83cwrW7EayAUEJKPg333Lg,292 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/apps/dashboard-stock-peers/streamlit_app.py,sha256=x8gO9f7TvpWcrmPan6-6Oojyv1dJBR5avQgpujHfZns,8269 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/themes/README.md,sha256=DlGtQjtulgEBUH-y8rGCskoxdLYEL8ByRQoFxohOzSQ,1329 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/themes/configs/dracula.toml,sha256=u0jJL6Wdd47_6dMBWhwr6fpFfAnoB7FlQqPHfm6Ymvw,1246 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/themes/configs/financial-dashboard.toml,sha256=gJtFVSmzEKioISXC9lW-9gVsiBM5_chw2e1Erj2HRNQ,2267 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/themes/configs/fluent.toml,sha256=p81mpchxsy4at_jSWxGg2YEJ5CI55j5-V5h9i6UBau0,1535 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/themes/configs/jupyter.toml,sha256=YZXq5oHZWtXktdTJtpT6nOsTZW4lLW7u15FCWNdzta4,1520 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/themes/configs/material-ui.toml,sha256=l-Su20cGHf2UlHVpkGTMq7zMIxhLIbMJhgErXW1P9Z4,1378 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/themes/configs/minimal.toml,sha256=J2Wu4oSrAUY7aVpwicFl8XffH70TbaeUr6TSzlxkc7w,1231 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/themes/configs/nord.toml,sha256=y55Zn3TllH1dRtcISQF6iv1MkNwwwMXWb72me721fjY,1252 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/themes/configs/one-dark-pro.toml,sha256=jaScyvBFmy8Lhw5Z9DL9YGT_FvTR2Xq6EiBmS4w5pes,1310 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/themes/configs/shadcn.toml,sha256=kIs684Phl6PJ-hv4XgWjXQe3tEUgggg1VhV2CeTTMfE,1506 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/themes/configs/solarized-light.toml,sha256=p4P8nyKSVx3wmMRV23TWtylczwxfCy9i63yIVMLES5M,1274 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/themes/configs/ubuntu.toml,sha256=6ZpXR1zT97tJMa5fI-ngdZW9Fqyv2Gm66I1hMaxk0fE,1485 +streamlit/.agents/skills/developing-with-streamlit/assets/templates/themes/configs/vscode.toml,sha256=0MmpJUY709QCwO-brtQV4YU8j9AcoJGMc5bZ33mzIYc,1264 +streamlit/.agents/skills/developing-with-streamlit/references/api-reference.md,sha256=CmYXmTlha6LjBdweCD2pk32GBYrA6uH3InVTBEc0nNc,21905 +streamlit/.agents/skills/developing-with-streamlit/references/best-practices.md,sha256=A_-Trz8S__hX-7TDrzxJ21kKZJkTjThM81duS7VBAoI,10549 +streamlit/.agents/skills/developing-with-streamlit/references/ccv2-packaged-components.md,sha256=u-DhUSCNOEugY8yxtmp5auZHB3lMBZKwwE4WOIBvgQ0,11282 +streamlit/.agents/skills/developing-with-streamlit/references/ccv2-state-sync.md,sha256=Zs3s83rmKR8tL9TLOdg--dKNcxLS_ob5Ox31tDfewVE,5033 +streamlit/.agents/skills/developing-with-streamlit/references/ccv2-theme-css-variables.md,sha256=tkKSCufHSu_cIIGt3ownAqRK4ABMVLYW-jfDT4GCZ34,8348 +streamlit/.agents/skills/developing-with-streamlit/references/ccv2-troubleshooting.md,sha256=D1li6WoF0rGHo_QUs6m4fcpTQ_1Gddl_BG0ml-f9bf8,7153 +streamlit/.agents/skills/developing-with-streamlit/references/chat-ui.md,sha256=0Coj9E3PCsn3TUa5SAMR9CW1AT0CnPWyGCHd-EIFMoA,5664 +streamlit/.agents/skills/developing-with-streamlit/references/cli.md,sha256=lG6_D1mM0GtQI9K8j8pQgukSZuzXKctunpuAClHA7G0,5272 +streamlit/.agents/skills/developing-with-streamlit/references/code-organization.md,sha256=M0XDVQ0VLgC91Y0Fr42swGf-iVmLq9R5vU9dKhkNrH8,1963 +streamlit/.agents/skills/developing-with-streamlit/references/custom-components-v2.md,sha256=yJVs0CuRlXpb-rCbuBaZLUKnvymMXnz3B6DdT4tJwWQ,11379 +streamlit/.agents/skills/developing-with-streamlit/references/dashboards.md,sha256=Lx4JNf4UaPsAIWFw_jw5PHNcMtz-N8y6gJK-Byo-yeg,5629 +streamlit/.agents/skills/developing-with-streamlit/references/data-display.md,sha256=sA8Xl_C7hT5E8QzJUovzlzsLD9jHXmYLyRl_roPFLmg,10980 +streamlit/.agents/skills/developing-with-streamlit/references/design.md,sha256=yhaBvaNkwBIlPZLscKWPE9nqS50jVlkiMhLDylLFKiY,5462 +streamlit/.agents/skills/developing-with-streamlit/references/environment-setup.md,sha256=PieOkgkz0x9-CpELp7erXR0viWne1iOZCDjVqmuoTOQ,2921 +streamlit/.agents/skills/developing-with-streamlit/references/layouts.md,sha256=vnPV-N20xI7ciXUQaznUuaUYbiZF2CSVMzbIhRy82t8,9554 +streamlit/.agents/skills/developing-with-streamlit/references/markdown.md,sha256=afyiTOeYU9cM9bYcm44zhRcTOvjpRdpkTLgdFjemWQQ,8266 +streamlit/.agents/skills/developing-with-streamlit/references/multipage-apps.md,sha256=Lfg0sUdVgYynXFyWgJaNs7kDo_T-0QtSfxWYngitEXQ,4936 +streamlit/.agents/skills/developing-with-streamlit/references/performance.md,sha256=lAZ5wqoa-pQdvs_3ViIvvwrvFbSPVnSFrCkIwBhbv9k,13232 +streamlit/.agents/skills/developing-with-streamlit/references/selection-widgets.md,sha256=xBXl8DAI-0wwhbzTEDL6QVVRIeS0enFt5ovrDxng9KE,4038 +streamlit/.agents/skills/developing-with-streamlit/references/server-asgi.md,sha256=MwHn6hmautl6gnLGx_5jW5oYvFuQ1OR_ZuXltuNVbaw,9858 +streamlit/.agents/skills/developing-with-streamlit/references/session-state.md,sha256=wUPUjzkdvJfSt6hfG2ZY6fJ8O5dLA84slQv9W8dRz_k,4831 +streamlit/.agents/skills/developing-with-streamlit/references/snowflake-connection.md,sha256=uHpIpihtUE8_lJdY8apnlJ8DhXli0yJQmMQdXagIWt4,6169 +streamlit/.agents/skills/developing-with-streamlit/references/theme.md,sha256=nIUmJviWBM56ZcU5esNb1On90Z0A0Jnz4GJO50xNZ2M,13562 +streamlit/.agents/skills/developing-with-streamlit/references/third-party-components.md,sha256=N-2piA48OcxwjcZp3aUfATGHNMnhjppZtB9UuMI4Arc,4469 +streamlit/__init__.py,sha256=N6g4i5V835eXCphFgheriuupx9mDve3ebAWtWf1gNLI,10347 +streamlit/__main__.py,sha256=4vltvfI348h2yIOUohsc2DtG-lclcjCAdR1mewGeMck,868 +streamlit/__pycache__/__init__.cpython-314.pyc,, +streamlit/__pycache__/__main__.cpython-314.pyc,, +streamlit/__pycache__/auth_util.cpython-314.pyc,, +streamlit/__pycache__/cli_util.cpython-314.pyc,, +streamlit/__pycache__/column_config.cpython-314.pyc,, +streamlit/__pycache__/config.cpython-314.pyc,, +streamlit/__pycache__/config_option.cpython-314.pyc,, +streamlit/__pycache__/config_util.cpython-314.pyc,, +streamlit/__pycache__/cursor.cpython-314.pyc,, +streamlit/__pycache__/dataframe_util.cpython-314.pyc,, +streamlit/__pycache__/delta_generator.cpython-314.pyc,, +streamlit/__pycache__/delta_generator_singletons.cpython-314.pyc,, +streamlit/__pycache__/deprecation_util.cpython-314.pyc,, +streamlit/__pycache__/development.cpython-314.pyc,, +streamlit/__pycache__/emojis.cpython-314.pyc,, +streamlit/__pycache__/env_util.cpython-314.pyc,, +streamlit/__pycache__/error_util.cpython-314.pyc,, +streamlit/__pycache__/errors.cpython-314.pyc,, +streamlit/__pycache__/file_util.cpython-314.pyc,, +streamlit/__pycache__/git_util.cpython-314.pyc,, +streamlit/__pycache__/logger.cpython-314.pyc,, +streamlit/__pycache__/material_icon_names.cpython-314.pyc,, +streamlit/__pycache__/net_util.cpython-314.pyc,, +streamlit/__pycache__/path_security.cpython-314.pyc,, +streamlit/__pycache__/platform.cpython-314.pyc,, +streamlit/__pycache__/source_util.cpython-314.pyc,, +streamlit/__pycache__/starlette.cpython-314.pyc,, +streamlit/__pycache__/string_util.cpython-314.pyc,, +streamlit/__pycache__/temporary_directory.cpython-314.pyc,, +streamlit/__pycache__/time_util.cpython-314.pyc,, +streamlit/__pycache__/type_util.cpython-314.pyc,, +streamlit/__pycache__/url_util.cpython-314.pyc,, +streamlit/__pycache__/user_info.cpython-314.pyc,, +streamlit/__pycache__/util.cpython-314.pyc,, +streamlit/__pycache__/version.cpython-314.pyc,, +streamlit/auth_util.py,sha256=2WZLW5fe2aPyUySbYkfnf23pcnOwpVipOSSsJnR9DX0,24921 +streamlit/cli_util.py,sha256=rB8bTtmgeG4LH6dlE4iEnagoHssRqd6cMlMjZARP2uw,3737 +streamlit/column_config.py,sha256=Woq2UQwuw5Z5cGjmOOsl4CotVuaUC08tfyxdMFL8Nm4,1649 +streamlit/commands/__init__.py,sha256=iZwXNLk8xCKTqIiR1dIs0i-phfx1ipLkhGasCEwkD2Q,616 +streamlit/commands/__pycache__/__init__.cpython-314.pyc,, +streamlit/commands/__pycache__/echo.cpython-314.pyc,, +streamlit/commands/__pycache__/execution_control.cpython-314.pyc,, +streamlit/commands/__pycache__/logo.cpython-314.pyc,, +streamlit/commands/__pycache__/navigation.cpython-314.pyc,, +streamlit/commands/__pycache__/page_config.cpython-314.pyc,, +streamlit/commands/echo.py,sha256=bS-Evo_n2RpB7lesa8khxlbzeRcS3czl91gCSN4DqNU,4747 +streamlit/commands/execution_control.py,sha256=Y1H4u2esKwTtOAp2bcdgyoQb8FwjJZamIgM8-ecxhOc,12782 +streamlit/commands/logo.py,sha256=5yaXX3eQQ-NKf2dmJmIz9yhU4vgmYOtaDGeOzapLI_E,9299 +streamlit/commands/navigation.py,sha256=eE2vIMbTlKoKd_fj3B2267wUgxD8DqU5RHpaPfaSCn0,19065 +streamlit/commands/page_config.py,sha256=gwV56xx_Z0bJ4k5KPEdIaf3uCFyp5Dpa8d9L0Q2AUUY,15452 +streamlit/components/__init__.py,sha256=iZwXNLk8xCKTqIiR1dIs0i-phfx1ipLkhGasCEwkD2Q,616 +streamlit/components/__pycache__/__init__.cpython-314.pyc,, +streamlit/components/lib/__init__.py,sha256=iZwXNLk8xCKTqIiR1dIs0i-phfx1ipLkhGasCEwkD2Q,616 +streamlit/components/lib/__pycache__/__init__.cpython-314.pyc,, +streamlit/components/lib/__pycache__/local_component_registry.cpython-314.pyc,, +streamlit/components/lib/local_component_registry.py,sha256=UgsVaDH-OwP8Cl47EXrhCYHSn9jSEUFjC-gASuG-EN0,3016 +streamlit/components/types/__init__.py,sha256=iZwXNLk8xCKTqIiR1dIs0i-phfx1ipLkhGasCEwkD2Q,616 +streamlit/components/types/__pycache__/__init__.cpython-314.pyc,, +streamlit/components/types/__pycache__/base_component_registry.cpython-314.pyc,, +streamlit/components/types/__pycache__/base_custom_component.cpython-314.pyc,, +streamlit/components/types/base_component_registry.py,sha256=VLGRZW7-4aUwo_kdcvWgRWTmahyBCntcNG2HO2rvNxU,3292 +streamlit/components/types/base_custom_component.py,sha256=4x0OUVHTOILoXm7J-u5whrG4xZghozpVVz1oqvUrXk8,4823 +streamlit/components/v1/__init__.py,sha256=ux4EMV-e8Mqr1z5JjZATcanBAoYJm82_xTEtxI1o0os,1467 +streamlit/components/v1/__pycache__/__init__.cpython-314.pyc,, +streamlit/components/v1/__pycache__/component_arrow.cpython-314.pyc,, +streamlit/components/v1/__pycache__/component_registry.cpython-314.pyc,, +streamlit/components/v1/__pycache__/components.cpython-314.pyc,, +streamlit/components/v1/__pycache__/custom_component.cpython-314.pyc,, +streamlit/components/v1/component_arrow.py,sha256=OFbYSCinFAXuVgE1yBvPHS4xq-aW_Em7xBFJn6nVxng,5045 +streamlit/components/v1/component_registry.py,sha256=zG4wq33_HzeohqrSqfyIz5TI4bCyXiUGULKx0T0sYWU,5837 +streamlit/components/v1/components.py,sha256=4FabujVHBIznkv8NNGJrZ5CSCCs2lhN7MHBIWCRMX90,1585 +streamlit/components/v1/custom_component.py,sha256=gKt_ab06VEKkol6UdEpYdjpbN5z9OLh7ZlYGDJ_r4pk,9221 +streamlit/components/v2/__init__.py,sha256=f76fuJm8wnVlM5kNUqZFAvXCtuvigOOUmpFSbtYNXx0,19375 +streamlit/components/v2/__pycache__/__init__.cpython-314.pyc,, +streamlit/components/v2/__pycache__/component_definition_resolver.cpython-314.pyc,, +streamlit/components/v2/__pycache__/component_file_watcher.cpython-314.pyc,, +streamlit/components/v2/__pycache__/component_manager.cpython-314.pyc,, +streamlit/components/v2/__pycache__/component_manifest_handler.cpython-314.pyc,, +streamlit/components/v2/__pycache__/component_path_utils.cpython-314.pyc,, +streamlit/components/v2/__pycache__/component_registry.cpython-314.pyc,, +streamlit/components/v2/__pycache__/get_bidi_component_manager.cpython-314.pyc,, +streamlit/components/v2/__pycache__/manifest_scanner.cpython-314.pyc,, +streamlit/components/v2/__pycache__/presentation.cpython-314.pyc,, +streamlit/components/v2/__pycache__/types.cpython-314.pyc,, +streamlit/components/v2/bidi_component/__init__.py,sha256=AvYOh8uHqKLZ8FLUpfsk5ML9UHkcOqgSQeLLr7b_l2A,911 +streamlit/components/v2/bidi_component/__pycache__/__init__.cpython-314.pyc,, +streamlit/components/v2/bidi_component/__pycache__/constants.cpython-314.pyc,, +streamlit/components/v2/bidi_component/__pycache__/main.cpython-314.pyc,, +streamlit/components/v2/bidi_component/__pycache__/serialization.cpython-314.pyc,, +streamlit/components/v2/bidi_component/__pycache__/state.cpython-314.pyc,, +streamlit/components/v2/bidi_component/constants.py,sha256=th008h0MS8uErePmBzHc0dZtZeo2o_g26NAmQ0ZPxaw,1276 +streamlit/components/v2/bidi_component/main.py,sha256=E0Zyli3PjEefRUTBUb59I0gpX9cDC2KypSPqn1Is2Xg,21549 +streamlit/components/v2/bidi_component/serialization.py,sha256=B8SW4riEE5Z8u_gc6Kj88JgjiyiK18PZKJdMKVS9Mrc,9405 +streamlit/components/v2/bidi_component/state.py,sha256=7CGdITUJzgmG8XaKlJxspwXQwRuz2BXx2jBek3Sfi0o,3226 +streamlit/components/v2/component_definition_resolver.py,sha256=SLwm6YgqOa1GnMnJbXBxzMWhIu0sdq5N-dnA5MLly5I,5758 +streamlit/components/v2/component_file_watcher.py,sha256=A9QmSw5jMArtK_gfwbFBZdOCI7vVFqV77X5WXbuYCj0,14728 +streamlit/components/v2/component_manager.py,sha256=o9vp2PkyQeWEAM2WvfSsH_NKdyKZAppBRQJnzPcQl2c,15642 +streamlit/components/v2/component_manifest_handler.py,sha256=O7LFfAWSQYvWSIKQxcjmWJ5xFlhRFzV2PtErgA3uTq0,4187 +streamlit/components/v2/component_path_utils.py,sha256=G7-z3i8tw9CqCzndk0h2rGb1Y6nxdptWM6bemghybL0,8568 +streamlit/components/v2/component_registry.py,sha256=xyeJ1utjGVlRVUn7YKTKzSxIHpAwrks0qD1nj9j_5UY,17217 +streamlit/components/v2/get_bidi_component_manager.py,sha256=3fvVy2BCve2-YPXs8pSbEPIKRUUts5R_B6usWnASiGM,1759 +streamlit/components/v2/manifest_scanner.py,sha256=vvPQ63vG-drpTVH2Wxks4pjeKw_HeeaZUZTBdh9zZHU,21185 +streamlit/components/v2/presentation.py,sha256=a8A33bTu1vy1fja3J_gs8cUWasfudOnrig6z6YlNArE,8214 +streamlit/components/v2/types.py,sha256=1Z1fxGkikVEWbnEREAKxNmIId6qhtnFFjLyJhvUNQMo,12144 +streamlit/config.py,sha256=XSnbwfHnvvKrLSgf1ok9pKBbkzYNrHoKTEbtwCJ2t68,102551 +streamlit/config_option.py,sha256=CN4pYyIzltZMI3ZluyIhwIp_Mid56SCdmt4GAkRd-PA,11706 +streamlit/config_util.py,sha256=ZGPw5EhczAN1FW8YOBge0mQmT8ugjRt2rCDB73WCUYo,33070 +streamlit/connections/__init__.py,sha256=H8GBXGiiMrPZHxHg7FBDEVeLP-fpGvdxdAtU7DjDdU8,1071 +streamlit/connections/__pycache__/__init__.cpython-314.pyc,, +streamlit/connections/__pycache__/base_connection.cpython-314.pyc,, +streamlit/connections/__pycache__/snowflake_connection.cpython-314.pyc,, +streamlit/connections/__pycache__/sql_connection.cpython-314.pyc,, +streamlit/connections/__pycache__/util.cpython-314.pyc,, +streamlit/connections/base_connection.py,sha256=yuf7mbSj9fsxpwaHxuJ8pXY4Pd-eNMAzgEwrFz7KQG4,8457 +streamlit/connections/snowflake_connection.py,sha256=2-pjMX0WghzKXAB3U2CfIHlfflHufLmOqbvnu305zCY,32369 +streamlit/connections/sql_connection.py,sha256=tQBKwhTWkyUilOFGFGw5Ko3au0Ni55xLtCBAYDItlb4,16315 +streamlit/connections/util.py,sha256=QnfxHmGE_z1suuzCumvhUlfrLQPjM_qQjpr1yZ99Kho,3085 +streamlit/cursor.py,sha256=alTNg8jOz5zgg9MU3vfaeDSKkespOlK2zGLHVBps4rQ,9886 +streamlit/dataframe_util.py,sha256=msObUTDsQfd4wKyBpuk2FE5PAG4Xvlsngi4XZ3A1VFQ,58125 +streamlit/delta_generator.py,sha256=erCV3YMmvF2Vq6YbZw8sS-VRAJn_unFPPeDTMEQ04nA,32779 +streamlit/delta_generator_singletons.py,sha256=uMdqinWREjEOpHu6nSG64fMEcoKArWGsAkli_CWi69E,10032 +streamlit/deprecation_util.py,sha256=LEq4fYgmNaeAF2AnriP0D_xBsfZhKLFAvkKFikwr5Ww,9099 +streamlit/development.py,sha256=3AX5OOmdwQktfqG21J5daJ5EbCRgFnYyBBEeUprFz18,813 +streamlit/elements/__init__.py,sha256=iZwXNLk8xCKTqIiR1dIs0i-phfx1ipLkhGasCEwkD2Q,616 +streamlit/elements/__pycache__/__init__.cpython-314.pyc,, +streamlit/elements/__pycache__/alert.cpython-314.pyc,, +streamlit/elements/__pycache__/arrow.cpython-314.pyc,, +streamlit/elements/__pycache__/balloons.cpython-314.pyc,, +streamlit/elements/__pycache__/bottom.cpython-314.pyc,, +streamlit/elements/__pycache__/code.cpython-314.pyc,, +streamlit/elements/__pycache__/deck_gl_json_chart.cpython-314.pyc,, +streamlit/elements/__pycache__/dialog_decorator.cpython-314.pyc,, +streamlit/elements/__pycache__/empty.cpython-314.pyc,, +streamlit/elements/__pycache__/exception.cpython-314.pyc,, +streamlit/elements/__pycache__/form.cpython-314.pyc,, +streamlit/elements/__pycache__/graphviz_chart.cpython-314.pyc,, +streamlit/elements/__pycache__/heading.cpython-314.pyc,, +streamlit/elements/__pycache__/help.cpython-314.pyc,, +streamlit/elements/__pycache__/html.cpython-314.pyc,, +streamlit/elements/__pycache__/iframe.cpython-314.pyc,, +streamlit/elements/__pycache__/image.cpython-314.pyc,, +streamlit/elements/__pycache__/json.cpython-314.pyc,, +streamlit/elements/__pycache__/layouts.cpython-314.pyc,, +streamlit/elements/__pycache__/map.cpython-314.pyc,, +streamlit/elements/__pycache__/markdown.cpython-314.pyc,, +streamlit/elements/__pycache__/media.cpython-314.pyc,, +streamlit/elements/__pycache__/mermaid_chart.cpython-314.pyc,, +streamlit/elements/__pycache__/metric.cpython-314.pyc,, +streamlit/elements/__pycache__/pdf.cpython-314.pyc,, +streamlit/elements/__pycache__/plotly_chart.cpython-314.pyc,, +streamlit/elements/__pycache__/progress.cpython-314.pyc,, +streamlit/elements/__pycache__/pyplot.cpython-314.pyc,, +streamlit/elements/__pycache__/skeleton.cpython-314.pyc,, +streamlit/elements/__pycache__/snow.cpython-314.pyc,, +streamlit/elements/__pycache__/space.cpython-314.pyc,, +streamlit/elements/__pycache__/spinner.cpython-314.pyc,, +streamlit/elements/__pycache__/table.cpython-314.pyc,, +streamlit/elements/__pycache__/text.cpython-314.pyc,, +streamlit/elements/__pycache__/toast.cpython-314.pyc,, +streamlit/elements/__pycache__/vega_charts.cpython-314.pyc,, +streamlit/elements/__pycache__/write.cpython-314.pyc,, +streamlit/elements/alert.py,sha256=h8CQQyZiJJv0FrBF624GHZUFbeAoXckBHmo9_DV9RbY,20369 +streamlit/elements/arrow.py,sha256=Vv2AFusgkO90KLk6b52f1yjhGRZB9ZrcrStTXKbUF6k,45297 +streamlit/elements/balloons.py,sha256=RT-GtKCyJv3EBN9Myxu4BOx4GUAU5i-dWDHErsnkWsU,1517 +streamlit/elements/bottom.py,sha256=s4vxlyRAOQjQKQuTZ2ZDtEZyuH984R1srWn16BB__88,3251 +streamlit/elements/code.py,sha256=Zd1E9wBFuMqjldk8gMIo4T2KLuPOGVvWUNKdCD8S9-Y,6034 +streamlit/elements/deck_gl_json_chart.py,sha256=950dln4t4Fx6OB6R1GLQGHNswOvKQ8VK3oDS7pTH5WQ,25720 +streamlit/elements/dialog_decorator.py,sha256=MOZ6djCktJ3oh596-FLM9AcpvpDPS6lUeIhrIMwGGEo,12513 +streamlit/elements/empty.py,sha256=hz0jCwFZVC6qBVY-mJv5Kj5rjDQZwnYRW7HbX9qAKhE,3495 +streamlit/elements/exception.py,sha256=HK2F5lhb0asB3ZSiVaYUDvwutZAFH2XI0x76rx3puy8,12425 +streamlit/elements/form.py,sha256=BiEpIVwg0-9iUQh3I2sFZnGXxVKVA1HPxbJlqrTPc60,20655 +streamlit/elements/graphviz_chart.py,sha256=XklJ0fCqEtAOpjoYTp7QJOpzNAxgdUY_uQZ4oGX28x0,8053 +streamlit/elements/heading.py,sha256=BME7cI8S7-jD84m4U87YkLJ_QuKPs1WMKxR_qxHmaB0,16008 +streamlit/elements/help.py,sha256=C4tjaPUjnyAr-wvz_n8EbyZd1Y9vBycoML7VzU9iORM,17278 +streamlit/elements/html.py,sha256=XkbFtXg2awzhFrRxl-oZTP56MZpw_C4dnCQN8HWhB24,7580 +streamlit/elements/iframe.py,sha256=2bZpqBwLOpAxfMKi2EQfXMMPAa5LaxTF-mZfNO_94zo,19062 +streamlit/elements/image.py,sha256=1K_Ly-gEc_WH8lFirWSFMYbueWxtupLcwpgRArLM3Aw,10655 +streamlit/elements/json.py,sha256=Htg8hxUs4XxGiBonzdr06vNOskL_E9VeQ5kfki0jUpM,6051 +streamlit/elements/layouts.py,sha256=5rhtwkcfquyn8g5Ytpq_tgYqHVZ3fgpFGRBKLxKwfqQ,73998 +streamlit/elements/lib/__init__.py,sha256=iZwXNLk8xCKTqIiR1dIs0i-phfx1ipLkhGasCEwkD2Q,616 +streamlit/elements/lib/__pycache__/__init__.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/built_in_chart_utils.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/color_util.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/column_config_utils.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/column_types.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/dialog.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/dicttools.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/file_uploader_utils.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/form_utils.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/image_utils.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/js_number.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/layout_utils.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/mutable_expander_container.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/mutable_popover_container.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/mutable_status_container.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/mutable_tab_container.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/options_selector_utils.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/pandas_styler_utils.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/policies.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/shortcut_utils.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/skeleton_placeholder.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/streamlit_plotly_theme.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/subtitle_utils.cpython-314.pyc,, +streamlit/elements/lib/__pycache__/utils.cpython-314.pyc,, +streamlit/elements/lib/built_in_chart_utils.py,sha256=ZHl6me_cPYl-Hul4hZeeOsJ6rtYOH5OohyCT-wrUMlc,41525 +streamlit/elements/lib/color_util.py,sha256=ibknUY6_0cNLiQhMxOqzmDtIITqeDGdIjt3QqxNbo_g,9681 +streamlit/elements/lib/column_config_utils.py,sha256=N6uDaggm_j1igm5tSzLS7DxHmuklEdem-gic9IX_KYA,22274 +streamlit/elements/lib/column_types.py,sha256=GQS9VRCRzxAht8a2yZqvYqpMt-Nl8UiyhgDFcpTCVY4,123908 +streamlit/elements/lib/dialog.py,sha256=LmuzWKly9zd7l07Es4pLNlpgHp8HLktYxBhMMT4lqRQ,8336 +streamlit/elements/lib/dicttools.py,sha256=KAjDDQnW6pEZBZtTdmk1DfwL6b1c7u4eEzAIvIVxnCM,3894 +streamlit/elements/lib/file_uploader_utils.py,sha256=xbZyZx1fgSw8sViYIcBlv20x4TJ3f4ad1muf_6GE3G4,6094 +streamlit/elements/lib/form_utils.py,sha256=GLHqcCBFH-6ITEErkShymgEtr3CyD1BJHzkWdlz_MmI,2587 +streamlit/elements/lib/image_utils.py,sha256=TexwphRnpTi4ZyAICDPL3cs91AY7mxyLzGLulRJZ32g,16154 +streamlit/elements/lib/js_number.py,sha256=C3tYS0cXhFsavLfnqbuae8ReTuRcZCSRQao3duZrYdY,3532 +streamlit/elements/lib/layout_utils.py,sha256=aGXCr6RGcHKCRl7XPorxcE3tJLiE1U3qGG5SZQlpV2Q,14433 +streamlit/elements/lib/mutable_expander_container.py,sha256=dJfgbhADm_Z6BsslWKyeCiEhs_M2JQlLmK_wl0rEKE0,3629 +streamlit/elements/lib/mutable_popover_container.py,sha256=_XEgxV_-GITkG5M12LIcIpj3RHqVL7pGdFVdhIHF0dI,3556 +streamlit/elements/lib/mutable_status_container.py,sha256=z8PXkn4DH255RbAXFyxU2DDdI-Q6wq4KW2eLgQJxVZA,7533 +streamlit/elements/lib/mutable_tab_container.py,sha256=w8Q8NGrP8Ye5llkbHrifwU-aKym77JVswOId_octIac,4419 +streamlit/elements/lib/options_selector_utils.py,sha256=oIQUAChr-emTYXWqva_bfXTyVbB9VoAU8DACfwl8SoU,22494 +streamlit/elements/lib/pandas_styler_utils.py,sha256=eShtH7pltNpjycZ0vkSWjj83FeyoyZO6jD36mWFKoQ8,9834 +streamlit/elements/lib/policies.py,sha256=xbIV3Y_vDd4PQem3AKirYNQZx0O5OU-M40qmBU--hTo,5574 +streamlit/elements/lib/shortcut_utils.py,sha256=iB6MfJ0L0oSuGMEddXHFGB7O1wMea_Mkmd_f6glaly4,5552 +streamlit/elements/lib/skeleton_placeholder.py,sha256=mRY9XghADdFo5i46CVUNvUldBtngZeAEmFh2CV7qC-Y,8542 +streamlit/elements/lib/streamlit_plotly_theme.py,sha256=lFveP8CsuQdgic_ZZHehDdQ_STl0MLf6-qrOLGRbOJU,8264 +streamlit/elements/lib/subtitle_utils.py,sha256=O_qT-KiGohoqBIp4DGa-CJecX0CM6f1OJq0rd1QPll8,6218 +streamlit/elements/lib/utils.py,sha256=34P9qkIOwJDWzA_zah2TWfHa76UaNmtE0yIdHV5gFP0,9642 +streamlit/elements/map.py,sha256=rxbMObwRAmpqA-AiLSxp3z_VIoxbYI9TLK2wUkfZOzw,18363 +streamlit/elements/markdown.py,sha256=o2CzGEEtFMlmmpEIzQorsMXDgs-9Ru6J07GBCuL_44o,24096 +streamlit/elements/media.py,sha256=A8rLZvzgD_0JEc6GHaTdQwWL8EpUoqVOhmfKj11M5nI,34352 +streamlit/elements/mermaid_chart.py,sha256=aXswjkBnW3j2a0puXdyAzzZKt4cSVyMg-U91V8_nYP4,3423 +streamlit/elements/metric.py,sha256=FKv4Qm6a0Vzw-S-tf75TyBnFqImevbLmfwt-CnIIaDs,21923 +streamlit/elements/pdf.py,sha256=zBRpMJDwMaliGYlHDzbUZ8f5uX_To24ZHVabmkuKVPc,7207 +streamlit/elements/plotly_chart.py,sha256=9Hdidom_IevabGWAiL-VW_q_V_1KWxPKRTY8_kxvDHE,27864 +streamlit/elements/progress.py,sha256=fGAJzS2Es9dyiCJsh0Po00Ee_I7iA9o9yVd9gHLFRhU,6048 +streamlit/elements/pyplot.py,sha256=brMfqI9nMMi6ffgQMEEcAcuqHIrL9XvCiY6fvBlAPwk,8508 +streamlit/elements/skeleton.py,sha256=t0iQoNJinPxzT_cwttOvJsT1tjBuDbGfCS4--D6dEQ0,7000 +streamlit/elements/snow.py,sha256=jly663QOCGmFMURnKE-_1DRw-nroCq9wHUfmnj3ox5g,1474 +streamlit/elements/space.py,sha256=44T1blDdGNKTCXKvcvJhItbRnKN5ZglmRm7p-gMNnjE,4463 +streamlit/elements/spinner.py,sha256=WExeF1JGhqSxit8EO8JA49aoTJPCeadVAWIQXMdnYjY,5419 +streamlit/elements/table.py,sha256=P08VSeMCisifAvQKyh1B0xRrjJjlWM4NVdu4n30Oej4,15012 +streamlit/elements/text.py,sha256=iJtw2xO6gqKJpQl7E_P-pS-IFIe0Fo7_vy_xAJ5RZuQ,4293 +streamlit/elements/toast.py,sha256=uUBCWhEc61hGY3W97DRnr22VjB9zlxcQ9EJ_tgyi7wY,6462 +streamlit/elements/vega_charts.py,sha256=Z0HiqZkIgfFIHRFBVd78mFwF4OOis1-gUNWASOd2YxQ,103799 +streamlit/elements/widgets/__init__.py,sha256=iZwXNLk8xCKTqIiR1dIs0i-phfx1ipLkhGasCEwkD2Q,616 +streamlit/elements/widgets/__pycache__/__init__.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/audio_input.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/button.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/button_group.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/camera_input.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/chat.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/checkbox.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/color_picker.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/data_editor.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/feedback.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/file_uploader.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/menu_button.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/multiselect.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/number_input.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/pagination.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/radio.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/select_slider.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/selectbox.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/slider.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/text_widgets.cpython-314.pyc,, +streamlit/elements/widgets/__pycache__/time_widgets.cpython-314.pyc,, +streamlit/elements/widgets/audio_input.py,sha256=f9rYvdtiacZKB7rJa8E7mjoTgTH5BDX3aDcbKMEewKQ,13083 +streamlit/elements/widgets/button.py,sha256=pTC-nlSG6JhLnV4Q70F9xb__1LFh5mdSFNG_aKp2wv4,69991 +streamlit/elements/widgets/button_group.py,sha256=kDcB7zOXrhNjIwumb9MDgtcijHFYqmubJhF9FgxJ2Cs,56527 +streamlit/elements/widgets/camera_input.py,sha256=pNipteFYiOkuMU4os9JiuJQY5ritoRjIrxy7K5tEi6I,12842 +streamlit/elements/widgets/chat.py,sha256=27c8VA73ROCKJdVV1WXIOGP03V_JgfVFPKWBVoUrcP4,44876 +streamlit/elements/widgets/checkbox.py,sha256=dSX9XL0ciUNhxkkfg0QXZURfSsv-x8zNR1KPSnqIuCU,19605 +streamlit/elements/widgets/color_picker.py,sha256=lnA8VrOKWDWk_kL74t385027B3d-CYwMUGUelQ6FPYY,13614 +streamlit/elements/widgets/data_editor.py,sha256=twfLnTvH8xzF6kuAfLQE6d-Zvx_2FWpTNXFZ4pByZZ8,52431 +streamlit/elements/widgets/feedback.py,sha256=XRIlJUkoWPs8IFJUC03f64ZDMP1mrOENIHkrt94JQqI,12011 +streamlit/elements/widgets/file_uploader.py,sha256=GyW7LlPPGYmqT2ALEU8F0PLMXH4G4QhpD_XfRBnj8pI,24222 +streamlit/elements/widgets/menu_button.py,sha256=Vlm5XfCfWfjdbVFR6biuGsW5isALqJlwATCB9Bvsjjw,15827 +streamlit/elements/widgets/multiselect.py,sha256=1KdkxaQmhJjAXHow8PCLiVr-d6c07RdrxvBu4NQvbk8,29278 +streamlit/elements/widgets/number_input.py,sha256=K2qWfcY2RER9EXBwosoCsAF7LwO-j0cohrUUQeyLaMc,31233 +streamlit/elements/widgets/pagination.py,sha256=zKwmjmKF8HPc0zasmdiDNF3z76ucgHBcIF-uoSN0MiQ,13612 +streamlit/elements/widgets/radio.py,sha256=Cp_fgL6eXbM-oRFqL-7MS2jmgM0PKoFnz5-kRjuT18g,22725 +streamlit/elements/widgets/select_slider.py,sha256=IS4NkngNgq7uyzXF8x1bS2GqZlccyX6mDgwWMRgl6Ro,23629 +streamlit/elements/widgets/selectbox.py,sha256=ArUY9fKkVpyAemfpgpNnb_S5tIKnaFZPs9k6dT2Fk1E,30474 +streamlit/elements/widgets/slider.py,sha256=DcGwCjPGM7X9YFI4WK7CvB_aVg9LAW0rfI8TxgP_zJ8,46125 +streamlit/elements/widgets/text_widgets.py,sha256=zZ3osA7QNJpYrrDrwMhwM5C_pv-_gk1yE6zYa87nVGM,34380 +streamlit/elements/widgets/time_widgets.py,sha256=kJaxw-ywyPOcEkfTTMYb308xydyZIRzFA3kLbjx3CoA,77181 +streamlit/elements/write.py,sha256=moHGhhdC059dUB2HHG5j8Ous9mka5camBGjluYL4YnM,24467 +streamlit/emojis.py,sha256=1DMShgDSdo7vYdRm5EBR0PuB3MZru8PGxTa1CatPsXs,86079 +streamlit/env_util.py,sha256=06i4tA5M7NwSreLnd6OCXLyEH2_7YvFSVXM_S_Pzqtw,2571 +streamlit/error_util.py,sha256=VvPyW6KAPyopzcH4btlzJ-14b2YbLMnsgNihfIrBLGE,7070 +streamlit/errors.py,sha256=nS9xnTrM3_CYBGhlo6pL7LYG7DhigEkT8d97py6G3Fg,25329 +streamlit/file_util.py,sha256=6tLs6DjhOhesOyLycGYxYDWNqmy03014oKWW_Yh1S30,7775 +streamlit/git_util.py,sha256=Lur12kkCJD7gpJBTj8Nco6_PDaAlIfsRKZ_UDkGa36E,6516 +streamlit/hello/__init__.py,sha256=iZwXNLk8xCKTqIiR1dIs0i-phfx1ipLkhGasCEwkD2Q,616 +streamlit/hello/__pycache__/__init__.cpython-314.pyc,, +streamlit/hello/__pycache__/animation_demo.cpython-314.pyc,, +streamlit/hello/__pycache__/dataframe_demo.cpython-314.pyc,, +streamlit/hello/__pycache__/hello.cpython-314.pyc,, +streamlit/hello/__pycache__/mapping_demo.cpython-314.pyc,, +streamlit/hello/__pycache__/plotting_demo.cpython-314.pyc,, +streamlit/hello/__pycache__/streamlit_app.cpython-314.pyc,, +streamlit/hello/__pycache__/utils.cpython-314.pyc,, +streamlit/hello/animation_demo.py,sha256=ndA99Twri-zbCnQarcRSul7-KkVWpsuiXDAxi7-L4L4,3024 +streamlit/hello/dataframe_demo.py,sha256=5dnsCL7hAFlLabejznKAGtIotwc9tcFfkVjzGL_z2eI,2521 +streamlit/hello/hello.py,sha256=zQmHOqRdirL6Kqq3ISs3YtTwlaWjmve2XiDJ72DQCmQ,1875 +streamlit/hello/mapping_demo.py,sha256=glRGVYCL7l2oze86IYnnhvtJWNtsjBi0LDPXRD5hyG0,3744 +streamlit/hello/plotting_demo.py,sha256=7qCFlW1aQxsN1xe7Ud9dh9bvE7y-gkgI0oU4Ks9ZGHk,2053 +streamlit/hello/streamlit_app.py,sha256=sUG96O7kdxx-xNz6BSE_8eGKDddudnYxW9iJcnp3dgs,1820 +streamlit/hello/utils.py,sha256=ZGYUi2szIMFvSnkZmPipwaFAFIpFV--NgWwmsvIOrDc,1080 +streamlit/logger.py,sha256=9ArawKxYafJKMkbs4eDaL-OEr5qSwXlUcyui_hP5ac4,4247 +streamlit/material_icon_names.py,sha256=RcRElH8zNP5DIsDekHc5qPPqCN_nTndFzBAZmRl1Dfk,71008 +streamlit/navigation/__init__.py,sha256=iZwXNLk8xCKTqIiR1dIs0i-phfx1ipLkhGasCEwkD2Q,616 +streamlit/navigation/__pycache__/__init__.cpython-314.pyc,, +streamlit/navigation/__pycache__/page.cpython-314.pyc,, +streamlit/navigation/page.py,sha256=Kr0TiOdCB4ISwNgcxnB9znkeQvLRk77PwJWXbtJlClQ,21881 +streamlit/net_util.py,sha256=d4aRtXiq24puWF0o90gZxWkIIcpEoue4bai1SafJPx8,3619 +streamlit/path_security.py,sha256=Go2jLy-CR1Q3mG4_PGUEYjf-F9D3BGXgRjXm-tdi4Ro,3597 +streamlit/platform.py,sha256=DgIXk4JVoZE06h9HeaKJyAmnqSo50IsTw6rAXlBwG0Q,1119 +streamlit/proto/Alert_pb2.py,sha256=JEXrc5wSsF3H4tXBxE7Ze_dRZAobC7_mL4hnGn2XdtU,1633 +streamlit/proto/Alert_pb2.pyi,sha256=WiRa_gnU1NPuwGh_ufN3lWZqMuJyQi4-5KvXhQfQQNQ,4061 +streamlit/proto/AppPage_pb2.py,sha256=iia90qzwFzP8nA75DSFKfmy0z8F55YkHBhmV396FNi0,1396 +streamlit/proto/AppPage_pb2.pyi,sha256=yr7nn4J00b7KelxL39wviXNOMzMXq8zkw3TJm50Tcdc,3751 +streamlit/proto/ArrowData_pb2.py,sha256=vcqMJxbaj4QRqT7k-3OMhjygMFvKUPOmJAD2FY2AbmM,1449 +streamlit/proto/ArrowData_pb2.pyi,sha256=p93YSCgU3ZuFQpS3TG2R-wmCpsP0foZndImv-ewxz4s,3891 +streamlit/proto/ArrowNamedDataSet_pb2.py,sha256=vmyR8H20D3K5oSF9NzIQauOrjL6ebiRKl7jSWA_6cOU,1333 +streamlit/proto/ArrowNamedDataSet_pb2.pyi,sha256=BWNnV233eFoq42xcxQJ5Uq1VpQuO4fTgOl3okf0iLOo,2402 +streamlit/proto/AudioInput_pb2.py,sha256=_3waG8JGSw0z_RdFfnfjOGe3laQcFrqOw-8U6ENKNWQ,1510 +streamlit/proto/AudioInput_pb2.pyi,sha256=NvIMT57-CGy2rC3SwSyOm_84hV2tvyOmdXY1eejxsDw,3077 +streamlit/proto/Audio_pb2.py,sha256=aRF1EBnF14bxgnmcotNvTwtOxguhRLPbnJdlRQxnAAw,1544 +streamlit/proto/Audio_pb2.pyi,sha256=wng3Clfc4S7QdqU2-vBJy2mxAJs4qBS8WjGtjkXmsFg,3238 +streamlit/proto/AuthRedirect_pb2.py,sha256=wiLmePDoeltEmALF2fComk3-MSoNxW8MWuaJNIN9oeg,1083 +streamlit/proto/AuthRedirect_pb2.pyi,sha256=lN3nfr2QNwL-6g_NiCOAvYxV__ToWKjo7rqLIcJqUEM,1743 +streamlit/proto/AutoRerun_pb2.py,sha256=emB7e8gI5Zrf-51Mk1OtVHWv0n8ECfv7PAan_7k3IP4,1274 +streamlit/proto/AutoRerun_pb2.pyi,sha256=H3FOHcOKclRUO2O3OK5PSMg-VYW0H7lc0CdIF36B3Ek,3101 +streamlit/proto/BackMsg_pb2.py,sha256=Z2-pzxlrhioybB2C9Xe0JdrVPtjx_48Iw9VigryIZgQ,3219 +streamlit/proto/BackMsg_pb2.pyi,sha256=vADiWy4xgGKpihF6KR8anfgIk3vlzT5iWJjeC_jCJTg,10845 +streamlit/proto/Balloons_pb2.py,sha256=nBz7MlZHDOU0MHY-5XfsNtCHaB1lnvxxYoDDKUSKLMU,1109 +streamlit/proto/Balloons_pb2.pyi,sha256=bNW-ITG_wZMfQu0h1tgbZECMlGTPNac6PJN7Ev4F4UQ,1772 +streamlit/proto/BidiComponent_pb2.py,sha256=amk8aqPmHnOWQk1-UnHZkW05d7C-NT4a0mNXyN2vsZ8,2592 +streamlit/proto/BidiComponent_pb2.pyi,sha256=_gDAxs8P0kfhDYKpOB2H5goEB_Tx2CFlMAOpe_fqBTE,9321 +streamlit/proto/Block_pb2.py,sha256=1-kfBQn_asbmnx-n2evNFAiiw-v5VK2f7U5awEp8ySc,8133 +streamlit/proto/Block_pb2.pyi,sha256=PeTT5SVCFyVUmC7nN3W8nr070j5MI-RW7NYp4jfmIOM,30017 +streamlit/proto/ButtonGroup_pb2.py,sha256=2b2ymGhyN9eX0KyNOfzMMHHIQfsw37s9m_kf0uJDIdQ,2678 +streamlit/proto/ButtonGroup_pb2.pyi,sha256=kwx8LNJuolM7ez8lXJ3o4kSbdenE1kNSwURWSvEv-Ck,8069 +streamlit/proto/ButtonLikeIconPosition_pb2.py,sha256=W9fZ0uJULhOHlcjSfG1sgjk2x6DsyQeU_5Pd4BYspmw,1175 +streamlit/proto/ButtonLikeIconPosition_pb2.pyi,sha256=Td_RuXo8Gu8QEi3y196mBpgqv1DuptIjMlVKBUMP1g8,1816 +streamlit/proto/Button_pb2.py,sha256=wl5Ab1huECeAOrxnYDUZcEsBOOe0jkSRZ5OEdQsSOrw,1662 +streamlit/proto/Button_pb2.pyi,sha256=isH-h40nH5jneORUqQrIKbmTUFUJNBUUiSU1MET_sQ0,3368 +streamlit/proto/CameraInput_pb2.py,sha256=hAx6o4mdj8V5gyAOlyQ2Om1rWiMb41-4zDOgxk6tEIo,1536 +streamlit/proto/CameraInput_pb2.pyi,sha256=QoAyWxq8L6PxJ7zd5SxkzgrnplP8QAmLRvczBN3A7Lo,3188 +streamlit/proto/ChatInput_pb2.py,sha256=_Zyg9zWG6Dut-2SW3Hw8NN2eNzFNdhxEVFUcvs4L-Q4,2203 +streamlit/proto/ChatInput_pb2.pyi,sha256=PP0Bkxo2ei1SDLmWLYvElpV6u_kJ1pGNzF1i8FZjlB0,6617 +streamlit/proto/Checkbox_pb2.py,sha256=DFmSZzfc-Mwe5XwjmnkUUZKAGIy6pgv-35PlpQoDUn4,1886 +streamlit/proto/Checkbox_pb2.pyi,sha256=jPk2pmH92Ymkcgvl160nVVkOu_qRKU23S3vS6e0IQyI,4415 +streamlit/proto/ClientState_pb2.py,sha256=dgPsiXUYFF0UcHkjwfaPMA79hrKuxnrC_ew29YWZVww,2168 +streamlit/proto/ClientState_pb2.pyi,sha256=rvAz6ufT4DCidR4ym14XPdMupz0vGnRFFqtNpPP7XkY,7430 +streamlit/proto/Code_pb2.py,sha256=T7o3aAVop3uaiTjstS0HkAaMlgDWPOHzFqWi66zTTgc,1190 +streamlit/proto/Code_pb2.pyi,sha256=quxjdCDjcngBeEng_XhCzjJspBaplqJBxNGhvnhCTK8,2227 +streamlit/proto/ColorPicker_pb2.py,sha256=eV1IfqTz5IRMvZHRzCmsC2wC-qB8gtL2jK1uB33bQFg,1644 +streamlit/proto/ColorPicker_pb2.pyi,sha256=F_SWtqSe2v4-V6EVb1bdbFifWN0m-JsN104tmH1L7vU,3606 +streamlit/proto/Common_pb2.py,sha256=SfpqrxNu6BazPh9ZiBgxeobhb1JJx0D5mAj_gXhmWCo,3812 +streamlit/proto/Common_pb2.pyi,sha256=9nt9T88gv0nVfn0Rs97kGg49tUvLVcKWvnOOFssBW8c,15241 +streamlit/proto/Components_pb2.py,sha256=_zPT--qrcZ8vEIGGeMaQvi8D166v1I-H9gIFY1MbH3g,2518 +streamlit/proto/Components_pb2.pyi,sha256=2hXRiwDARgcuU4m9eEWxRw8gNtgvxvjhamkbscF4AC4,8487 +streamlit/proto/Dataframe_pb2.py,sha256=_Jll4b5UHz9eiEcjHUyh2OhDAxtZ38WlTX5TjSfrImo,3086 +streamlit/proto/Dataframe_pb2.pyi,sha256=N-LHA98ay2ADj7R5_kZ7eyr37bKxXS71n3kiNga6Bhk,12037 +streamlit/proto/DateInput_pb2.py,sha256=92tchHumPgIvHdONrCS1Er3GQ4AwkWokqotn-PIhGbo,1773 +streamlit/proto/DateInput_pb2.pyi,sha256=rt7ph_TtI-CbT1EhvsMyjVeYtgw6E1L5T7xXYDnSuVs,4383 +streamlit/proto/DateTimeInput_pb2.py,sha256=2V3IvAHAl9zUy9yzNMOefLN4zSqbGbvZeLSiVsielro,1830 +streamlit/proto/DateTimeInput_pb2.pyi,sha256=wdEw4KouIDLl1lAi1VM-xnO-JqO-dTbB-9As9wpawek,4440 +streamlit/proto/DeckGlJsonChart_pb2.py,sha256=jPpxy2ZbMAHgpRgdAqkrd3XyjB5Kx2ADujcFMmLk8OQ,1621 +streamlit/proto/DeckGlJsonChart_pb2.pyi,sha256=v4wszm35kkuEYLfohz99dNUyhNGeR1qBAzywZG0NcOE,4006 +streamlit/proto/Delta_pb2.py,sha256=VbcBCMevnvI7HIHfkUEzmDwx_oYmeXTBKrbCrLkKP-s,1655 +streamlit/proto/Delta_pb2.pyi,sha256=0STvc8Qc7qQEUhv2JiMkkKldJGVnCpKlynY0Du-paVQ,3093 +streamlit/proto/DownloadButton_pb2.py,sha256=L7lS2OrBkc9gsxEeuoJdh9MR-SI8Z_z5WDg8ozxHZMk,1868 +streamlit/proto/DownloadButton_pb2.pyi,sha256=J1ew5EOqBExX7bhY5GXfRM5MoMV1KkB36ktHE3FxHh8,4079 +streamlit/proto/Element_pb2.py,sha256=TyFqY3c3mZdJlySmO5zV3zofgFIjbM6037q4fv5Bh6k,11980 +streamlit/proto/Element_pb2.pyi,sha256=opMB-RtZqyepx3oW2tZaPF8trcAQy3E2j5tmCny-OgI,22080 +streamlit/proto/Empty_pb2.py,sha256=vG_denGqk4yUMmB8-pQXT9RWz6NIpn_XoFhcgq4bHg4,1010 +streamlit/proto/Empty_pb2.pyi,sha256=P6oegun8ohYa9zoya2CwJySSRAi56Bxx86xTnLYUqdY,1592 +streamlit/proto/Exception_pb2.py,sha256=dvHuKJ70zDtfXZSO1a3xiSt7JtqVAs9MReEaNuiNiG8,1434 +streamlit/proto/Exception_pb2.pyi,sha256=WZ1rABV9Q-s8HA2LaSl1o0Kb45Q4z-6hYEZkDY8dkK4,3618 +streamlit/proto/Favicon_pb2.py,sha256=IA-dHGbJYVw5YDHUg9qPej1k1h9GHj08IsBa_aFRm4U,1058 +streamlit/proto/Favicon_pb2.pyi,sha256=TOpTDMbmvmuIR9B_moVZDoVhwsQJreaxcJYABiWVlok,1699 +streamlit/proto/Feedback_pb2.py,sha256=ghjLHna_aROCW7_Gjz3fPbFD3J52w4qq20j6EUrltLw,1667 +streamlit/proto/Feedback_pb2.pyi,sha256=OKvxzqYaUSXdvrGQsCeJrut8Rq0h8VvYoPPQrxoq_7U,4111 +streamlit/proto/FileUploader_pb2.py,sha256=r4jM1dZeIYQ-qL5GktlNHzyV-jw-3lFu5Axg64FGzU8,1652 +streamlit/proto/FileUploader_pb2.pyi,sha256=NoJiu4GTsxIoUr5jl8dPGcFB50y4Yvt7lFJOH8LGJhs,3808 +streamlit/proto/ForwardMsg_pb2.py,sha256=FOFQnLz42Xyh2Tl2ph3x7YPWeXJ27PVWnKaJjAV0sNc,6477 +streamlit/proto/ForwardMsg_pb2.pyi,sha256=zNhwsnS0tYzrQXUBAXLIhSmelhCwrgvJ6_bt4t0Egng,20000 +streamlit/proto/GapSize_pb2.py,sha256=dQlWFyr3PH7ka-yEXT4a1xbZRX4_VbBI7V4CVVk5X-w,1517 +streamlit/proto/GapSize_pb2.pyi,sha256=iU9mRnMcxPMWoAfYhzn8BwKTEib9vbFjTU7maW3DeQ8,3308 +streamlit/proto/GitInfo_pb2.py,sha256=t9XPkIQ8PS7tEVETBXGdMTwSskr5D6CBtGQjlqh29pc,1530 +streamlit/proto/GitInfo_pb2.pyi,sha256=ExA9SVQQ7JefoNsATCk_XDu4Y6vwI0WEWmFZoUfMN_8,3622 +streamlit/proto/GraphVizChart_pb2.py,sha256=10r2p2Zs5wfdWIG72zRaQcIXGQJKHpwxdreY1lyTLNQ,1225 +streamlit/proto/GraphVizChart_pb2.pyi,sha256=pfo_iMWLGRsk3Vbcv3VAJhXK_ZnMkNZ196bYYRz5Yfo,2156 +streamlit/proto/Heading_pb2.py,sha256=HctVqq84dz378oVc0Y71OrQ0YIO3Gp_gLix_uXXsw0I,1243 +streamlit/proto/Heading_pb2.pyi,sha256=n_hrAum-AO3acQdhNRR_XzGERUQh_ttDsTVFpZ4cWK8,2357 +streamlit/proto/HeightConfig_pb2.py,sha256=_Hl_8ebGNcPz-yQKrN7SqJ7EbXQKowebzkUnWtJZ5Yc,1271 +streamlit/proto/HeightConfig_pb2.pyi,sha256=PGI7FR-GWjMWOq7xfufQIVrnpBS-686uRIChzEImoX0,2679 +streamlit/proto/Help_pb2.py,sha256=MyvTI7ZU_8qmojSxcSf7qn1BOgzsNLiYcxBuXvkNR_A,1530 +streamlit/proto/Help_pb2.pyi,sha256=8L7hXMRUOKy0P9kGmwhrSPZtXYBKivWXbdWj4yyvqEc,4283 +streamlit/proto/Html_pb2.py,sha256=2V-hSluTVQ3Z5hrguhNI_5c1z_JZNnU34aHn46rvDPA,1093 +streamlit/proto/Html_pb2.pyi,sha256=IgJekesGjKK9gAxt4NpwEezHPnWC-CIg6c7129KfS0M,1924 +streamlit/proto/IFrame_pb2.py,sha256=UNwztwFlM1eKgMoWhZdiCf1kRfaKtBNO7gF3IbVY0w4,1286 +streamlit/proto/IFrame_pb2.pyi,sha256=Mh3zIN6iMxhR5RFGT-GLdqzo-bl9BA-T2r-5zuiGrb8,2869 +streamlit/proto/Image_pb2.py,sha256=wMXo6_sQTcMIT7WVUguUc9joTrIReGQWKlhJPHhDljM,1337 +streamlit/proto/Image_pb2.pyi,sha256=hK70xGdRKphWDgwNpVuo82LoNqBC-vvJnRCCD84ixV4,3008 +streamlit/proto/Json_pb2.py,sha256=DvnLjPWshz73-47r6-kaQc2_dZAiLuLptXg3gPOjVxU,1175 +streamlit/proto/Json_pb2.pyi,sha256=dx_AHKD9bII_GbVPC1YJl-MGVgj8PjbZ8ZYJjq7JotE,2629 +streamlit/proto/LabelVisibility_pb2.py,sha256=pjAzL1c6rGhvFPl9nXVL12oJ0y4t9CmiM62XoX4S9mM,1417 +streamlit/proto/LabelVisibility_pb2.pyi,sha256=XlRfhGFLRGsqtpYR4rcc7lU_OrVkz36taN84X6P6aTM,3066 +streamlit/proto/LinkButton_pb2.py,sha256=2i4877t8InR5P-40CDCPD0wcnC7lT7-3r58MCM47baU,1648 +streamlit/proto/LinkButton_pb2.pyi,sha256=bmNWBqA38aQAvKAOKFzNy6gBdHx7ez1VOl3ZqnILCm0,3295 +streamlit/proto/Logo_pb2.py,sha256=dC7qMGsvxVeYlIsUQwFnZMURoORK90IU-Jco9R_Xcso,1472 +streamlit/proto/Logo_pb2.pyi,sha256=QoBA2O785B_098N4xVkFB0JJDtA2QonIyJLcGcTiN5Q,3281 +streamlit/proto/Markdown_pb2.py,sha256=zUqooG0PmtI7k3eUwiRA8gdXuxkE4N9lpd6j6eLkdfk,1620 +streamlit/proto/Markdown_pb2.pyi,sha256=aFVP8s3tC94pEttVVYqD-xttueJe_eBlCOVLmM9KBGA,3961 +streamlit/proto/MenuButton_pb2.py,sha256=PQgcmBpeCKxaRKdyoES-tgJHM7JbfrtvJ4aFjw3bCpQ,1275 +streamlit/proto/MenuButton_pb2.pyi,sha256=H0k9M2hklZG0QCQnwWpoU6rJfcZqhRO9UqgQVmrbxbI,2627 +streamlit/proto/Metric_pb2.py,sha256=vU7c-8vMMIIdaQRkt-Ac7dyy12nH8ckmFL50ewHfIv4,2507 +streamlit/proto/Metric_pb2.pyi,sha256=9U592qLWOEdsdQG3sibhvSP5XnJpJZKbQ7NiNHvQcTg,6526 +streamlit/proto/MetricsEvent_pb2.py,sha256=ES7_IFDCPnwdc95f7ZriJHSjSQg1znfDD2LGnik1Kg4,3442 +streamlit/proto/MetricsEvent_pb2.pyi,sha256=cSxKmQms0JAgT4RQF9s3fQ0uTg3STcHvA9_q4avtkHc,10818 +streamlit/proto/MultiSelect_pb2.py,sha256=2XNF7o7yXMrQ-KW9CXOdEZ8gQwARKPuBRP37FHaeyiM,2144 +streamlit/proto/MultiSelect_pb2.pyi,sha256=A-Lmbu1eVWky1asfDF4z1xdgXgjqiZz9TnM1nZgq9dA,5706 +streamlit/proto/Navigation_pb2.py,sha256=7LpxaKV6VX0pjXaPmOZ4Vj7C_M3mjn8MgU3HDvjkusU,1696 +streamlit/proto/Navigation_pb2.pyi,sha256=vVvfxZz0tk5CsCeXLXd9PUgVKb579RePS4c-G3EwVEk,4613 +streamlit/proto/NewSession_pb2.py,sha256=UyYllDr_YiSBmYqwd7RBxN6JsHbUKMN6zAh1etDqO2Q,9510 +streamlit/proto/NewSession_pb2.pyi,sha256=ppetSxFBAfY8rK1V0p18isMg0n5ZMLSFgvfd7JBPMd4,52325 +streamlit/proto/NumberInput_pb2.py,sha256=7NwFWUyRVj6g_7XFScj6Wn7kpzh5FiOUJhTu_BWQ7To,2396 +streamlit/proto/NumberInput_pb2.pyi,sha256=tVV0j8ybIxDU_w-LZrMBC10DQ_x1ZGVPQGRi_DMgGZI,6566 +streamlit/proto/PageConfig_pb2.py,sha256=r2SH0WVBrGBD3WxhfNgzi6nuvLg7rer_GxsnBHinZdY,2630 +streamlit/proto/PageConfig_pb2.pyi,sha256=iWRG6nGF4OaG6VU0vxd6mr730KoAgZUUQnRhZQNNfv8,9828 +streamlit/proto/PageInfo_pb2.py,sha256=zhun0BNs6VNKKlm9GVBxkC1trf2NSwgtG9mx_HuNMHw,1064 +streamlit/proto/PageInfo_pb2.pyi,sha256=kHvuhRNgXOadTgiahxpKI4G8qE1Vd8LbhTnGerVWAH4,1862 +streamlit/proto/PageLink_pb2.py,sha256=q3uF0iJWFQ-O0vnDIScpXiM2AifMLPd8HThcVjFQu1U,1671 +streamlit/proto/PageLink_pb2.pyi,sha256=M8w09VGdx9OgzFR96mAXmqtxoPe3k8-dW6_4rKUr4po,3631 +streamlit/proto/PageNotFound_pb2.py,sha256=Rud99VWf7aS1BRmpnNPbDt9_4su1AIa1cIrJyjX35rs,1081 +streamlit/proto/PageNotFound_pb2.pyi,sha256=EN_mssu1FJwG5HtDW5vQulNB2_L0F0ACue9GZHFFMq4,1827 +streamlit/proto/PageProfile_pb2.py,sha256=331JR0wx9G07UbvnTIHzbWavgdcbI38oCodggJcOs_c,2058 +streamlit/proto/PageProfile_pb2.pyi,sha256=i4HOKmo3DrVKb0TTuld6TgDCI7rKeST8qRWOqZsLS1E,7944 +streamlit/proto/Pagination_pb2.py,sha256=aGiSKcgnU4hc6duYG4DEYRylCD0vw6blVj5J36gXaWk,1491 +streamlit/proto/Pagination_pb2.pyi,sha256=xW8bI0LFUph-hxMg7Roh8G1LD1pyDH6oQHqfrmc79xA,3820 +streamlit/proto/ParentMessage_pb2.py,sha256=psGljPFPM3XpRuU2gPzTiK-iWwx0n5zvBd3LOikiGnE,1084 +streamlit/proto/ParentMessage_pb2.pyi,sha256=9lYfo2FNrMcvc7VUXGSDdcp-LF15f8rcUa-iMX4us_o,2014 +streamlit/proto/PlotlyChart_pb2.py,sha256=yXGFp6d0QbIkCzOC_U0yzVPJSfh-kObYqPxzgwWodMA,1628 +streamlit/proto/PlotlyChart_pb2.pyi,sha256=ttrKoh52I6Tka6UIDD37APQOZL1uhrY0upVS80vWASw,4052 +streamlit/proto/Progress_pb2.py,sha256=EHwpZ4F3YRemDxpi3Pil1SRhNbjVV9dVxnp5BX5ALPg,1090 +streamlit/proto/Progress_pb2.pyi,sha256=kRRBQsj8dAtx0s4AOu6twuNKIjTG57tDUVn7kb1HvSQ,1825 +streamlit/proto/Radio_pb2.py,sha256=DZySs8X5Hvn5dMzZul4soMLRiME-PR9Z_Syto_V-6Cs,1827 +streamlit/proto/Radio_pb2.pyi,sha256=c-Ly4Ze0h5ERxhmKx9TfbEq92uwHMrV7UYY8NyPbhm4,5183 +streamlit/proto/RootContainer_pb2.py,sha256=UQDOey_Mvr-pWjQ1Oyu-foEdBiR90AVzUgXo1nEomhk,1162 +streamlit/proto/RootContainer_pb2.pyi,sha256=vcrTm-AFF7g7pr-HZsAQbTTD_UUnivfn0uVNX8JQQ8I,2160 +streamlit/proto/SelectWidgetFilterMode_pb2.py,sha256=bJrPfvLzwOAJlIxisNu-j7T_Re5DTbsPFYLyWJKypHQ,1292 +streamlit/proto/SelectWidgetFilterMode_pb2.pyi,sha256=dILYpVFcXm1K-oI4umR8un_iBLsilCy6kvgSitEThhI,2104 +streamlit/proto/Selectbox_pb2.py,sha256=B2j6zpXNn5QAmliwfuAGuDW3UCKBrcVaooscv3YrMjM,2156 +streamlit/proto/Selectbox_pb2.pyi,sha256=sQGSxVb8eDtT9k3maRcVvuK9pjmIXiYRRtSPscsjhsU,6022 +streamlit/proto/SessionEvent_pb2.py,sha256=lish65JHAcrTU8Vcv546S7UbistE19MlH6mjYZ_HNjY,1391 +streamlit/proto/SessionEvent_pb2.pyi,sha256=S_-U8YOjiuLptr3siCcerEGO3T8NXhJuHtpE9CVtQWY,3319 +streamlit/proto/SessionStatus_pb2.py,sha256=Ck4GGiCP_EYAkjCmNNofmog-vuki3gHDvoLUiBVZ_6M,1143 +streamlit/proto/SessionStatus_pb2.pyi,sha256=TkCGHwVtoHmCrVjVn1eaieUrYy_-WUeazC2Xv_JTrxs,2653 +streamlit/proto/Skeleton_pb2.py,sha256=Ukc1zqq59oDYp1Vny2m5gJm2WruLKcPxavUrQZMkYOA,1531 +streamlit/proto/Skeleton_pb2.pyi,sha256=6jyZTlCWI00gG-Uue4D15Uin6TSkvNOWK7FruMwALqQ,4088 +streamlit/proto/Slider_pb2.py,sha256=-rTTmeUBbjLxYr7WFzhuEQzY_ZxM7soLE_6pQWbLIgs,2426 +streamlit/proto/Slider_pb2.pyi,sha256=CXsjSIBwuYHDo7yOFx_JTMTY31u4hkSaczHfdtFyUqM,7288 +streamlit/proto/Snow_pb2.py,sha256=edoxfsyp5-SVOLZhq_lASW4-nPf4aDbyiCVdtWGk2fg,1040 +streamlit/proto/Snow_pb2.pyi,sha256=-MP_CJBHdlVKJ_O6neB5yVKBNwM_GQ8qV5snX0HU0Do,1760 +streamlit/proto/Space_pb2.py,sha256=ppArY4KeReOm-JcCFRR7P-gy59ZHaZDPjHNc1fCmoBM,1007 +streamlit/proto/Space_pb2.pyi,sha256=xQRI_JfdQ47-V4-S5hVUos8STfsPJqahCIkCKhoFMao,1964 +streamlit/proto/Spinner_pb2.py,sha256=-Ygly71U02RaXe0MNjW7f3rNmxMyaSN6GU3T8BEytZc,1136 +streamlit/proto/Spinner_pb2.pyi,sha256=opVbV0By39nZCo9Jwaaa1uMf1JG7BeATGEC2ScMw5vU,2141 +streamlit/proto/Table_pb2.py,sha256=N6PUFXe4gCsDppnG5eNKrIuqQ8bhGj8nTy7Mivq8-Vw,1552 +streamlit/proto/Table_pb2.pyi,sha256=W78GHeX36Ye-YktN05FU_HUg26PHVJ4_1uQNXy3093A,3693 +streamlit/proto/TextAlignmentConfig_pb2.py,sha256=oHqZFUuRIglSpajKLqFbHj2M8c1iNUj4SYFn60EEnEw,1485 +streamlit/proto/TextAlignmentConfig_pb2.pyi,sha256=k8n40YJuktqRxWW_mb_AKC7YydLLwQZcI1dFAsjY7T0,2961 +streamlit/proto/TextArea_pb2.py,sha256=pOf6T4B1ZO_zhpXMKS1DNK21-kxuKGaHje3HmCUeXC4,1796 +streamlit/proto/TextArea_pb2.pyi,sha256=XrmHMVTd3t7_gk5iiAMlBigIcJmha5O4WSn018srMAI,4691 +streamlit/proto/TextInput_pb2.py,sha256=HTBKeH0aFYPYVoTjNuphQLX_YvXkuSPOsoTfs4R6TyQ,2100 +streamlit/proto/TextInput_pb2.pyi,sha256=uiV7Ylr-MZEhi8kWuxiC1G8k3EPdvu_pE8MkWVkYZiA,5936 +streamlit/proto/Text_pb2.py,sha256=cS_AZEbzWZzrBZd1uhDLo-tIiJWEx-0ZdNIv5G0Vd8U,1070 +streamlit/proto/Text_pb2.pyi,sha256=jwEutMcR4vLh_-6R2cDLrW8QM_ijMTqc5xUFDketbog,1867 +streamlit/proto/TimeInput_pb2.py,sha256=rlor-mM-WzO7pwaWXGk9Ti0cW5Q8YXon5bieRH-1uRM,1736 +streamlit/proto/TimeInput_pb2.pyi,sha256=XShT9uDsXKw8cTd59x8HT3SBFFa5GDwxTU7JRRuYrT4,4453 +streamlit/proto/Toast_pb2.py,sha256=3YB7YQRKLDy5F3S2Io4oy-jLNQOViDpswXOs8EYhCZ0,1157 +streamlit/proto/Toast_pb2.pyi,sha256=BVFoqERqhfGgSa7SW2vyFcD3Q6CWP5xp4uEjjsP6Pyw,2504 +streamlit/proto/Transient_pb2.py,sha256=JysT6PAPrvgoUKdNEBWxgKTE02RTcsTg9-HnGkFkNCg,1204 +streamlit/proto/Transient_pb2.pyi,sha256=-GhIRVTjbAcE7EGSqS3vTqFOkISq1dJiPwX7X2XEUpo,2109 +streamlit/proto/VegaLiteChart_pb2.py,sha256=sfgMh3hRwqIHZji00MLuq2jEm2uC8gYJKT9zBWlABqU,1705 +streamlit/proto/VegaLiteChart_pb2.pyi,sha256=7dEDDMWq5jsLQ92nphXwDwSBekM25NkBorLkLk1oy-s,4027 +streamlit/proto/Video_pb2.py,sha256=13kteW4QBKr72LCWJQCF_qItFEFIovD00NM-ad5ljM8,2068 +streamlit/proto/Video_pb2.pyi,sha256=bHHXs7F0QEEaWC1GCtX0dsNkKwfWV9xk7gHr48zLf5o,5668 +streamlit/proto/WidgetStates_pb2.py,sha256=dUdVjdImq85FQQpBMZQsCnbuHNIEnXDwNiFJAf3Fxfk,2427 +streamlit/proto/WidgetStates_pb2.pyi,sha256=T0EKopE2ua0S3yroJvS6AfaSEcUpBDEzSbDiyP6QrZk,8051 +streamlit/proto/WidthConfig_pb2.py,sha256=KjZM-BHG9uE249nFxWvTc4jtOZ5vx3k7J3RhL1Iy-m4,1261 +streamlit/proto/WidthConfig_pb2.pyi,sha256=QBbMnDJAZblySNhV_DPmoe_al46vDtLVHaUfopybZ4o,2650 +streamlit/proto/__init__.py,sha256=mJQrqVfAP9EbwEVIF-vaiE4Xlq6DvXXB5lTYrKWZtnQ,668 +streamlit/proto/__pycache__/Alert_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/AppPage_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/ArrowData_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/ArrowNamedDataSet_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/AudioInput_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Audio_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/AuthRedirect_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/AutoRerun_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/BackMsg_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Balloons_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/BidiComponent_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Block_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/ButtonGroup_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/ButtonLikeIconPosition_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Button_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/CameraInput_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/ChatInput_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Checkbox_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/ClientState_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Code_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/ColorPicker_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Common_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Components_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Dataframe_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/DateInput_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/DateTimeInput_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/DeckGlJsonChart_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Delta_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/DownloadButton_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Element_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Empty_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Exception_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Favicon_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Feedback_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/FileUploader_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/ForwardMsg_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/GapSize_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/GitInfo_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/GraphVizChart_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Heading_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/HeightConfig_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Help_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Html_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/IFrame_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Image_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Json_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/LabelVisibility_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/LinkButton_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Logo_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Markdown_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/MenuButton_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Metric_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/MetricsEvent_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/MultiSelect_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Navigation_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/NewSession_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/NumberInput_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/PageConfig_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/PageInfo_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/PageLink_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/PageNotFound_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/PageProfile_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Pagination_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/ParentMessage_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/PlotlyChart_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Progress_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Radio_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/RootContainer_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/SelectWidgetFilterMode_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Selectbox_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/SessionEvent_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/SessionStatus_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Skeleton_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Slider_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Snow_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Space_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Spinner_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Table_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/TextAlignmentConfig_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/TextArea_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/TextInput_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Text_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/TimeInput_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Toast_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Transient_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/VegaLiteChart_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/Video_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/WidgetStates_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/WidthConfig_pb2.cpython-314.pyc,, +streamlit/proto/__pycache__/__init__.cpython-314.pyc,, +streamlit/proto/__pycache__/openmetrics_data_model_pb2.cpython-314.pyc,, +streamlit/proto/openmetrics_data_model_pb2.py,sha256=jVXGBRwWB7uum24aLGxcjL3UDyoXGuzrRdozUPyhAl8,6225 +streamlit/proto/openmetrics_data_model_pb2.pyi,sha256=B_a--VitSPOelF-c4oXCFkxmD55XAtMTmLXBFJC9mfs,24626 +streamlit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +streamlit/runtime/__init__.py,sha256=46BxeX53YcUUCZTfEVg0Qv25OXqOeh1YwAxghkkzLOk,1523 +streamlit/runtime/__pycache__/__init__.cpython-314.pyc,, +streamlit/runtime/__pycache__/app_session.cpython-314.pyc,, +streamlit/runtime/__pycache__/backend_operation_handler.cpython-314.pyc,, +streamlit/runtime/__pycache__/connection_factory.cpython-314.pyc,, +streamlit/runtime/__pycache__/context.cpython-314.pyc,, +streamlit/runtime/__pycache__/context_util.cpython-314.pyc,, +streamlit/runtime/__pycache__/credentials.cpython-314.pyc,, +streamlit/runtime/__pycache__/download_data_util.cpython-314.pyc,, +streamlit/runtime/__pycache__/forward_msg_cache.cpython-314.pyc,, +streamlit/runtime/__pycache__/forward_msg_queue.cpython-314.pyc,, +streamlit/runtime/__pycache__/fragment.cpython-314.pyc,, +streamlit/runtime/__pycache__/media_file_manager.cpython-314.pyc,, +streamlit/runtime/__pycache__/media_file_storage.cpython-314.pyc,, +streamlit/runtime/__pycache__/memory_media_file_storage.cpython-314.pyc,, +streamlit/runtime/__pycache__/memory_session_storage.cpython-314.pyc,, +streamlit/runtime/__pycache__/memory_uploaded_file_manager.cpython-314.pyc,, +streamlit/runtime/__pycache__/metrics_util.cpython-314.pyc,, +streamlit/runtime/__pycache__/outside_container_wrapper.cpython-314.pyc,, +streamlit/runtime/__pycache__/pages_manager.cpython-314.pyc,, +streamlit/runtime/__pycache__/parallel_coordinator.cpython-314.pyc,, +streamlit/runtime/__pycache__/runtime.cpython-314.pyc,, +streamlit/runtime/__pycache__/runtime_util.cpython-314.pyc,, +streamlit/runtime/__pycache__/script_data.cpython-314.pyc,, +streamlit/runtime/__pycache__/secrets.cpython-314.pyc,, +streamlit/runtime/__pycache__/session_manager.cpython-314.pyc,, +streamlit/runtime/__pycache__/stats.cpython-314.pyc,, +streamlit/runtime/__pycache__/theme_util.cpython-314.pyc,, +streamlit/runtime/__pycache__/uploaded_file_manager.cpython-314.pyc,, +streamlit/runtime/__pycache__/websocket_session_manager.cpython-314.pyc,, +streamlit/runtime/app_session.py,sha256=pagrG2Mw_E9V-ojPoMAcfdhxLhNauvJ1U3_kWN--CaA,58150 +streamlit/runtime/backend_operation_handler.py,sha256=OiNPDv5uk_qGA8DRnlPBlMU92cLK8UBMMvXqFIi6Pz4,12414 +streamlit/runtime/caching/__init__.py,sha256=cyqYE07yMnt5EoNbn55hUebfzNglFpuwHWTnVMimJmM,3767 +streamlit/runtime/caching/__pycache__/__init__.cpython-314.pyc,, +streamlit/runtime/caching/__pycache__/cache_data_api.cpython-314.pyc,, +streamlit/runtime/caching/__pycache__/cache_errors.cpython-314.pyc,, +streamlit/runtime/caching/__pycache__/cache_resource_api.cpython-314.pyc,, +streamlit/runtime/caching/__pycache__/cache_type.cpython-314.pyc,, +streamlit/runtime/caching/__pycache__/cache_utils.cpython-314.pyc,, +streamlit/runtime/caching/__pycache__/cached_message_replay.cpython-314.pyc,, +streamlit/runtime/caching/__pycache__/hashing.cpython-314.pyc,, +streamlit/runtime/caching/__pycache__/legacy_cache_api.cpython-314.pyc,, +streamlit/runtime/caching/__pycache__/ttl_cache.cpython-314.pyc,, +streamlit/runtime/caching/__pycache__/ttl_cleanup_cache.cpython-314.pyc,, +streamlit/runtime/caching/cache_data_api.py,sha256=UccymYS5lhGfgWVB2l99eDGMZVz9TxFGSV9c_mBO_cI,28432 +streamlit/runtime/caching/cache_errors.py,sha256=GRft6KMCSt3qUp5ImLUNqVIjyopuAeVvKUy0zPpEp6g,4911 +streamlit/runtime/caching/cache_resource_api.py,sha256=DIgnRPCQmUehhueV_OnaQtnbKmN7T5ffiEwGJ9d0phA,29388 +streamlit/runtime/caching/cache_type.py,sha256=h8sjQY6g-kfsqj49PylD1acBIqF9qlK40cBIj_DHGes,1131 +streamlit/runtime/caching/cache_utils.py,sha256=eIhxP-UzFfppWpIGCp8s9HopF-uPgCzmQAmvGFB0lAo,22640 +streamlit/runtime/caching/cached_message_replay.py,sha256=S0v5M7MlIEArHHrJ9XmlhK369R5E8e3_l7ccEXybK-0,10634 +streamlit/runtime/caching/hashing.py,sha256=0U9qmnbqHVcCiW2OFUWY30TwEqVTDtPWdkSVTfPSybM,23940 +streamlit/runtime/caching/legacy_cache_api.py,sha256=4DZZt2vZ3xqnt9WgJYPh84k8X6H0udXX9q7DM381tpA,6091 +streamlit/runtime/caching/storage/__init__.py,sha256=YhgIrED4iSg8TjXIimPkwZ9BFOQ2ODdBKbytcrxJqmQ,965 +streamlit/runtime/caching/storage/__pycache__/__init__.cpython-314.pyc,, +streamlit/runtime/caching/storage/__pycache__/cache_storage_protocol.cpython-314.pyc,, +streamlit/runtime/caching/storage/__pycache__/dummy_cache_storage.cpython-314.pyc,, +streamlit/runtime/caching/storage/__pycache__/in_memory_cache_storage_wrapper.cpython-314.pyc,, +streamlit/runtime/caching/storage/__pycache__/local_disk_cache_storage.cpython-314.pyc,, +streamlit/runtime/caching/storage/cache_storage_protocol.py,sha256=l-MbooSk1wn9Q9W5YZrQJ7CwklbAprLJfk3fO--uEvY,9099 +streamlit/runtime/caching/storage/dummy_cache_storage.py,sha256=22eYps1L9_jNW5fL-gC5Dnnqq5WR52c8bkvgR2-s4Go,1963 +streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py,sha256=rK-h8ZJTGwKyGnaqtukbYbCBaDvAbHRcEeA4zCRTAAo,5944 +streamlit/runtime/caching/storage/local_disk_cache_storage.py,sha256=yOItdfzSb0LpnG-75tfMmd4ed_v7IVRFybo3k8b8EJs,9394 +streamlit/runtime/caching/ttl_cache.py,sha256=6mmU62KggKxOPzeff_ANM-b5Zm33ZOVTzqsiRENcDKI,9472 +streamlit/runtime/caching/ttl_cleanup_cache.py,sha256=x1VrctguGU05BwcKgMLNwB7T8kIhFC8EH_rVkzS62XE,3280 +streamlit/runtime/connection_factory.py,sha256=-l8BuXxZMtJeR7ubQQot4pnFTfDKwB4p96WZe5EPHOk,17423 +streamlit/runtime/context.py,sha256=1sr9iPAj0oWWmq-pmg6cj4Fr7_nyP9f5AU6aFB1pKfk,14279 +streamlit/runtime/context_util.py,sha256=A0qtQEc_QyEPVFhEh917Clkt-Kux0RWkteBWLTTdOlc,1702 +streamlit/runtime/credentials.py,sha256=9Yi2aY-4Xb9T0c9xcaJuxAau0rh1RVZVvk1qUd6QuiQ,11002 +streamlit/runtime/download_data_util.py,sha256=bPs1IUctr2roq3uK7R4MS4Kl6OJDaveGyHNULmNWCN4,1898 +streamlit/runtime/forward_msg_cache.py,sha256=067F4gsah9-EWEk3prp9tcIJPu9afwGd6_udWo2Qp34,3690 +streamlit/runtime/forward_msg_queue.py,sha256=KcE00Yp3p9FZYSgpMIIkWkWxeRXp59ZLiK-GNHDdwNY,10728 +streamlit/runtime/fragment.py,sha256=yuoc3MbRrVmG0W2r1aSxgyIn3L9IrVr7KrTTmyNMVj4,35241 +streamlit/runtime/media_file_manager.py,sha256=CBJCgaVtag3g63bKpfGdGOkk5Ma9J5qF3AYWLadBXuQ,15170 +streamlit/runtime/media_file_storage.py,sha256=qalVjh-yVWJf2zepR6rOsTlCvoC6GxJ_AeFlrvpbbtQ,4468 +streamlit/runtime/memory_media_file_storage.py,sha256=9xHEJXMtt6bkGUcOQm1A-f7kHPUL50UOxEcfDj8NIIA,8405 +streamlit/runtime/memory_session_storage.py,sha256=_ZvRDBW6cravZOOG0S9zLKcH8ujmyimrqmCw1MQip0o,3049 +streamlit/runtime/memory_uploaded_file_manager.py,sha256=-JnxRAbwuzRb-NFrYbPG2kvfmd2InSKpY2jXs8XsMb4,6239 +streamlit/runtime/metrics_util.py,sha256=njAWOhN389I9Oehu57GR_qWjOifM15kZyYJ-ixGH51E,20406 +streamlit/runtime/outside_container_wrapper.py,sha256=OYynEKIF3rJTePXvkV4He6XxpcSqVhxWDXhyHy2cXUc,1751 +streamlit/runtime/pages_manager.py,sha256=V2YIIviGn-e2_JXrUfq1TKBv3JDxP6pJhYgd_Oe1P4o,8328 +streamlit/runtime/parallel_coordinator.py,sha256=kkleNbTCjYuRSNGAFgbaU3GVfDjlxtL8Pbud-0_OYpc,9367 +streamlit/runtime/runtime.py,sha256=eFxl8SaX7f7Bbsng53ujNsXBO5d-y-Uerrh9PfvUpRs,30000 +streamlit/runtime/runtime_util.py,sha256=aF_2BbSLg-e1vsCmUNJnM8ojOWCtjpolTMtA7cKGJeI,6636 +streamlit/runtime/script_data.py,sha256=bHTTrT4U3YWlyueKODwGTfJw6IuH4zHue5C6dLCJ3kw,1749 +streamlit/runtime/scriptrunner/__init__.py,sha256=VvgTufYwVy7xHTvVsEcE06zQUcy4K6i5v7fBQOVy05I,1266 +streamlit/runtime/scriptrunner/__pycache__/__init__.cpython-314.pyc,, +streamlit/runtime/scriptrunner/__pycache__/exec_code.cpython-314.pyc,, +streamlit/runtime/scriptrunner/__pycache__/magic.cpython-314.pyc,, +streamlit/runtime/scriptrunner/__pycache__/magic_funcs.cpython-314.pyc,, +streamlit/runtime/scriptrunner/__pycache__/script_cache.cpython-314.pyc,, +streamlit/runtime/scriptrunner/__pycache__/script_runner.cpython-314.pyc,, +streamlit/runtime/scriptrunner/exec_code.py,sha256=zBhR7X7LAPLTBSdyfmyxekIC2mcyyuntJ3qXAr9EYAI,5818 +streamlit/runtime/scriptrunner/magic.py,sha256=rRa-yoirHejLlEaTmVsQUgfsITCfCYymf9Nfw6kZ2c0,9267 +streamlit/runtime/scriptrunner/magic_funcs.py,sha256=zIaY9TvSVKpfzxbqPB9To0fmQUIqyn51783Fd8VhowY,1056 +streamlit/runtime/scriptrunner/script_cache.py,sha256=yAdR1P9y4McRBL661OtuSHqYBUHesP68z_Njw5oQ0Uk,2864 +streamlit/runtime/scriptrunner/script_runner.py,sha256=Pi4zex6RSOuk3oZ14gVbNyZOcRDKbOHMScj6cCXzqnw,40264 +streamlit/runtime/scriptrunner_utils/__init__.py,sha256=8XUue1g4ZN9lMIHqo9DZcaH0U2013IYQrhFjluiacdE,840 +streamlit/runtime/scriptrunner_utils/__pycache__/__init__.cpython-314.pyc,, +streamlit/runtime/scriptrunner_utils/__pycache__/exceptions.cpython-314.pyc,, +streamlit/runtime/scriptrunner_utils/__pycache__/script_requests.cpython-314.pyc,, +streamlit/runtime/scriptrunner_utils/__pycache__/script_run_context.cpython-314.pyc,, +streamlit/runtime/scriptrunner_utils/__pycache__/script_run_context_attr.cpython-314.pyc,, +streamlit/runtime/scriptrunner_utils/__pycache__/shared_run_state.cpython-314.pyc,, +streamlit/runtime/scriptrunner_utils/__pycache__/thread_safe_set.cpython-314.pyc,, +streamlit/runtime/scriptrunner_utils/exceptions.py,sha256=ktaWBvIstHIXxN9kuOdi_PbBMeBhIvefBUluruFkW3w,1543 +streamlit/runtime/scriptrunner_utils/script_requests.py,sha256=Z7BfHLU1e3PDmroYubI1SGAFjk3b3vZefuh95lCoPKg,12820 +streamlit/runtime/scriptrunner_utils/script_run_context.py,sha256=WJGDaqoilxq-G8nIC75kbZImawarG3PO3t-78dLrwyE,18268 +streamlit/runtime/scriptrunner_utils/script_run_context_attr.py,sha256=dtGlUQ1RKGkJooS4bN5YOuIsyUnM2NDLLPgFZ2BscW0,986 +streamlit/runtime/scriptrunner_utils/shared_run_state.py,sha256=o68LaI3ZDCSmvOFnt28YHHNX1BrWjBAVjkAoyckr4TA,3341 +streamlit/runtime/scriptrunner_utils/thread_safe_set.py,sha256=siz7cK65iAAbAzQv4kwvNkLc3SfMI9x_3MIN99wN5-A,2534 +streamlit/runtime/secrets.py,sha256=RuvSNAqbl6dArtzJKl90IMexL2y0fRRgIQ5lCTEyXZw,25035 +streamlit/runtime/session_manager.py,sha256=MT5dkci8li63RC6F2w1aDUDF_Mp0dHpWxaH2INrN6d4,14993 +streamlit/runtime/state/__init__.py,sha256=tiK1-M2ILSN0Sa0s5cHoM51BvH3aMLkmCoUA8_R0MvY,1534 +streamlit/runtime/state/__pycache__/__init__.cpython-314.pyc,, +streamlit/runtime/state/__pycache__/common.cpython-314.pyc,, +streamlit/runtime/state/__pycache__/presentation.cpython-314.pyc,, +streamlit/runtime/state/__pycache__/query_params.cpython-314.pyc,, +streamlit/runtime/state/__pycache__/query_params_proxy.cpython-314.pyc,, +streamlit/runtime/state/__pycache__/safe_session_state.cpython-314.pyc,, +streamlit/runtime/state/__pycache__/session_state.cpython-314.pyc,, +streamlit/runtime/state/__pycache__/session_state_proxy.cpython-314.pyc,, +streamlit/runtime/state/__pycache__/widgets.cpython-314.pyc,, +streamlit/runtime/state/common.py,sha256=N89SmoWySnch3GC_da3D2Vi-C2AlFSM-nJ_u71D-WEo,10993 +streamlit/runtime/state/presentation.py,sha256=M3cqYg_3iy7PAPyqgSm0Xyg_lC5fUKyTKEwdQR_wuGE,3084 +streamlit/runtime/state/query_params.py,sha256=C3NYWtK3NE-qzPgJZzFC8SzYXNQ0HPcOWM7TFGKVhxU,34523 +streamlit/runtime/state/query_params_proxy.py,sha256=sy-WVF9N2XeWp55odzlP-4AVwsBiE91SEZ8z4e_RyMw,7671 +streamlit/runtime/state/safe_session_state.py,sha256=72QLXZ3rjiBfX4oDPsU8tIdYrXDybidrXYZJukL4N7c,5610 +streamlit/runtime/state/session_state.py,sha256=dcJuIkztpNHSh0UU2Ux5GfR2Zq3Yhh-R1A5TaoC_hkI,68546 +streamlit/runtime/state/session_state_proxy.py,sha256=RI9QquUlMgK6XyUYF3PmpN1mfP6q-_SBju5pIFTrdRU,5585 +streamlit/runtime/state/widgets.py,sha256=jmQs3kALhZ8-C_9PnU8Uj7zjMzcJ3zgyOYrSAhB8OCc,10023 +streamlit/runtime/stats.py,sha256=8MLrNnXGv3ZXXa5h-xejfE9Ei10Uvd54SduvvHoBAjM,13733 +streamlit/runtime/theme_util.py,sha256=IAoskInHN9o0y07w7SNdX6307QE9tsxrR6BjM6EaljI,5805 +streamlit/runtime/uploaded_file_manager.py,sha256=W49x9Tn7M2FSWDAWM5BP57d5D5jnD5IVMnRVKhKpM1E,5026 +streamlit/runtime/websocket_session_manager.py,sha256=rsm1TaZL4PRVX_QGyF4zXU1wSC2VHERArqsExnnL2r8,17519 +streamlit/source_util.py,sha256=ueDKNXnRJbF12S-rgxMPoZ-KLDLkjDHuzwbLvA1PM2c,3200 +streamlit/starlette.py,sha256=bBIonEukZmXqlrR6FA7SRjEgMkYmvfhuQQfMEGTrzY8,1051 +streamlit/static/favicon.png,sha256=if5cVgw7azxKOvV5FpGixga7JLn23rfnHcy1CdWI1-E,1019 +streamlit/static/index.html,sha256=VHZhPg_wIzTtfQ4P2S1FeZK1wxuNC8LmBBbrzeqg0sQ,10626 +streamlit/static/manifest.json,sha256=S13mOsK-W9-z-tM3lvKx--Nudmee6hcI_oZaiLrs4qU,174614 +streamlit/static/static/css/DataFrame.DUkanX9_.css,sha256=kQB_R0CeqSMsjzzvG_REUzp99FI2GRS931G-MwBUDyc,12276 +streamlit/static/static/css/DeckGlJsonChart.s6LXjV0D.css,sha256=K3i4ZEcgKTYw8YnoGTCb4p5jeXM708QFjZ6W59g0aUI,34104 +streamlit/static/static/css/index.C4kyYqWK.css,sha256=9hLWyJn6hUzgKXhmEvKHSkrjgm0GmzPUeMs0YsVs74Y,1069 +streamlit/static/static/css/katex.CAfVENUR.css,sha256=mnvOYb5ViE0RM-3v6-6MU7QtD1xGaQZWm2do4sCSxa8,28894 +streamlit/static/static/js/AlertElement.BAyMiYwt.js,sha256=Ny7AaQKRjXJoB4NjnQcXYjii8BsxcavG96W4GolCpFo,1585 +streamlit/static/static/js/ArrowVegaLiteChart.C5lWLbxa.js,sha256=71H1vOphEeRcxab2h5rDgOZSYCe8PGGuQosuBZxi6E8,12808 +streamlit/static/static/js/Audio.Bh9DVwbW.js,sha256=1Gh5qpq4kWIiLQQduodbmb5ZZFJXAUgTs5lsg2G9oOU,1844 +streamlit/static/static/js/AudioInput.Bj4ItJDj.js,sha256=cAR8M9d8wbjzVApJiv355m3s8F_LN6KdII2lUGpC7d8,13944 +streamlit/static/static/js/Autocomplete.D9k6mFCZ.js,sha256=-3O2PBxdEPdMEU6dWYaxcbNrJ4Dbq4bxFTnIF1RC7RU,204 +streamlit/static/static/js/Balloons.BQJiZ9SK.js,sha256=QB5al8jw8xCjlOsGAMIqxFsZEP-pey3eij7RH82ohdE,1612 +streamlit/static/static/js/BaseButton.DzUQ5vsa.js,sha256=XSPiR7Mf2RDepMT8fqAV7kR_SDg99U11CrEJUqEjQ88,1182 +streamlit/static/static/js/BaseButtonTooltip.DyFZqtoX.js,sha256=v91ZZLlV__BitlcKqp0ld38Sjy3N8wetaUUOSupFHtE,431 +streamlit/static/static/js/BidiComponent.B_vvnuke.js,sha256=qwmibzT9ndZmmoDd4Gq_z3QqXnZ5hjgSRFn332CmCag,14469 +streamlit/static/static/js/Button.CGPLwGvS.js,sha256=94Zh47XOFGh4g6IlYQl7dwqpM39fn-M7ck2C_xlqoDQ,1096 +streamlit/static/static/js/ButtonGroup.DO6jL9SN.js,sha256=gfNSCk_Q1DHNOe6BCfA9-wyjOaEOFFnwooI1UghsNYk,2990 +streamlit/static/static/js/CameraInput.BGpQNOjY.js,sha256=zMAr_rlkUIMRMh9HD0hmVsGppGxnVYzIfVlXBqRXCb0,19178 +streamlit/static/static/js/Cancel.esm.CTWwYXdL.js,sha256=5Wbr5kzQ91hSx4euPuB7GtEUid-lO1a27IhYL7tNK4o,793 +streamlit/static/static/js/ChatInput.DJI0M0Iq.js,sha256=V5EtVsqocpmCfI5lGwg9N5Wh0u6ZBK1lYH1khXdGKCU,22654 +streamlit/static/static/js/Check.esm.B4TBPV6z.js,sha256=3X0qolMSmvjY5_9dZxkiQT5ZkWGXrKn_ZS-x9b2MK5Y,602 +streamlit/static/static/js/Checkbox.CrcA6N0j.js,sha256=DD_AsgWmhjVv1wHOc9KrzYHxsD_Keg4aKHUjKiF3yws,2129 +streamlit/static/static/js/Close.esm.DiV9yyug.js,sha256=OIeYJFDo9YqpQW3eZDX9fPCqmXa1TnTC3YsQce5PiZI,1163 +streamlit/static/static/js/CodeBlockCopyToolbar.D57Zh6DT.js,sha256=OX-ZdPQ0guJ5G65-22N7fYJ9py0K91J_eqYb_RA-LwY,645 +streamlit/static/static/js/ColorPicker.C_qg1qMx.js,sha256=3xSrG3ApZ_NdYtelQJsFBpL0wmyOpX5QjH6O1xgfSJ4,111677 +streamlit/static/static/js/ComponentInstance.DhPDHW9t.js,sha256=AfgfJVS_Eb4jtYaY_d5fsz1k2CmnwzpfO4Iww5xTHQ4,6211 +streamlit/static/static/js/ContentCopy.esm.Dq-fIx3A.js,sha256=MyneekmPxzkyRpi023zi0XnOAUpxT5i-eyioIROdlwQ,678 +streamlit/static/static/js/DataFrame.Wny8mRut.js,sha256=QfGnEPVzSHNc7JDuA6W4J2QY06OpjJHTuYPcmEIx23w,458953 +streamlit/static/static/js/DateInput.VmwpQFr5.js,sha256=o2HbfEeehph3I371CNBoT1OszU3Uh4CoDV_IngXHrEQ,18792 +streamlit/static/static/js/DateTimeInput.grj3wp9V.js,sha256=bfTLgyTq3Qvibyp_ruZGMhUSugoLNQLUU2PdnBZQX0c,8498 +streamlit/static/static/js/DeckGlJsonChart.Cl5CHFIi.js,sha256=7PsrUmF9odC80ZI5bhXCK6oZNjqoJlqNqqmbn8hQL9w,2424070 +streamlit/static/static/js/Delete.esm.CDosXh7J.js,sha256=7aYSOEBU1S32xGUaFMIbdha5g6gEnl-UK4a8j1HMGzc,639 +streamlit/static/static/js/DownloadButton.BwGuQT8W.js,sha256=X_gvQ8NhpBEqR0ZeE_zhUxLljcNOCCLrn-t__y-uoAA,2265 +streamlit/static/static/js/DynamicButtonLabel.UT8nPWDL.js,sha256=JS0q02Jw_xKf5Q1p4G1gvxKjemViOPthEbUGU0FQGwg,10860 +streamlit/static/static/js/DynamicIcon.44zobID_.js,sha256=vLUjDpK-OM5TgQSO2x1jWCgZS14jfX__9X8aLaAqBvg,3060 +streamlit/static/static/js/ErrorElement.BWmlOcKX.js,sha256=82hGfI3tDvglsIGXvUwj1UMvUQDlkD15cu8Z8A6_mqw,6813 +streamlit/static/static/js/ErrorHandling.H5STbbYb.js,sha256=OawiEoEkIet5sI0cIW-n9higZDrJrXom7kQbMw3f7Zc,71 +streamlit/static/static/js/ErrorOutline.esm.CZ5wypOV.js,sha256=0Sloq9l9_DilhJlYReL_XjmjbR5Q8HFfrLELGmZc-Hk,666 +streamlit/static/static/js/Feedback.DgyQ79Uj.js,sha256=2PbNOgZLRjIbAdGrCSVfX4WJxT97NuF-Y9k2bIuXuZs,3753 +streamlit/static/static/js/FileDownload.esm.BM_tuzhj.js,sha256=K45OwtwNTHWyTAkxNFYbPVaqR7-yN6NN3q85l9g9mLs,666 +streamlit/static/static/js/FileSystemDirectoryHandle.p7DJujU-.js,sha256=h3SRzldngqZ8cHsDm5BNlpaTLw2gjoiWY1sOhM_TMwI,3753 +streamlit/static/static/js/FileSystemFileHandle.CU3-lWxj.js,sha256=y0MNR-Zb0G1DayZVEV8-NnzuqyR3PhokHjA7GAn0RD8,4284 +streamlit/static/static/js/FileSystemHandle.CFTLjada.js,sha256=BxrMTdeEqmvSjj0F-lt_ttIWtvH3_DOQg8UFGGe8_Ks,1041 +streamlit/static/static/js/FileUploader.Bg9tjvVJ.js,sha256=vzP-SVhX5rTrctjCCofRUSbyLfsR03qbbUdn-ncsUXU,8724 +streamlit/static/static/js/FocusScope.0TQQ9LKf.js,sha256=2lcJZrX560MlDoNy-mBEV86aqX6cYrzqVLymZMY55fg,15195 +streamlit/static/static/js/FormClearHelper.D0Yt6KG5.js,sha256=mX5jQa8SuFJVMuVYT8kv3sgg11mC001eyu-X-lWgXog,771 +streamlit/static/static/js/FormSubmitContent.BI0VZSTX.js,sha256=Par3onFvHHq3g3w2vZg1MdNgpVqzVNLSJHg1holjut4,1458 +streamlit/static/static/js/FormsContext.Dt-mNfG5.js,sha256=j-c1Ei8oL4SfFEOP1sWMQ8ePbCLKahYkyZK3V7EdLGI,578 +streamlit/static/static/js/GraphVizChart.tdvLWnZL.js,sha256=Y1xjuI2J7jE3coCPC8vvNGy1zgqN5M6BAg4W_DXNe2k,769444 +streamlit/static/static/js/Hidden.Bpblr2PM.js,sha256=ZwHHOzlBO_2Xi4YccQY9OWq3_PzyyuniSH7e_R8RWwI,1176 +streamlit/static/static/js/Html.BpiXuX9J.js,sha256=SnYkCgD76p-lnICAXFTAEFugGVAnctn9q3NIHfJNnIU,1788 +streamlit/static/static/js/IFrame.WjlxKKes.js,sha256=IVdCU-7pqrs5xDV_nErc_bxsuEx3eA52bJXEf2WABTw,3483 +streamlit/static/static/js/IFrameUtil.PlC_b34Z.js,sha256=SC10n7i9UWaoNRN8rQAlc0iTlcciCCiC7oNYbOZG09Y,556 +streamlit/static/static/js/Icon.RiOK8SDN.js,sha256=zHtnxq_yzK9HiZXNtMO3qr4rXwrbV9SUzGV0Xysu25w,2492 +streamlit/static/static/js/ImageList.OTFtPVR9.js,sha256=xBHfQjRzXBohVZ6WMN8EONAi9zd3rpA-FkQFjgK4BMQ,2928 +streamlit/static/static/js/InputInstructions.D7oNXsUt.js,sha256=UlVFwwcTOH1wP0hmhnBn9JlBQkANlzkVtOz0NtoNqaA,1037 +streamlit/static/static/js/Json.CAbht5mc.js,sha256=c2W3SoAQHs7QR-Pp6YBuPcDTZUZqmcDpiz1lTPZxL3s,4691 +streamlit/static/static/js/KeyboardArrowDown.esm.Duf7utJJ.js,sha256=iT5OHzX6pxEaWO3bxl9FOsl2lH7oCOjfRUTKt3L_PVw,19380 +streamlit/static/static/js/LinkButton.DF3DvSdk.js,sha256=wAVPWbJqpU2wYt6FT1nTYdrcQZuGsfQYQY797zQRkiA,4325 +streamlit/static/static/js/MenuButton.447LlVwi.js,sha256=0hxQq9K-K-EvEynHoWf0WeI7YgLGoHvwHJB_NdaEBl4,14304 +streamlit/static/static/js/MermaidChart.C6B8_xWl.js,sha256=VO70J8cQNFl6NKG_a7KgqnSHD2HUzUDtoLv2rKnw9lM,9233 +streamlit/static/static/js/Metric.CmkuJai4.js,sha256=K5Ibx_sx_qSXIZM7lfBAkyatIXGXFmEGnnKG6Sr0-kc,8097 +streamlit/static/static/js/Multiselect.D5pVZElZ.js,sha256=RMDEM1ts8lXJU1DSykGc4kPsuz3RgD_gOydhhhJxdIY,20070 +streamlit/static/static/js/NavigationContext.CaL318Cx.js,sha256=BX7dubSB9boSjgY7kwgAfKyjvY0rhMW7X2nNvlphrks,287 +streamlit/static/static/js/NumberInput.DstpPDIG.js,sha256=wx41PCTCP3d1Le0jDaQ9X-w2R9tefYMUWXZk001FHYc,10768 +streamlit/static/static/js/PageLink.B6pSdxAx.js,sha256=9pT3prTh4U9BqLduFiIhZGAdpsJ8Ra4jYknJqpDjKEg,3057 +streamlit/static/static/js/Pagination.DqlKvCRL.js,sha256=x_0FjDEc-Eq1IHUq5PLbRYRUtb_jJ4TaG009dBKI30I,5531 +streamlit/static/static/js/Particles.CD7975JF.js,sha256=WmUe8ic3p0KbBZCuxoMhUQc3L1naNrSGd5VOlosImao,905 +streamlit/static/static/js/PlotlyChart.CylVV9WQ.js,sha256=EirQuWBaTdHZoxESEOx7so3-ZSdYBc2HS9d0Ku9ZoCA,4666656 +streamlit/static/static/js/PortalContext.BUXYSLQA.js,sha256=AfXSMchdG2uYVADlq72otvNJcAF2TlptD_gd8OzR9YI,195 +streamlit/static/static/js/Progress.Blozw2Qh.js,sha256=w413ZgycknJHKUrIJcQ_esuhc_5ParFKdLhDiavIIic,622 +streamlit/static/static/js/ProgressBar.BvdOcqLD.js,sha256=g3-IstnMbXmXfIwJOGjOI5OFblNwUCDcJucaZDarZmI,1375 +streamlit/static/static/js/ProgressBar.C0SD2GrQ.js,sha256=swThxvObZ3GUu5dEEeycjtKcSEHfLPpeZPYNCqr30Jc,892 +streamlit/static/static/js/Radio.Dsg0wIzc.js,sha256=sICiEWWPvwyf_8YR6GjpkEtTp1J1koav1r-ZDPYkr4w,10795 +streamlit/static/static/js/ResizeObserver.es.CdkJ1I5V.js,sha256=nLMrGd9dE9-fPDlLz32W9mG_QEsJ55GYIxIen2pPumQ,7695 +streamlit/static/static/js/Selectbox.Cwc8yxyo.js,sha256=j2Q7I3mEOkNrTyLyIj8owEh5b5dXKwhSp4R2EljreX0,97406 +streamlit/static/static/js/SelectionIndicator.rChpdeaI.js,sha256=fb6KrExFI2FXgP10HMB_BuFmDvvCnUjjw16C30ulCDI,1687 +streamlit/static/static/js/Slider.C9sm4pxt.js,sha256=0g5e6whv8d1FlfjVWmS_S1ox_KOkkpN9zqfKcR4pmNQ,20038 +streamlit/static/static/js/Snow.19L0RPh7.js,sha256=AjGT8jJyNxklUm86weseo-7vqZk_YWVEbzCS4cHGTxY,1564 +streamlit/static/static/js/Spinner.D2VvIf19.js,sha256=63Fg8iz0rRz0UHjo669YM-FNy1Xn0jbz1mMsH1f4S20,1809 +streamlit/static/static/js/StreamlitMarkdown.DJLoxxnS.js,sha256=lvIjQqF3SbPS3yyijD2uWoMurxyvYGn-2tO1GwA-G5s,222631 +streamlit/static/static/js/StreamlitSyntaxHighlighter.BW47pBZj.js,sha256=3pAgG6F_8NovEK1VkA7ZH3kLaIJYsHtIeZWbOY7e4JA,1566929 +streamlit/static/static/js/Table.BiIqBR1C.js,sha256=4eKcRIapNnQwD7cBnsms8s0bFZbSP9fPK-SrA1eR73k,6286 +streamlit/static/static/js/TableChart.esm.Bm7WHa8s.js,sha256=SMpkdwRtG51g7br8-JtJbIdQ6dutd-UhjU5zRwvcK2Q,688 +streamlit/static/static/js/Text.CGzIOlkG.js,sha256=Rw4nYJm2MNVDW2L_A3YAeThPtCrdWSV1wuNluLqkUk4,163 +streamlit/static/static/js/TextArea.C9d2R91L.js,sha256=zk6dF7dt6vo8nksx9YYybxAUA65FwY7gPmGwrBULgvc,3974 +streamlit/static/static/js/TextField.L8vxRwMe.js,sha256=uZ40xq5x-ijiUU3APudu-hvVR2hRvY70nMdrJCIrFWI,1704 +streamlit/static/static/js/TextInput.BhHFMr_0.js,sha256=LIvNsb52_J3SU1z-nEuKDU4y_nVQIDIz2qqrq9yB8n0,4896 +streamlit/static/static/js/TimeInput.iK1vjZY7.js,sha256=7kL0Hogsy49G6-nkjQDi4jMekL_5m90qHNU-qfjvlQg,20636 +streamlit/static/static/js/Toast.Cdl1bFlD.js,sha256=NR0mtYq314hTReFytVjnED7Q5OLIG6WUU7xKn0nofTQ,988 +streamlit/static/static/js/Toolbar.BynU-Hbw.js,sha256=HG7WIP-ivO6UO3uQ9_cVII_FBKMgBgklgxQNHNurthM,2275 +streamlit/static/static/js/Tooltip.PNC8NIZa.js,sha256=UcbCD4ny0hJkgBaXJ14gG0hXyiXb7txJuTn0VZ1mODA,37780 +streamlit/static/static/js/UploadFileInfo.WAP1L8Dh.js,sha256=kTgipziL0rJ4uc5oZUFKrajUv90AV-tqcYBYyYmK8kE,181 +streamlit/static/static/js/UriUtil.olyUCSHN.js,sha256=-hjBFALrIZNJn4D_izbSJdpkQfxBi8Uj6y3Iw8umEwM,19141 +streamlit/static/static/js/Video.BopQK3O9.js,sha256=3QMYZ92aCYs0PXFOIRpmlPNkjDl67rmKR9e7GZKA_9I,2921 +streamlit/static/static/js/ViewStateContext.C6Nfqh3k.js,sha256=xGlpVZBJ6AWd80Wj6IHLgINu1U-9EdQaa6ZKdMVTqZg,232 +streamlit/static/static/js/VisuallyHidden.8TzBGVb_.js,sha256=pl9kk8uCgAAGOfLpqQzGAkGkoyDB8NnGmDj0tywLSZE,724 +streamlit/static/static/js/WidgetLabel.CVV1ys75.js,sha256=QkSzyx7Tyo6A16B-rkNaKQKfdS1pmUfowJj7808z2ms,497 +streamlit/static/static/js/WidgetLabelHelpIcon.BmvkC-YW.js,sha256=szROfnRCEuT4VDraquz9ay1iQQz1G8RaZLq4wCP-RAs,628 +streamlit/static/static/js/WidgetLabelHelpIconInline.DB6cihzP.js,sha256=KybKAQNW7ecQgEYzqZNnlc3K_81s7ij05NOK7pZPaxg,488 +streamlit/static/static/js/_arrayIncludesWith.DcNFv7pK.js,sha256=Ma3dHQ6PuMfRfZahpxIBCgSOld0o8K-uhRvgWRk9DL8,216 +streamlit/static/static/js/_arrayReduce.CiwPAjrV.js,sha256=gfOaU27J9KL_UteblKgJ6-IyUCywfjGl11iW5NsBgrc,118 +streamlit/static/static/js/_baseAssignValue.D38XrOT1.js,sha256=8wqaMZ2Zmjxh9Ca1iFpKcX2Mzlq4eYZHYnCfBWP_Lcg,11514 +streamlit/static/static/js/_baseClone.Bcnb-YL-.js,sha256=L99fI9UyZ7RNQ4et43f3u1ZIVB3cSEY5UeaP_eR2mQY,4965 +streamlit/static/static/js/_baseEach.PLhpSRgM.js,sha256=P_jcP7BLdwiJTLJyxLfHrkM7gu13EIuLtEVT1Jf79Kk,1823 +streamlit/static/static/js/_baseFlatten.IOj0lc7G.js,sha256=YvO92KBeYo50JFy_pi3fgIYjWYrHBpZ-fQRlGt_OCNM,386 +streamlit/static/static/js/_baseIndexOf.CYLdY-L6.js,sha256=DXVwv-ASiqGWZGc3hMEtWjx1pBV8VPjB0EOFT3AnizI,276 +streamlit/static/static/js/_baseIsEqual.sdZCjgvS.js,sha256=LipiT3XfsFP30bttnSIZCfYatURwTEWnOw4lMKUGejQ,3361 +streamlit/static/static/js/_baseMap.OhVc4KF-.js,sha256=zCWerBTA8ycEq6qqWoYJwS29NdKCnVQdxczYTQmLvWU,198 +streamlit/static/static/js/_baseProperty.BV6HSwpm.js,sha256=bwKfSzcgq-n31oM8XnkiTX9IV2UN40kWI3L8qIE6ies,63 +streamlit/static/static/js/_hasPath.BAJp1Wyr.js,sha256=aEk5nBujvKkRqFcyKHhf25fS-zhTSkMdnLb57UFZJnk,8086 +streamlit/static/static/js/_hasUnicode.Cp9Achgk.js,sha256=guIyMrgx1ZyTATZcGZml1W2UVF-_yKzlfmZWbrIMNF8,141 +streamlit/static/static/js/_isIterateeCall.BUStsXAd.js,sha256=v0VX9rdNBsmLyfibKVJYZx_d_bosHRKPXtulyWicXzU,854 +streamlit/static/static/js/abnfDiagram-VRR7QNED.DMhlflzA.js,sha256=sV9Jg39eWYkis5dRpf-TSh0TNntmMh3ZJme7S03QVGg,1900 +streamlit/static/static/js/arc.Bz4qkNTB.js,sha256=hj1pf7HwvuFtPek5ZtUnoJTYpvIQa_hBktJ2UGh-OqY,3472 +streamlit/static/static/js/architecture-TIHT7OUA.DnieQxxl.js,sha256=nPLeyqnWNbYAFRnwTeEDDMzX72PYoMiInOCNmt7s2yY,126 +streamlit/static/static/js/architectureDiagram-ZJ3FMSHR.DlLEMMhu.js,sha256=reG5l9VeK5MzHgtx-ayAkS4gWRpwV2oKevjzPCdzYUk,148943 +streamlit/static/static/js/array.BifhSqXX.js,sha256=YxJmRtv2EaDPniKTqfY2rDyTyBWo99HpfXgxUauFKbk,107 +streamlit/static/static/js/assertThisInitialized.Cpir0pD1.js,sha256=nsmgozee_-XpSr0Budd_vs4do8GKSpwl5KMHIs53Z5U,257 +streamlit/static/static/js/axios.C1kCDFiR.js,sha256=KMK5qaN-bAE2RAEPyh8wjuJe7NQ0331GOVWA4z65cAM,44724 +streamlit/static/static/js/blockDiagram-677ZJIJ3.C0vRlcsk.js,sha256=EQXhmktBVfcvmhccaxJHdle_5EgKdspuV7P1adqmzGQ,72798 +streamlit/static/static/js/c4Diagram-LMCZKHZV.DG-8rZ3_.js,sha256=E1nalaUxoYvZHi2kK3s13F6pdLYVRKq52HHweTpaV90,69236 +streamlit/static/static/js/channel.CsxEH82A.js,sha256=HIM7r-9ebU1z5l36-nRfa_j24yPRGt1JEGFtd1gCjpw,114 +streamlit/static/static/js/chevron-down.gANryksn.js,sha256=h37mqboUabhRadBrNu9to1yc4ZqBjsCSd0pOkrgN534,135794 +streamlit/static/static/js/chunk-2Q5K7J3B.BsaEqoYJ.js,sha256=b0co0TqbJqEXKaNJ-tp4jHQoiUD7x-VxcPZbViKFoE0,191 +streamlit/static/static/js/chunk-32BRIVSS.CRML9a9R.js,sha256=sQ1WRzZ-5XeBEsfadA4RngoM5hSOoYEqhD0DfMYATOo,1998 +streamlit/static/static/js/chunk-52WLFC77.CL_Wd-B6.js,sha256=npzG140sMh-KWr3rBiAAfL_Yx9JOO14j4RBy0FBxgC8,33985 +streamlit/static/static/js/chunk-5FCAYU7R.C_m-TPOx.js,sha256=oTTRLHwdAqJPkbSwg2dKjBG6pOxIwkuUpoESimJY784,500 +streamlit/static/static/js/chunk-5HE753X5.D2IwY2Hs.js,sha256=mAyVcPvjzAFntk2lB8afPqAIP03uTLnkjyic9gxygpE,837 +streamlit/static/static/js/chunk-5JV3BV7I.DJesgnfK.js,sha256=ytbEV9eF9a-CeDvnnJUPP1WYrW5MAP875pMrf_7pVn0,1675 +streamlit/static/static/js/chunk-5TONJI2A.CazhSWpT.js,sha256=2tse0br6jW2CdO5t1rJ58nh_XoLYQVX40FmRgUS0MKY,1044 +streamlit/static/static/js/chunk-5VM5RSS4.TOl2eSYi.js,sha256=t_wSWyGXmRHBPUX7wqtcxY5UTKJo32b58nWQ8hMlYQU,362 +streamlit/static/static/js/chunk-7BUUIJ7U.CAhmNhj7.js,sha256=EUPDTjS7fjKvet9yRf1zMcPRLHEn6LuWUMEOWfS4Wew,2105 +streamlit/static/static/js/chunk-BIQX33UG.B4NE4TKF.js,sha256=IPWFM28fToSSXc2TGOyA-7FO8qg5EVS1BBQVsMfEWhw,461 +streamlit/static/static/js/chunk-C7G6YPKG.EaPayahY.js,sha256=jZS78ROQe19qE82Xv5WnxtNU2FL17gBP3ssC_ea-xrI,1849 +streamlit/static/static/js/chunk-CQNSW5MT.CwsHPlpw.js,sha256=uzC8F1QffmA5Xf0UtWoHLMo1jJavcQknEkSAlGy7uPc,924 +streamlit/static/static/js/chunk-CYSBUYHQ.Bo3-8CRa.js,sha256=85VdzTiQIjPf71rB68I1dXN0TfGIxSdlcRmHSnay4oc,466 +streamlit/static/static/js/chunk-EMLP6XTP.B17sZ-5U.js,sha256=0eTKGtNvJXtGpetJuXo4ZDu6cuBHAlS-qI2g7wHZ3T8,458 +streamlit/static/static/js/chunk-EX3LRPZG.B6XHH3aH.js,sha256=YxP4K-2_BSQszHBMZY1379h4Vc0HUord3ZUCA5VkHrQ,37819 +streamlit/static/static/js/chunk-FWX5IMBZ.lGkST2x9.js,sha256=-wpyl9Ls0-mREuwcgY_-eatAseuQabbwBxqSWtj_UDo,4493 +streamlit/static/static/js/chunk-HOUHSVGY.zNH8MoI9.js,sha256=ULOkVsssvPAUo-ZrbZq4zGTbqEAkcP5GyrSqWhyYSvQ,5830 +streamlit/static/static/js/chunk-ICXQ74PX.CwBrFo8s.js,sha256=fX5OZFYpjFV8omskuhC2xwjphmuLYJ7bSUMU2CggjL8,30962 +streamlit/static/static/js/chunk-JG7HCLWE.2vZbAraA.js,sha256=Kwu9qlseZVhlvHZ1i4rALSsxWwaEj22T_i3AaInLXZE,1061 +streamlit/static/static/js/chunk-JWPE2WC7.A3RzWITa.js,sha256=gbVZ9Xh_tLOAvB12I4y5yQmdAs5oi9VoGmmtBtGlOPc,223 +streamlit/static/static/js/chunk-KEIR6QF5.Dj-OpFgW.js,sha256=WOIVM9Q771d2QXH5wHmQp7zKABhKp5q1IPk0bmdvoHU,662684 +streamlit/static/static/js/chunk-MOJQB5TN.B4REpjLl.js,sha256=Uzh_cBgaJ3t73a2HFY63bNwqBB8PONdTrnSxbuSwonE,15641 +streamlit/static/static/js/chunk-MOZMSUNE.EeATBuYk.js,sha256=E56cgL7P5Ztr1t7HZdHeMCGoGPowdT7W8Bfs9VG4--0,901 +streamlit/static/static/js/chunk-OGEWGWER.BQmEmpLE.js,sha256=aN6pJPpPsTz9fBzdWP4AsQpzTZuMTi5emfB8d-8rvI4,963 +streamlit/static/static/js/chunk-OSBZ3O6U._N6nOv0n.js,sha256=cLO1QPFF5-qQnGZ4tIm8S5z9docCsG3TfE7dKolIM-w,467 +streamlit/static/static/js/chunk-PUDLZKDR.CXuYzR_2.js,sha256=SCspr1pAwFX2LFl5QWuK-BXg-Ir_-IBUBZNx0lc6E30,60260 +streamlit/static/static/js/chunk-Q4XR5HBZ.DWR7wB4i.js,sha256=-xBM3BZoMOC4EC5LUuZl1uOSg1ybgwcf_SWXBcHuxUU,46903 +streamlit/static/static/js/chunk-QBLGF6JB.DFvVIIOP.js,sha256=c-vUgqM4C9v-LLO5pRErY8bVsWZzn94XrBR0FUno3sY,459 +streamlit/static/static/js/chunk-R7FJI6CG.DpWbzOcb.js,sha256=j0h4KCkPCIAgAhxRYBh-OPrzZvhfdpfUYL_eBkTYItw,1462 +streamlit/static/static/js/chunk-RYQCIY6F.6HsFiqTY.js,sha256=txI-vljsXBgv_spm8dRE_K1Ak95pD_TnY6MsFiG0KFM,7095 +streamlit/static/static/js/chunk-U6XO7XAA.t2Sk_D5L.js,sha256=8KA0cgLZWqQAfhYJg29jiolcHKfu2dkGJlXilyYXlDk,1131 +streamlit/static/static/js/chunk-V7JOEXUC.CFaH8Jy6.js,sha256=slDwxG4KMUN-GsKT7qTC_Lzqp5xg665GDUBY15249lE,48905 +streamlit/static/static/js/chunk-VAUOI2AC.BOaFDBFv.js,sha256=-LHiD5toOzXIqWn-kBSpydcpZBklWkRpi4wIH3rujPc,347 +streamlit/static/static/js/chunk-VR4S4FIN.DMqg5-Rg.js,sha256=XnwJe0luiJVgBVdScqTddrRCA-Esdu7GCiy_hnvJkkw,569 +streamlit/static/static/js/chunk-WYO6CB5R.-gOV9D83.js,sha256=4HFa6u7IT5fPf8FcBrawR-iCtJJk7_OSv52zBiLWfXY,207662 +streamlit/static/static/js/chunk-XXDRQBXY.BLiu-513.js,sha256=K-BXvtD5gOE8x8ALZzWYB74zRDhKUvYWM5Uy1S88e1Y,288 +streamlit/static/static/js/chunk-Y2CYZVJY.DsF7k-Jl.js,sha256=p042afNWrQ1nzFIy8eD2L_RUT9uOcFfPmlABoOpvwsw,155 +streamlit/static/static/js/chunk-YOTPTUD7.CQZR6t9a.js,sha256=8r4pTjd78GgYV_Op3XmmKsnVaw_GoCSa_CKkL4GfOyM,603 +streamlit/static/static/js/chunk-ZGVPDNZ5.GnXVbPyR.js,sha256=iT0UPzuPnthd8wWyH9qu2ayt1OihFA0fQCJXifHyPpg,101917 +streamlit/static/static/js/chunk-ZIRB5QZD.Dh20_f-h.js,sha256=2j7mkfYnpwrZBPSB3isVGiKGRAcJLJjwvp8sJ7ajp-c,41866 +streamlit/static/static/js/classDiagram-OUVF2IWQ.D5f6ybuv.js,sha256=rrha1kDnEjVXttwJK9YJX195O90exfGzi83LHXk42BQ,780 +streamlit/static/static/js/classDiagram-v2-EOCWNBFH.D5f6ybuv.js,sha256=rrha1kDnEjVXttwJK9YJX195O90exfGzi83LHXk42BQ,780 +streamlit/static/static/js/classnames.B69Vzagp.js,sha256=NQq3m85JUaPgrvRdYrqyk275WofL9ErvzbftdEFqChM,755 +streamlit/static/static/js/click-outside-container.Ci0KWfiz.js,sha256=H1J7M7QmWbg1oD1967Tt9rQvQFje2p5dzWH7xfpQBQ0,10336 +streamlit/static/static/js/colors.Cg5Vh3br.js,sha256=te-KsEcZ9tOsUST-h9Jg39ZVJnYEdQR0oUW7mSULC5A,109 +streamlit/static/static/js/config.Mbx-WYSj.js,sha256=inY73Hqp_z6CQAkQOxaDWUWviC4WZOm9wKYcP2zrOFc,227 +streamlit/static/static/js/cose-bilkent-JH36ORCC.B9LMTLkO.js,sha256=128wXz-i3APPU73k-fJ04SO1WF-S19pzny-7vPHOFcc,81477 +streamlit/static/static/js/createDownloadLinkElement.CV8DGZx1.js,sha256=pcfv4WHeshMigBEHmfufNoOBNto43znYuy_vdh9yy6c,379 +streamlit/static/static/js/createSuper.CUU0SpoM.js,sha256=KVckBJluR-b3wZIG0FjPbM_pVoJ8pDn5xAg1oQCu-Qo,388 +streamlit/static/static/js/cynefin-VYW2F7L2.B0m8xIX_.js,sha256=ZwMAOIGRE3lBKh9QeqkEC048vVY6p9RIhkxc22UzYAM,121 +streamlit/static/static/js/cynefinDiagram-TSTJHNR4.CEu5Q_f3.js,sha256=jIxD0x2vUv3QtiNrzkVPekHwj9NQy0s1k4Y5-b9T-nM,9903 +streamlit/static/static/js/cytoscape.esm.CQFVGiJu.js,sha256=iZM1xoX3WdU6LfKgBNkPp4iTf60iE96AQyH9P_grPGg,435277 +streamlit/static/static/js/dagre-VKFMJZFB.Bah_6no-.js,sha256=cCT125VLqhVkux13N6T3xbYjOGApLq9GuTNGv8HWwC8,8811 +streamlit/static/static/js/dagre.BkrREj6y.js,sha256=eNLM6bemNGqiuu3H5J1cRXOg4TlwgeHrhofBLTIU-bQ,28317 +streamlit/static/static/js/data-grid-overlay-editor.Cl0FibMX.js,sha256=-oxTVNZM0NCnzINMA1ZNgB6sSvqDMTI8U0llHLg8E9U,3823 +streamlit/static/static/js/defaultLocale.DAnyU4o_.js,sha256=I18e_FA5r8ygNXsVN_IH83Il_EpfQ2sOUFcouM3pv3M,4514 +streamlit/static/static/js/diagram-FQU43EPY.BE7tAPvI.js,sha256=E73tiPz91GgM9hVcddiHSnv3PljZdY5s4x7UmpmXD9o,10692 +streamlit/static/static/js/diagram-G47NLZAW.BTMhzBea.js,sha256=UNzigZuZNoj2gDTU58f9ZlGNXv1Pof37BupIHl1L5vY,11083 +streamlit/static/static/js/diagram-NH7WQ7WH.BcYK2yBU.js,sha256=B4rp3uQ2AB3DboVD2HqPvlawzX0TNeEFHypGDdjnLwU,4277 +streamlit/static/static/js/diagram-OA4YK3LP.CyOhmsHY.js,sha256=t34ZNK73-Ao4Ma8WCPQ8iRNPaNRTdGIgY_hsflD7YB0,8310 +streamlit/static/static/js/diagram-WEI45ONY.BG3T0S9S.js,sha256=ZoEBqjO_g7RYJYfZQ2jGbcIJP7EQBA8ByVxoxafJUYk,5911 +streamlit/static/static/js/dist.BQ4V7D6H.js,sha256=CvGKHg0WXyR0InlxEj1EWh8JBO62zMcM8yCOgHqm2Gs,2173 +streamlit/static/static/js/dist.Bp4fj7nv.js,sha256=yJksGt-wl1kzqrgpCG_KJe9tmvI7TMGsH1pwQIVOvFA,1469 +streamlit/static/static/js/dist.CETvsizV.js,sha256=ndS2hSN_rkrgJCMOIMe6RHaTavpXFBx9UfbxW84Y-Eg,31574 +streamlit/static/static/js/downloader.BNL8VwzI.js,sha256=Retcp40pYX_KQUy9OljNFARgD219SN8FLTxANqdDZzw,2492 +streamlit/static/static/js/ebnfDiagram-CCIWWBDH.DcPPbnkc.js,sha256=KXan2odRDu9zHo8xuy14FFNLxDJPuR87DjVFELAyqRc,2113 +streamlit/static/static/js/emotion-is-prop-valid.esm.CygBv61C.js,sha256=O2mRrn2s18j3MaV5fko7i9RAcFqQosCWsa4kD9WTNfI,10871 +streamlit/static/static/js/emotion-react.browser.esm.B06RJmME.js,sha256=TYiqLe_2_9hJUaH-Y7eyJw4_m2Qj-Qh0B3tWSCAL7l0,1451 +streamlit/static/static/js/emotion-styled.browser.esm.DsRKNFfx.js,sha256=LmKjKT_TVYn0R_TmZqrmJYUau6lcwSUTMjpDFCTAup4,21699 +streamlit/static/static/js/erDiagram-Q63AITRT.B4gwyYrm.js,sha256=hdqEfF6aV8fVf4g46OY6MzbkfrrkAe4bicgAx03O8n0,27166 +streamlit/static/static/js/es2015.HS3QcJYh.js,sha256=tdEUPTQHiaSvvqdGpkRzdPIpGYt38pEs3QRG47oreG0,18497 +streamlit/static/static/js/es6.CiwTgjbX.js,sha256=0hLpBh3ksLtQpD9fNSninoNG5bibcgStFZ0Ik99mbBM,3598 +streamlit/static/static/js/eventmodeling-45OFAUF4.CekgnRoE.js,sha256=RCs0D2zo_lI0c_BxTJbCf3K5ZzcINRYMRZXUfkhlEVo,127 +streamlit/static/static/js/flowDiagram-23GEKE2U.CXzCA38j.js,sha256=U6ycv0f-lwT3KXwjWBkzC1t_8BfT4uD76gVrUaszyZ8,614 +streamlit/static/static/js/formatMoment.CtdYuS92.js,sha256=IHv92Kc5sG5HeNra8_e1KNPkW08qUGKIp2cMEGO6OX4,582 +streamlit/static/static/js/formatNumber.D1UJmEyL.js,sha256=cjqrjZZYBX_kR5QQcFvdfpOtU0DwE2aroCv2GhAsYyg,1800 +streamlit/static/static/js/fuzzyFilterSelectOptions.Dqs6-TB7.js,sha256=LTLN0FflR3MtHTfXP9daL1-U2OA4n0GgXJL3ywXTrZw,1579 +streamlit/static/static/js/ganttDiagram-NO4QXBWP.yPY5pVNx.js,sha256=JnpueKeDhgfAy6uWRbe8KL_RcAcfwl9CWwZBv1f9FwU,52491 +streamlit/static/static/js/getColors.DtAxY2Hd.js,sha256=-w1hPRUdAfrwxbePkNxZ34kM2BusBukiUS0U6tfgIKU,15857 +streamlit/static/static/js/getItemCount.s1TO7Fph.js,sha256=rV8l34U6mItMJVqxqa3S6PJGWYK3FL6DvzoKIeBDdjs,7028 +streamlit/static/static/js/gitGraph-TEB2WS4Q.B19KcKzK.js,sha256=9zlejl6ConA8k5bnmETLsg3sGZbZtYYI4HZCrEmYOQ8,122 +streamlit/static/static/js/gitGraphDiagram-IHSO6WYX.DSTYnMCn.js,sha256=y7D6wnl-MdztxlL1HXjN_xsQjDNdsIuKwrxRLsqAGX4,29054 +streamlit/static/static/js/graphlib.CL58BBKe.js,sha256=6To-bypm0qxLv1DxMga18LBbQUGPeHghE4FZt0vJvDY,7087 +streamlit/static/static/js/hastscript.BGKGo9FQ.js,sha256=4vDfv1x9-ogMn4bOQ6KTBmTfP855zVJOnoJwz_pmP0g,3070 +streamlit/static/static/js/iconPosition.CHJpUZea.js,sha256=aowJ7qeaAhW6uDysSFbpSzzFoea-OLPmDt1JftODg5s,203 +streamlit/static/static/js/iframeResizer.contentWindow.BupgL6P9.js,sha256=NjfCxyj16JUVr9fYOmBbT311Aw9MJIelcY0dl-nTI9M,13912 +streamlit/static/static/js/index.BvGIeCyC.js,sha256=64KksMA8Oay_jZBRrNW6fO6xOr5DjmPPzBAN0kOGYnQ,450782 +streamlit/static/static/js/index.esm.DCRlH4DP.js,sha256=A2aSuD7MP0VzxcoKh_0SQF-0Xb2CzWnVzgAtfEckjBs,1680 +streamlit/static/static/js/info-DKCQHKI2.DZm8nz8y.js,sha256=VJcgFPQBKBgYKejFT-I8Mz-YjoXbMGSjO-GXRtVbcdM,118 +streamlit/static/static/js/infoDiagram-FWYZ7A6U.DIYKk8dP.js,sha256=68FAmcrYFN3S0xqSpVUoT8R-HBTgRqN-0s9pPR4bvTg,653 +streamlit/static/static/js/init.Cs1-1e_z.js,sha256=ZeTvIs3AcWfPV3aUVHwPatHg2prHLyuJdHyRjZS67NU,368 +streamlit/static/static/js/inputUtils.CD44xxT-.js,sha256=ZvAWOef4sfrWLgrwoA9Gf5FaX2zWIbdGiGFtHR0WF20,121 +streamlit/static/static/js/isArrayLike.Crw2F5li.js,sha256=irjVRcEFvSVp4RmhMCOF5OnCG1D59P8UMJXus5kBlk0,668 +streamlit/static/static/js/isArrayLikeObject.B3Zf3PTL.js,sha256=y2OTALtJFlNXiNz-iHndX-tn7luuUIV3ehed0Tnt0_w,9715 +streamlit/static/static/js/isEmpty.DjruDP6v.js,sha256=T25hVqtA14uOGpdD83qareM8WAj5zeITizWnlUxAzx4,505 +streamlit/static/static/js/isEqual.CgNOpGTC.js,sha256=5qDBMw-enmPMUxF_HMBxc_OxJlHPL-mAJF1vjFrttX0,87 +streamlit/static/static/js/isMobile.ZOwND-6T.js,sha256=AYSZ2oZyKiYKgWLRyCoR2Q2GmYTznfNwuemaruWVEXw,19920 +streamlit/static/static/js/isSymbol.CmW3dkoN.js,sha256=eZ7VSi3wPTUQhgAs4xM-_pvG3CnGe5583BXOBDHpgJo,750 +streamlit/static/static/js/isUndefined.Dk8JX1dj.js,sha256=lme-82htDcIoTD0qpfRf8-lW7Z7t0v7chDU53tcKbIg,294 +streamlit/static/static/js/ishikawaDiagram-FXEZZL3T.s1JZe2Qr.js,sha256=CTRv6bDYa33xesiZ8EFjQx-onqiFhhTfz5Yk4nxFUUA,17345 +streamlit/static/static/js/journeyDiagram-5HDEW3XC.KPMTa86o.js,sha256=RF_KE2vPA-gw1THsl9O4JtvUKCzsBjZzOwSC51gisSM,23232 +streamlit/static/static/js/kanban-definition-HUTT4EX6.Db46tShx.js,sha256=nRCG1bLbZQHmyYMGjYVnA7LXwLrwHIdd1Y0uMOoUIFA,20298 +streamlit/static/static/js/katex.B7rAX3Vi.js,sha256=yUHLbO7vRHhU2_-sMixxdNQkqMWi22niaMJJk3hpHws,258879 +streamlit/static/static/js/katex.min.BDrowdx1.js,sha256=XjnyqMLj-e333vD3KAH75rwJ0fKgLrjhDwSKqsYJtRg,73 +streamlit/static/static/js/last.DfjdtCRp.js,sha256=MmumkIC2_3O2TWGulh4A0E0h_K7h245iMFNNKyMIRtY,284 +streamlit/static/static/js/lib.Bu0LUpLz.js,sha256=SGrmgQjOzc3ghhd_681QYgc8LZOw68Plb_B5EeeoK28,258906 +streamlit/static/static/js/lib.CMmWlZtt.js,sha256=Gos5vM5q6yicOEw00UzAhIOSRU2p1_WuwgOnNuoGlrY,3222 +streamlit/static/static/js/lib.CzPO8p6E.js,sha256=0I2IUb_VVkErjBP5H-JpWNR724ajNKzNoOJYEkkFR60,17534 +streamlit/static/static/js/lib.DaUKNU-6.js,sha256=6BeZrYSqZw7YGZ868l3WUOVlbITTSg9AV1B9pvkRHTY,1601 +streamlit/static/static/js/lib.DuoFSfCJ.js,sha256=RdGCCpUfzknKRn63jYqxomyn8cjeU76om4vfFh0yjlE,1362 +streamlit/static/static/js/line.BtQvjP12.js,sha256=M3g8-KFBXUF3ZBcXSBxvF7ingAo3U4938BUvxOHJnTA,943 +streamlit/static/static/js/linear.CR3348bP.js,sha256=s5h4Q-_dQXf4c_KSxPsX4ptKm-GanJcdnSP5z6cUoeI,4828 +streamlit/static/static/js/loglevel.BJBYxGId.js,sha256=DYrdlGye_hN-Zeb0j5CK50sr9swsYnt-bjVbHOFowfc,3257 +streamlit/static/static/js/map.CsK82nE3.js,sha256=bdxDG3-BGBFn4K5Co-IAci1EN4rJHPv49C5ryU2WhS0,195 +streamlit/static/static/js/memory.BBXA0YvX.js,sha256=x4hfiTas99wny3NKNllVmdb_5ukLzTLEllL24hYEjKA,3025 +streamlit/static/static/js/merge.CkO-ckia.js,sha256=-XU3e5aG5AyUjNGDxCBZxTKpDWI59G3E8zsxlq_ZzOE,1821 +streamlit/static/static/js/mermaid-parser.core.CrKH_ZR4.js,sha256=hSqZjau6b98nu6KgxPVJsMbice9GVLEsR2MNsRnYvQo,6799 +streamlit/static/static/js/mermaid.core.DRnJBexq.js,sha256=LAimWe0RA8z4qD71fL0t7SAroVVr9kQuPV2pt-QwRwc,37953 +streamlit/static/static/js/mindmap-definition-LN4V7U3C.DHJbAA5i.js,sha256=oQ2H6KdyUEQYl9tLvLfcKoI8Lz4PkR4D3dn-u3q9WEQ,22772 +streamlit/static/static/js/moment.CaJaEtMO.js,sha256=C9u-E7F97wAGvUDo-x869q9lVmmcpWt2JTfpazVDs3M,60526 +streamlit/static/static/js/now.BzMxC3T_.js,sha256=SUSNx3F5cZlguIC3B_pc9PV5-KQHZr8iIUdynG4CEMc,91 +streamlit/static/static/js/number-overlay-editor.B2gNG5Q4.js,sha256=y3RwURfXquWfzSb1nxGtwo4aQjfDhdTNv05Aga-fN4k,15857 +streamlit/static/static/js/numbro.-0LqK-W4.js,sha256=_dZKF4cqbC8yM-C0WeEuySGAJeBvMbGs4BxBZviPW9s,38903 +streamlit/static/static/js/objectWithoutPropertiesLoose.DkqnLJVA.js,sha256=55CzZDOkNy0BO8PMIRjEButn53p-IZ8tjOLW8poaYpE,869 +streamlit/static/static/js/ordinal.CVZABass.js,sha256=rMtW2IYlthQlUqLNscLDiRHZHZ9gl8GieHzZKghTgxs,1457 +streamlit/static/static/js/packet-7NZHBO7P.CSLbnEM2.js,sha256=QsDPfBYZa9pwIdJbGTv4hGXVlUMa3oVZuQDqiwFy91s,120 +streamlit/static/static/js/pandasStylerUtils.CpHtlemx.js,sha256=rVCRHcQa9sKED5bI7hsbV-f_wtEiJEFOl7Fw4qytmtI,738896 +streamlit/static/static/js/path.C6YKSwkP.js,sha256=TZQjvB6qqcMnyMLZfBUAtzkFJ23icCnLXzobWywwHHQ,2070 +streamlit/static/static/js/path.DK9UMQdM.js,sha256=MmUKSoLv9l9lwkMAR00i3u7GjS2m8QnzKMFdagdulNA,305 +streamlit/static/static/js/pegDiagram-2B236MQR.BjystR3K.js,sha256=0V-ZVNTuOJh6rc6h25BdO39f7cFAvfL1aEvj2Fa_WTg,2060 +streamlit/static/static/js/pick.CbtWtxHL.js,sha256=J31zb7ttxzmqLtXIHCSKzimmumLHAQD73ysBrYDaSyk,760 +streamlit/static/static/js/pie-RZYD4A2V.Birim748.js,sha256=_Db6rsSotUQQrqzS-0JZw2hBhaKZmx56go0dLi8t0Is,117 +streamlit/static/static/js/pieDiagram-ENE6RG2P.9vMX9DIp.js,sha256=AN5qX1YCXhFKVNbYo7hcLcW9eJEzoW1gzNFjbofV_TQ,6235 +streamlit/static/static/js/possibleConstructorReturn.DlxXudXd.js,sha256=qAQd4ffbfzE6EzOhCGwjmdGoe6dPCOWZggEfRU88TeI,1511 +streamlit/static/static/js/preload-helper.HclGiUj8.js,sha256=u6WEDuwAKLAIVLzVj7qAaU0C1B6YQXZWQkwFsm23Egw,1211 +streamlit/static/static/js/protobuf.DC2L68b9.js,sha256=x1ek5E0j0LFJi60DxXMKrjboaj7ITFwv8Z6kYXRLdXM,762799 +streamlit/static/static/js/purify.es.sLXpNpJ5.js,sha256=QUMZq6TZNuVAME1x01F-4zQ2AbnAWTfRYk8lLx9AsT4,26873 +streamlit/static/static/js/quadrantDiagram-ABIIQ3AL.CpqBZe8i.js,sha256=UJcZCVmSIRxponeBSqupWg2wHRt9Tt7xdUdFxLuuNWc,33578 +streamlit/static/static/js/query-string.aaJx2e0Y.js,sha256=XjQvInPyKR8PJlWB_2oCv_zUVIxdJX1aC3AiME-Ytfc,7983 +streamlit/static/static/js/radar-I7S5WNFK.1uY6lCNm.js,sha256=sIPwiURi9sixJr5lNNvUjKLi0xyU75MCYdAKNZrmOB8,119 +streamlit/static/static/js/railroad-3IZDKUUU.C6Jru1In.js,sha256=CXcvM7MvwWzGlDd1jIo52QpuXZi5Rpbj5VpGJ1-kLZ8,122 +streamlit/static/static/js/railroad-abnf-AHOZXSZD.CzIb4B2a.js,sha256=MsnPmjzK4Z0R7vqXQuDAZ2ZLtV2GfHdZP9TMS8J2sIY,126 +streamlit/static/static/js/railroad-ebnf-EBAXGLYW.BAlUHa5l.js,sha256=bLAmohvzGGFgSyG83AkI9DKBwPCsjM-EnRhfmQNjMUU,126 +streamlit/static/static/js/railroad-peg-LSFZ7HO6.t6fU60nY.js,sha256=Ve1MnBCurlMfTpjz5MJlLYriEgqNhrYtqlYh3hnXEKw,125 +streamlit/static/static/js/railroadDiagram-RFXS5EU6.CROcOPiz.js,sha256=6OWfSchzthQfrGbfZKucJjgJuVJf9Fzs2KlhHyMAxm4,1713 +streamlit/static/static/js/range.DL19EGGd.js,sha256=VmP-VALRVkDk5plM5hNDzYuuripO0bmviAumbxdUlkY,367 +streamlit/static/static/js/range.EplFIxc7.js,sha256=Oc870sScStAkrhvwgX16hsUWjVMlW0Inf5zo1rxs9io,175 +streamlit/static/static/js/react-dom.DZwq-Xzd.js,sha256=RkUOvdr2JKDgNfZi7JJffRbJSNGbvUPEtl1nOUssXsU,132746 +streamlit/static/static/js/reactJsonViewCompat.nQHHQTSK.js,sha256=T6m71S8PwiLDnpN05coIJTyG-_78jAdYPsM0kGVO8as,119725 +streamlit/static/static/js/record.MREo2lrP.js,sha256=6M2xsQX797VAb_a-O7e-eet8ezU7i31Q0Crllp2ysF8,7418 +streamlit/static/static/js/recordbatch.BmKVw6jF.js,sha256=tqqBfykiXd1WzmPTdyVI6-4_HH0SfuFovX1ezyq5jSg,76663 +streamlit/static/static/js/rehype-katex.vcBaU5XZ.js,sha256=dOdez3NOfXgTEWwKJWJNU2XbXTJPN8fdhAaeFRdY1XE,265035 +streamlit/static/static/js/rehype-raw.BD2zFDNP.js,sha256=0WN5ZvgvnQwugivPJ7b-Vlk7gA9N09J-vz6yeDAcacw,188863 +streamlit/static/static/js/remark-emoji.DKwdiqLP.js,sha256=02cRqN5jWZ3h54PNTkRg09V_AnxrhNc2TcCnqNMcfTE,5739 +streamlit/static/static/js/requirementDiagram-TGXJPOKE.BvMUTR9O.js,sha256=cmupBe0_wCHg5iFzlgxlz6siU4k_Xq_aDNEW8mI9v5I,31032 +streamlit/static/static/js/resolveDefaultExport.DJbX7TqQ.js,sha256=bJdnzXXNd3r0A8TkwXVA2H-yJxBdZ5O4rnopPRSoFek,128 +streamlit/static/static/js/rolldown-runtime.DAXXjFlN.js,sha256=FS1WHr_aRSWbG9im6mn9_Zi7LqT3ob8eDrpostCMykE,1269 +streamlit/static/static/js/rough.esm.CSKSodPl.js,sha256=RH-yAzVWMZhBlsGIbVRsF5vusjUjDv775mcICqtY1eI,27103 +streamlit/static/static/js/sandbox.eE-Zfl8S.js,sha256=6w5rMwOC83EeUMXy53CfUj3q0QuqrzDUy6uS4hcX4J4,2923 +streamlit/static/static/js/sankeyDiagram-HTMAVEWB.DoB9rjtV.js,sha256=rzE2qJKm_OURVINEOPcYAaB5qu_fYQQa4Mc01Su70cM,22790 +streamlit/static/static/js/sequenceDiagram-DBY2YBRQ.BvD5UN5M.js,sha256=hTxUiTCKApF9guEWRirYjWpIXopDSdITdMh9Koxl4Qk,115893 +streamlit/static/static/js/serialization.yxLiAHgz.js,sha256=rV4shyHgKEdWBaqIsRMlH67An2pfF209ggVMBeMi5hE,92657 +streamlit/static/static/js/shim.Bu3ywy0h.js,sha256=uDVdzi3XKBhLteIJhGEqR39wZVLoIPT75R1dLZXmdXI,884 +streamlit/static/static/js/sizeCapture-X5ZJPWSS.BLIUHMgQ.js,sha256=i4imzz0vjGGTyc_kbcGB8X2Vu8fJX9E7pEk__W5evDA,875 +streamlit/static/static/js/slicedToArray.624-tfZX.js,sha256=x1N4XU5kcIbj4HaorlWsF9cFyW0crDkwKUxSFBjabDE,723 +streamlit/static/static/js/sortBy.BN5z75-Y.js,sha256=fO0DG-PlQIt7TMQCcdTFeFYGkmFLHld1xXjp8iQkDB4,1257 +streamlit/static/static/js/space-separated-tokens.BCngOmQZ.js,sha256=q-CpDNIluavUZm-44AiEg2rKWQzXyRYqxYpMWOogjSU,19061 +streamlit/static/static/js/sprintfjs.gMlXBjFJ.js,sha256=3375b89Xu4H_tazXdAM8t7zR1TuaOLCgix3eFSYSII0,4012 +streamlit/static/static/js/src.BygSYTzs.js,sha256=513fs10J48Vat65TMhSRUdUwyOr6tXTZWfan9-qNuMk,8750 +streamlit/static/static/js/src.CE7XIH0z.js,sha256=ikuliTM_n2hhdGnf766uh6pS4c83Ywy6EAY20oG1rJk,33396 +streamlit/static/static/js/src.ChOBTULJ.js,sha256=aa5aQw680_kEuBegQcQ7c7KhDWOjobimhfvnbW6SsOQ,70 +streamlit/static/static/js/stateDiagram-2N3HPSRC.Dvl6akVh.js,sha256=mMZD5M8D2QB_ZlBlEEnOkC4RPB2Mc0XW6Zd5k3kvWcI,10663 +streamlit/static/static/js/stateDiagram-v2-6OUMAXLB.Biz9ppdk.js,sha256=1BBuz8QSASmwahCqmRL_iXBgLtRKtrWma7urnW_KRm8,783 +streamlit/static/static/js/string.2gFcx07-.js,sha256=Nh39Mn0QqE8txJbnQobUiUlbQb2CmJVaW5oQEodyAb8,9176 +streamlit/static/static/js/styled-components.B5oT30oI.js,sha256=zjsyUM7Z-1cFA3WRsbTDNLYpV8d2kt8uzudkeMC3WBg,18324 +streamlit/static/static/js/styled-components.BwagcMZe.js,sha256=gNEI2MXK0HyETY_QrcX6Ojc8yHbnDp3oEBa9kSfV4IM,10356 +streamlit/static/static/js/styled-components.BxoGPtnX.js,sha256=cKy_ysiBupAdJC3Is5l62wYfqm9x0kWO4PQR20ibgdo,1032 +streamlit/static/static/js/styled-components.CuxloOeN.js,sha256=_9caFGZOSHjbYpJSfZd0kIIeqHsGGafvn3jxVeIfMUw,772447 +streamlit/static/static/js/styled-components.D0lsbQYu.js,sha256=MZJZ7pA5WGcjV_q3lUVTIOj1KKj88jR5OueqgpEXT7U,574 +streamlit/static/static/js/styled-components.Dvviq2B_.js,sha256=__RARXBDGnT4vn8UgN-Cbw3UhJGQZX67R137tIQX3xo,828 +streamlit/static/static/js/styled-components.jxsKpeRi.js,sha256=icVYlseOxKb1mzSRxLHdkklzXtdKTNFrITGiBKm6R5c,958 +streamlit/static/static/js/swimlanes-5IMT3BWC.C_AyqNhM.js,sha256=EcIFfVUIJ1qhlYtH7bCiVQheTDjCuQs2zM9uMy4iQPI,114129 +streamlit/static/static/js/swimlanesDiagram-G3AALYLV.Cy3LPWnv.js,sha256=SfnWyBG4_aLYEBLiX8Lpb5gw_VxgFnIdKfABQUrAqhs,873 +streamlit/static/static/js/textSelection.CRrpnEtY.js,sha256=WmGdNooQi8BYuw0h-BYphUlfLbWnf2Ik8uGZOZsxngY,960 +streamlit/static/static/js/threshold.BuzS4kmB.js,sha256=_29PGuEomPdaerXczj1kNry06Ja8l8VrVxwh4fc4nzs,611 +streamlit/static/static/js/time.C6xaHmap.js,sha256=cYwcjrOX9pv1XZpeq8Q-z2WtDIz6k9D9P_atl5LqtCg,17318 +streamlit/static/static/js/timeline-definition-FHXFAJF6.DvUSwW99.js,sha256=te4E5ak2eJEQ1Ny5DWsXbOLGbh8a4MBopgen5tNPzcg,30457 +streamlit/static/static/js/timepicker.Waqmgzcy.js,sha256=Im6D1aRd30VZZs0WFVfk8IeuwcdD1KFBdov9cOhvn_k,84121 +streamlit/static/static/js/timer.BMV81txb.js,sha256=EZd4deVa3fj8NsOowPcA2Y9ZXApcRTYr8L2-evM3e2k,5222 +streamlit/static/static/js/toConsumableArray.BxvvZSIl.js,sha256=mIZdmqJ7vcAFlNaI_mB54j1OvxGYGiFq4xaq6Gec30s,1086 +streamlit/static/static/js/toString.tRXNBxtF.js,sha256=FHdO0l7M42UG6Wmnv6Bydl6KQanUaoJbiCFBvBq6Bi8,419 +streamlit/static/static/js/toastQueue.CEO36h9N.js,sha256=66hFOgqr0vE7Mm4fYDs9ZiTBtxZ35EawOzN8MHLN_Oc,1877 +streamlit/static/static/js/treeView-QDETBFTQ.C_NgES55.js,sha256=znKpYeoFlmsX-i_LtRCP0Hu1Tdc4pYsYKX-qWGcHNPQ,122 +streamlit/static/static/js/treemap-6X3UGDF4.D-6z5Emd.js,sha256=oVbICtRWFyS3LcNAeQszX4_Ay87i6kGXTqPqmtv9C28,121 +streamlit/static/static/js/treemap.BfjIY-m6.js,sha256=HUOedTdjg2RZneUm75trElWU2l3kOTApPrgE18ZUmSg,4847 +streamlit/static/static/js/tslib.es6.DWZnz9P1.js,sha256=Ncbka0V7HyURTd2ZWwVDA5xpkhVgx5tJXf2KSVA2k2c,2368 +streamlit/static/static/js/types.cZoyy9Y-.js,sha256=-vncRd8uvk6J1LhM-9ZtSqeLNOkVvJ1OqvQ-E-VQNmY,75 +streamlit/static/static/js/unzip.BaBcYNJz.js,sha256=KBp3PIrvzVEl8hMiHlZqlo2xqH05gKiHqcBO0SevlAE,332 +streamlit/static/static/js/uri.UNMuXGg5.js,sha256=Djd6GIO9jWS6bTnR1HFgBOOgqV_t7vfV6eQpBDuukyA,104 +streamlit/static/static/js/urls.B0fCYwet.js,sha256=f_47qvRgggsAD7THfd4hx4zTchIn8uZF8QRDKrbX3TI,272 +streamlit/static/static/js/useBasicWidgetState.CpWukz_T.js,sha256=qkLwXQfP5-3SENHFdIQ4o02TuyaaFV5FJCyTTmgWpPc,1708 +streamlit/static/static/js/useCalculatedDimensions.BnLCBgVi.js,sha256=JhmuFyoj6YQPhw1eHMezHW_ubVS_XKeOVQwgc_oyDN0,339 +streamlit/static/static/js/useCollection.CEK9PDaH.js,sha256=xl2esNiMoWwm16jowSKT53-BYGFPCWZGF867PQZo6wo,42877 +streamlit/static/static/js/useCopyToClipboard.31Hpj0n3.js,sha256=8DgBmS40DljA0UDuvTqYMUFNPaRhvw-Q2gyWU_ar_WY,619 +streamlit/static/static/js/useCrossOriginAttribute.DBi7mGp8.js,sha256=xVHptsx4EtY9KCroe0Fu4Q_QejGIqU073E8CgbMfxek,267 +streamlit/static/static/js/useEmotionTheme.D29Ufy6b.js,sha256=Xrk-dFY1rliz2403hg6Ppxk6Gnfds4ClF8g7gdpy4SQ,85 +streamlit/static/static/js/useExecuteWhenChanged.CJi0fna4.js,sha256=7NBLBZVxY1zTCijGw9MNEhaLjg3Sag3KDD3fAixjLrg,273 +streamlit/static/static/js/useField.CLWVwWoT.js,sha256=8DW-YTCTJBfKdN123dF4OrjMrbXChByGHR04dnuzNqQ,591 +streamlit/static/static/js/useFloatingOverlay.DlcdWSVH.js,sha256=XNkU7VDZXNlyq3SUDZyE6Hk-HJo0EosX95FJ8vCBh34,41892 +streamlit/static/static/js/useFocusRing.C8atAWyK.js,sha256=1l1c3fIPuH7G_VzhykKIrGtQ7z_v4HEt-lLXM7vt60s,7930 +streamlit/static/static/js/useFormReset.Chklfqrk.js,sha256=SPj3ATxmF-5sdpnalmrO47QSItswAiLNpI2hag_Hvxw,372 +streamlit/static/static/js/useFormValidation.CZGpvO3z.js,sha256=yQy_b1NygSFHqm7qoWRywPOKwwGjN6cM2pu9jTPqHuk,4105 +streamlit/static/static/js/useIntlLocale.CiG3jZ1C.js,sha256=1kAd0TTuhY72xZMCjALsBR_owa0wOXRIiL1gAef7Juo,134967 +streamlit/static/static/js/useLabel.BMjZg4WL.js,sha256=NMPxonjpy7dLYpmvTpygwvFUMizpkvE2bLSil2f2I9I,724 +streamlit/static/static/js/useNumberFormatter.t6impjkR.js,sha256=dOlCNhCh83vftvaiLT9a0xuuokU2xXiM6pxwA4ZMEZE,2922 +streamlit/static/static/js/useOverlayDismissal.DB4_ko2H.js,sha256=gQx9uvR-ooK52HAYdIpEWOSqYPeov7vy-Y3VJL796UI,1000 +streamlit/static/static/js/usePress.C0FRp5XM.js,sha256=565O9b4WGI0O6Bt67VSDlNQhpRt1n0TwGIAi4Ecx2CI,7996 +streamlit/static/static/js/useRequiredContext.F4hG38Ff.js,sha256=PZTKNXF2jqbgTqSJLM6aYo-71Nt8ZmpVfRT655am2pM,267 +streamlit/static/static/js/useResizeObserver.C0ES3go_.js,sha256=vN3OlOxQtpUm-mfmATz0QzumV4SStvuiIvZ5SPSNlzI,1306 +streamlit/static/static/js/useScrollbarGutterSize.B_VG1Wad.js,sha256=9p2Qvf-6sRBzwld01QzcP0UPWhYEZrMIJbhlrKkFM58,605 +streamlit/static/static/js/useSlot.CBG0sVdI.js,sha256=JL0Kb_3I_QekKrA1fB32FCpK_JJbIOkTqwxW5wYPnvc,412 +streamlit/static/static/js/useTextField.BYQ8oAlv.js,sha256=fCt-A36n93au6TU-gzboa7zOOUcVUIQTuKPt_fhtOO4,3534 +streamlit/static/static/js/useTextInputAutoExpand.By9qSO8B.js,sha256=DaJC0B0uGlINB1XYcXiEAHvKV4I65L-nVtDIxl2kuGE,1126 +streamlit/static/static/js/useTimeout.CUauXJkz.js,sha256=An9dJlQv7lio4x655u9zHqPwmogw65hsOLsqSJdeNlU,649 +streamlit/static/static/js/useToggleState.DJlTB6nZ.js,sha256=VrQ6vPKdDQqwliXsFNT823T4pVvjHURNGnkbjVJ5pCo,422 +streamlit/static/static/js/useUpdateUiValue.9IVpZphL.js,sha256=jaD-UDpYHopbcUtq1T6UlzFNrzmW6AKJsl7i0EGMNVU,738 +streamlit/static/static/js/useWaveformController.By203ydw.js,sha256=0NuOVGnOh7xoA-HLY-fdhvt0nTUOpjCj3bEDEqS3Lsk,12328 +streamlit/static/static/js/useWidgetManagerElementState.CbF0sesb.js,sha256=7UYayHpVLeQSSdh-p3-J71GajlLe6v9exbLiCSWG0-A,621 +streamlit/static/static/js/useWindowDimensionsContext.HIxtcWyF.js,sha256=OJQrj0BVrTsMGi6Y1MMxr56q7yzmcglnMCLpztpX4FQ,280 +streamlit/static/static/js/util.D5poj9OK.js,sha256=V-WjVBrskddm5Tq2UPgA8huLx1-XLLsy6EYNnsuq_0M,2968 +streamlit/static/static/js/utils.94RcZhG4.js,sha256=pc6OtbIrMsqzspGaWixEoANnY5q8RLiMhz2JTgRE0hE,160593 +streamlit/static/static/js/utils.BrY_0PXX.js,sha256=dJImsTcRN98F9qS2mWw0RDAL7Hz9fG2WfCh2WLAqih0,752 +streamlit/static/static/js/utils.Ca1sxtey.js,sha256=YXmreFZjEFaoi3g1SVn7q6IKQcOGBQNx54h0kOiI1vg,65738 +streamlit/static/static/js/v4.DDdyfk2q.js,sha256=zsm8WrSD1w6ok-CiWjw-uijy9U1xDIo1DFT01Edqr_g,770 +streamlit/static/static/js/value.D6n4OHqi.js,sha256=PqrIgQPCbjHJhx0NvL0bPVOYtTPZvCZJ81Lbajx4PwI,1106 +streamlit/static/static/js/vennDiagram-L72KCM5P.NbBJYoKI.js,sha256=1lGY7t9Hw4op90yP5L-beLrl8vi5k-fuMYvzwOOFIFE,41217 +streamlit/static/static/js/wardley-OPB4EBWU.CGf0CVut.js,sha256=iTgU_MFVKFfO7v5NDA7jtOtbC-d7g9KWHJ1JXcf3oPE,121 +streamlit/static/static/js/wardleyDiagram-EHGQE667.CE-CIJTy.js,sha256=3F7xZic4ojWNbc2-Zy2IHZv3gZ3M3JncpGTRuLmt0dc,25219 +streamlit/static/static/js/wavesurfer.esm.hdwAnkyS.js,sha256=n7Kw7iFhKwGxuBF5EMA-mGOYxOfe-2SC5aUEte-p-_Y,41290 +streamlit/static/static/js/web-namespaces.BxZ_GhEx.js,sha256=VSL70VC0gzY-KAE1X3WwPuA1dv3HG3tGKF58kCfkymo,254 +streamlit/static/static/js/webgl-device.7mKl-kgB.js,sha256=ZDEGD2v8VsPgtaVNUcJuKx0S9P1WbJAmYxS0mwXxzu8,190910 +streamlit/static/static/js/withCalculatedWidth.DClbrdOz.js,sha256=25fiIaluOzABMoOcRvHWdCsYg2nOb85IReum9oBXgMQ,434 +streamlit/static/static/js/withFullScreenWrapper.DjqP6oFO.js,sha256=lmDPbviWpZxTcGeDyHADAgR6vh-0P8M_XLyobTO0WdM,1919 +streamlit/static/static/js/xychartDiagram-FW5EYKEG.BlFxuj8T.js,sha256=R5B2-CsMdWCTxgcaejcdDFsIbGUOxW4iWxNI-54Rupg,41524 +streamlit/static/static/js/zip.DLtjLZjW.js,sha256=HJnSko7OW5UJJqHEaNOy9YUukdheLvM798obsLdGejs,113 +streamlit/static/static/media/KaTeX_AMS-Regular.BQhdFMY1.woff2,sha256=DN04fJWQoan5eUVgAi27WWVKfYbxh6oMgUla1C06cwg,28076 +streamlit/static/static/media/KaTeX_AMS-Regular.DMm9YOAa.woff,sha256=MNqR6EyJP4deJSaJ-uvcWQsocRReitx_mp1NvYzgslE,33516 +streamlit/static/static/media/KaTeX_AMS-Regular.DRggAlZN.ttf,sha256=aFNIQLz90r_7bw6N60hoTdAefwTqKBMmdXevuQbeHRM,63632 +streamlit/static/static/media/KaTeX_Caligraphic-Bold.ATXxdsX0.ttf,sha256=B9jjA85PwStLtU8QBBcN0ZCh89tF1AD-aAYN8-CJcmg,12368 +streamlit/static/static/media/KaTeX_Caligraphic-Bold.BEiXGLvX.woff,sha256=Gua9dHVZDpfn8UWongnM3jIvemvAuRYHsci47igpD-0,7716 +streamlit/static/static/media/KaTeX_Caligraphic-Bold.Dq_IR9rO.woff2,sha256=3ncB5Czx9M8LdmwD-yeXcgfu4vT9XXb6ghiEBtpD6kw,6912 +streamlit/static/static/media/KaTeX_Caligraphic-Regular.CTRA-rTL.woff,sha256=M5jdAjAlV6eT8oY_iOAtls4Q3yq_-gfI6fqQd1EW5lw,7656 +streamlit/static/static/media/KaTeX_Caligraphic-Regular.Di6jR-x-.woff2,sha256=XVPnCtYHwjUhYt7J4JI_tU7Nr6zL9gTNjc99APrLmJs,6908 +streamlit/static/static/media/KaTeX_Caligraphic-Regular.wX97UBjC.ttf,sha256=7Qt0Ny_u_LucBmay4hDaN7fkn6f7vz7rEdtfaT2s-7c,12344 +streamlit/static/static/media/KaTeX_Fraktur-Bold.BdnERNNW.ttf,sha256=kWPfnHEiQy5klbQin6kHHPmuhqdYrl78SSTsLhptvOE,19584 +streamlit/static/static/media/KaTeX_Fraktur-Bold.BsDP51OF.woff,sha256=m-fOuIAEq4rRJAgiRvv8ykCR42OF1Oxu0d9nN12tUPs,13296 +streamlit/static/static/media/KaTeX_Fraktur-Bold.CL6g_b3V.woff2,sha256=dERO_Vk8AF4_RXO0RSRwTArwqTf-kRzKnpQGjQ0UDT8,11348 +streamlit/static/static/media/KaTeX_Fraktur-Regular.CB_wures.ttf,sha256=Hm-VeekOLKw3-PYKWXxDbgdcEUOFZSt8vrDewEISkbM,19572 +streamlit/static/static/media/KaTeX_Fraktur-Regular.CTYiF6lA.woff2,sha256=UYFNJw0G_wJV26B5mZT6TYyE0R8JlR1HWV9Kux82Atw,11316 +streamlit/static/static/media/KaTeX_Fraktur-Regular.Dxdc4cR9.woff,sha256=Xih1O-cX2sl_VZ9JvBC-nPPBJN3KvaZlnRHLaP68ZGM,13208 +streamlit/static/static/media/KaTeX_Main-Bold.Cx986IdX.woff2,sha256=D2DRuJeTjskYyM4HMJJBG6-UOPZzlGVpP_GLD50gsCE,25324 +streamlit/static/static/media/KaTeX_Main-Bold.Jm3AIy58.woff,sha256=x2xdaWKX1RucsWOcfaQzTw597IG0KxEhO14l72cbuCI,29912 +streamlit/static/static/media/KaTeX_Main-Bold.waoOVXN0.ttf,sha256=E4rCjRZjswN-nF9SNx-lxj2DJPSjjSLNVz5uo6P9DPg,51336 +streamlit/static/static/media/KaTeX_Main-BoldItalic.DxDJ3AOS.woff2,sha256=mc1Co8By2Rjy9EmEqAfPeqFuE1Rf0IdfwHxsZfmecVs,16780 +streamlit/static/static/media/KaTeX_Main-BoldItalic.DzxPMmG6.ttf,sha256=cO4fZKIPIEjCGUDvRtAUT9IVuqlTymmv0eMemFRPcI8,32968 +streamlit/static/static/media/KaTeX_Main-BoldItalic.SpSLRI95.woff,sha256=pvfsDYRqx62XWtuJWcN-1JuUrLxK5DbbnOniAofkpkw,19412 +streamlit/static/static/media/KaTeX_Main-Italic.3WenGoN9.ttf,sha256=DYWufMMPI3kKfxpYxKES_cqKrnaba6EUKa8dmLG2yzo,33580 +streamlit/static/static/media/KaTeX_Main-Italic.BMLOBm91.woff,sha256=8dbvhvOxGlKL1RhRmb0kQ-yysN6tltiGdLWiwSviS98,19676 +streamlit/static/static/media/KaTeX_Main-Italic.NWA7e6Wa.woff2,sha256=l0ecpszpBqvJYeyslvql-couYbjnZw1HWCa83umnwmc,16988 +streamlit/static/static/media/KaTeX_Main-Regular.B22Nviop.woff2,sha256=wjQs2Lhp4BdSqTIdwXIT_EDU0Ex5aIwdQ_LPMWq9eGY,26272 +streamlit/static/static/media/KaTeX_Main-Regular.Dr94JaBh.woff,sha256=xjaNh-iho6XTN2I9g9jcS4aPJCqa1HYjfW-NHg8WjNw,30772 +streamlit/static/static/media/KaTeX_Main-Regular.ypZvNtVU.ttf,sha256=0DMvUoaDcP2Drn-kZHD5DI8uqy_PErxPiAgLNAyVqDA,53580 +streamlit/static/static/media/KaTeX_Math-BoldItalic.B3XSjfu4.ttf,sha256=-Td6sCcc2lmvJLz_vUak0MijVy_6_bs43irV6nsNXuU,31196 +streamlit/static/static/media/KaTeX_Math-BoldItalic.CZnvNsCZ.woff2,sha256=3Ec0TbtstbZVyEYNVh9N9fUBuQyAStPGzsZf4yI1GrE,16400 +streamlit/static/static/media/KaTeX_Math-BoldItalic.iY-2wyZ7.woff,sha256=hQwK9cIjhJf-uvXkYdiAv0WMNB9C9PMw8bGrVpixmY4,18668 +streamlit/static/static/media/KaTeX_Math-Italic.DA0__PXp.woff,sha256=io0kRYE3GRK48_WiPiQ3yypZzZvK67A0bnIsBXN6JXE,18748 +streamlit/static/static/media/KaTeX_Math-Italic.flOr_0UB.ttf,sha256=CM6Y5RsE1YlFowHmOeAraZivKf39Yae4r90Hu_xHnUo,31308 +streamlit/static/static/media/KaTeX_Math-Italic.t53AETM-.woff2,sha256=evWMXsjxMqLd3pAnxteBTezOTTuCKhEZKkKiDi6XMmQ,16440 +streamlit/static/static/media/KaTeX_SansSerif-Bold.CFMepnvq.ttf,sha256=Hs4D95-VJ31X3H9rQ1p04TebDUYQSoUwKGtg_0k2nqA,24504 +streamlit/static/static/media/KaTeX_SansSerif-Bold.D1sUS0GD.woff2,sha256=6ZrlEUS_EjLvzBv-Wt02JixoZrD6qyT6dXQOG5hXemI,12216 +streamlit/static/static/media/KaTeX_SansSerif-Bold.DbIhKOiC.woff,sha256=7OA8_YPiLCEs3vZv64RC0loIO-uYjbPxiD8_lzjXULo,14408 +streamlit/static/static/media/KaTeX_SansSerif-Italic.C3H0VqGB.woff2,sha256=ALJqyCXiCVBWOW4FU7isJtP4rRWMOCbii0xFs4XEcUo,12028 +streamlit/static/static/media/KaTeX_SansSerif-Italic.DN2j7dab.woff,sha256=ke5nUAzAEpqgrOOsXGH_FpIQLw8x0CtpNH-6Ndy3W_I,14112 +streamlit/static/static/media/KaTeX_SansSerif-Italic.YYjJ1zSn.ttf,sha256=OTHdgfrthroCG7K73Db1vtmjjWtPQHespZsmWqGwIIM,22364 +streamlit/static/static/media/KaTeX_SansSerif-Regular.BNo7hRIc.ttf,sha256=826ol-GfSi5XHR6QDk43EOQ43rBahCSGBFugo-YWpK0,19436 +streamlit/static/static/media/KaTeX_SansSerif-Regular.CS6fqUqJ.woff,sha256=EeTcimRx_21u5WHVPRD96PdInnmCV_9EnF03wZdDVgU,12316 +streamlit/static/static/media/KaTeX_SansSerif-Regular.DDBCnlJ7.woff2,sha256=aOjHPvQq_TzOxYvw-6MCzORIk45_wCCl4x-KlS7uE0I,10344 +streamlit/static/static/media/KaTeX_Script-Regular.C5JkGWo-.ttf,sha256=HGfwaP6ouwm_CZwIixz2S9J1Fqbgf0aENEhzVku2amc,16648 +streamlit/static/static/media/KaTeX_Script-Regular.D3wIWfF6.woff2,sha256=A21OlRSbaf-bzAzVV3Hv6yX_o5Ryk-aazXjVrDKMaEs,9644 +streamlit/static/static/media/KaTeX_Script-Regular.D5yQViql.woff,sha256=2WzfKzvdTWSo_V90pMRn8SOopzkxzUNYifCP-vm_lHo,10588 +streamlit/static/static/media/KaTeX_Size1-Regular.C195tn64.woff,sha256=yUPMmGOE9Z6GvqX9fcUKnE3-Vnp8BetA1nkHIN6tl8k,6496 +streamlit/static/static/media/KaTeX_Size1-Regular.Dbsnue_I.ttf,sha256=lbbS8aUBc7_tuMY-HRyZsQQn0KTfQgHLRFE7ImlRois,12228 +streamlit/static/static/media/KaTeX_Size1-Regular.mCD8mA8B.woff2,sha256=a0fEAWa22-IaXfyncYQT8hR_0jmb4bpgXYrTnO3yXf4,5468 +streamlit/static/static/media/KaTeX_Size2-Regular.B7gKUWhC.ttf,sha256=prIJn7VVxg46DbOgiELr8dcyxutOS_RJE2E77U_E45s,11508 +streamlit/static/static/media/KaTeX_Size2-Regular.Dy4dx90m.woff2,sha256=0ExUIZ-ersbU1P1C37KHhZdaR5TWsvxx5Wa5zW24Qt0,5208 +streamlit/static/static/media/KaTeX_Size2-Regular.oD1tc_U0.woff,sha256=IBTFI8MhC8wWZkjE1MxX8Ft0ffB6JCd79xxR5n3Hnj0,6188 +streamlit/static/static/media/KaTeX_Size3-Regular.CTq5MqoE.woff,sha256=ara2Lpti2uLADdkPeRvRCVC-Dsw0kNfWBF9Rwuj-CUk,4420 +streamlit/static/static/media/KaTeX_Size3-Regular.DgpXs0kz.ttf,sha256=UA4E1U8NUWZjMsnSCJqoA74iqoeOylOeWfpTxuUisII,7588 +streamlit/static/static/media/KaTeX_Size4-Regular.BF-4gkZK.woff,sha256=mfnGdQtInJRivwSQC9P5Od-bgpM52qqqme9Ulc3d6lg,5980 +streamlit/static/static/media/KaTeX_Size4-Regular.DWFBv043.ttf,sha256=xkc2fR3U4WJGhxfQIOH8Dx3Fwm6_3_vlUmFxO_iMWHc,10364 +streamlit/static/static/media/KaTeX_Size4-Regular.Dl5lxZxV.woff2,sha256=pK99QURAocF5CCXPtwDPnPQ7DyxLBPDrxSMBGtmFPsA,4928 +streamlit/static/static/media/KaTeX_Typewriter-Regular.C0xS9mPB.woff,sha256=4U_tArGrp86fWv1YRLXQMhsiNR_rxyDg3ouHI1J2Cfc,16028 +streamlit/static/static/media/KaTeX_Typewriter-Regular.CO6r4hn1.woff2,sha256=cdUX1ngneHz6vfGGkUzDNY7aU543kxlB8rL9SiH2jAs,13568 +streamlit/static/static/media/KaTeX_Typewriter-Regular.D3Ib7_Hf.ttf,sha256=8B8-h9nGphwMCBzrV3q9hk6wCmEvesFiDdaRX60u9ao,27556 +streamlit/static/static/media/MaterialSymbols-Rounded.1hm6dVzH.woff2,sha256=JHzVhR-HqV2uRKdziUT2I-fTwHxbR0yXF7EbMHsue9M,370048 +streamlit/static/static/media/SourceCodeVF-Italic.ttf.Ba1oaZG1.woff2,sha256=cg5HouVFaNspCL-7MolMHCmP2UjMiUJCaYfC0p9-vZ4,75316 +streamlit/static/static/media/SourceCodeVF-Upright.ttf.BjWn63N-.woff2,sha256=2V3HUbTYIUEln1wAyYOK3ardO06sMN19tKDaSSHXd5I,90124 +streamlit/static/static/media/SourceSansVF-Italic.ttf.Bt9VkdQ3.woff2,sha256=tJWavAVpOS-HxsasYS-Q4_4BBNKDckGJt9i29hrzR9M,137996 +streamlit/static/static/media/SourceSansVF-Upright.ttf.BsWL4Kly.woff2,sha256=XxZWb3pA05szmtJr4VH6Whqx8MJXTHouYZdlWEoay9g,170188 +streamlit/static/static/media/SourceSerifVariable-Italic.ttf.CVdzAtxO.woff2,sha256=nSi1dJoa0JailctgfFIb0a9M2ZebbzczLa9wFDFJ-0Q,346688 +streamlit/static/static/media/SourceSerifVariable-Roman.ttf.mdpVL9bi.woff2,sha256=lAp27aE4jeOdOMjnp5v26gWKOH-u4KnzPI0lxroF4b4,429100 +streamlit/static/static/media/balloon-0.Czj7AKwE.png,sha256=pG7915IWlUx_nnDXWmLKYu5npTKpsETqA0MqWjcrOWs,7924 +streamlit/static/static/media/balloon-1.CNvFFrND.png,sha256=SWk_JCTsxCrzP3RiwWifPDlr2Ut0V4wfGrWY9cW-Rro,7803 +streamlit/static/static/media/balloon-2.DTvC6B1t.png,sha256=gszmL2oWDP-ERuu5ZRBrpzdUCO7cMgrzd6LBjW48LkY,8112 +streamlit/static/static/media/balloon-3.CgSk4tbL.png,sha256=vfTmKGmbZChxTlHEcMvniKPlwa-XNb0GDlrma6XvslY,8098 +streamlit/static/static/media/balloon-4.mbtFrzxf.png,sha256=0dLg7u1WUWf4Z_JdfKQsimMk281VAzMwGOKQUjSdLnM,7916 +streamlit/static/static/media/balloon-5.CSwkUfRA.png,sha256=qkWQlmuJ9QO4l1n6kWCK5x7fpWRgx-zzL20MY83jZWg,8032 +streamlit/static/static/media/fireworks.B4d-_KUe.gif,sha256=ZO1V8cjxXfPGZMRaIIWm4t80vveYLZ3zmaWQORpQ0zg,101906 +streamlit/static/static/media/flake-0.DgWaVvm5.png,sha256=mwp_1Zg61cZJ7jgoiFfrknakIGA_h4IkI8aGxXM0I_0,73528 +streamlit/static/static/media/flake-1.B2r5AHMK.png,sha256=hg2VX6O9rmfQRbjxRDFQEH1s4DnINU91XPqHZjg2o5Q,86179 +streamlit/static/static/media/flake-2.BnWSExPC.png,sha256=Ni-cIPie1Z-0GJoBoRavyH4_Itf-jCU-t33D_JJAKPQ,92182 +streamlit/static/static/media/snowflake.JU2jBHL8.svg,sha256=Soe8chkasaXhxMYOakMAXRR1BEu2Xp02hosZrSXF6lc,7471 +streamlit/static/static/worker-B7EwKphz.js,sha256=BK1QNdMEKTO9Cq8RI0EgTdHv1KM1X3W_u60L-XWhiA8,275885 +streamlit/string_util.py,sha256=k5uRviZhammiRkT_GfAwgKWVt_MC-dxPxJXfMJHujx8,9696 +streamlit/temporary_directory.py,sha256=EWGVi2kkoIgiKK_GfU-A763c7QkpcHoAOJrKPyqWP-4,1929 +streamlit/testing/__init__.py,sha256=iZwXNLk8xCKTqIiR1dIs0i-phfx1ipLkhGasCEwkD2Q,616 +streamlit/testing/__pycache__/__init__.cpython-314.pyc,, +streamlit/testing/v1/__init__.py,sha256=7o9zKRhwtJvij7ZVSDgjcMSMi8SGHdf0euppPWtcpDo,690 +streamlit/testing/v1/__pycache__/__init__.cpython-314.pyc,, +streamlit/testing/v1/__pycache__/app_test.cpython-314.pyc,, +streamlit/testing/v1/__pycache__/element_tree.cpython-314.pyc,, +streamlit/testing/v1/__pycache__/local_script_runner.cpython-314.pyc,, +streamlit/testing/v1/__pycache__/util.cpython-314.pyc,, +streamlit/testing/v1/app_test.py,sha256=d0fNdoVuYkS73yKLmeWW0S7Fts8fealhFpl8IGpmHeQ,44077 +streamlit/testing/v1/element_tree.py,sha256=1BNWHvGRSrnSFTKF9BVKNjrrwcmI2GexkAPY0z-2KEg,85824 +streamlit/testing/v1/local_script_runner.py,sha256=-UQf8UOh2MPAIGFcGDluYieQ3HVvw4EuWThesji2u1I,7415 +streamlit/testing/v1/util.py,sha256=UgHcOgVoI34pcajImFNS7MBrIM2OTlNFcU1EcnihXzI,1986 +streamlit/time_util.py,sha256=xUAjZzyxdVJXQOZmwaRzjmpvlZfdBmcFVxZQmsdcgbg,2525 +streamlit/type_util.py,sha256=Zdn4WsvylAqpyAEelUzhjBaqcjOvPn4vpTjTkNSmbK0,15238 +streamlit/url_util.py,sha256=LMu24_I0qXZHFTvqYYz7liqSNmvphG7lEkREkLy4hFk,4630 +streamlit/user_info.py,sha256=RyVD9j3Iy1D-tvH4dkcXV5pERf699H7jpL-z18y7rWE,26018 +streamlit/util.py,sha256=xfaALXdg4XbSOF6y1K9ZRh5yfcaeTV_7oreFLg5fRFg,6752 +streamlit/vendor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +streamlit/vendor/__pycache__/__init__.cpython-314.pyc,, +streamlit/vendor/pympler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +streamlit/vendor/pympler/__pycache__/__init__.cpython-314.pyc,, +streamlit/vendor/pympler/__pycache__/asizeof.cpython-314.pyc,, +streamlit/vendor/pympler/asizeof.py,sha256=w2CZbunNoG7Wj8mT0fpIfXMLpCYvAR7RQh8D4JLHwws,87966 +streamlit/version.py,sha256=Hzm_0y5mqqNxnLR9hKGJsFg3xnR7mYjqkrIgdCJn5H4,755 +streamlit/watcher/__init__.py,sha256=pJz68XZTYSIBsrARgc9kBF_CclC_M6f50lzWUskU2_Q,915 +streamlit/watcher/__pycache__/__init__.cpython-314.pyc,, +streamlit/watcher/__pycache__/event_based_path_watcher.cpython-314.pyc,, +streamlit/watcher/__pycache__/folder_black_list.cpython-314.pyc,, +streamlit/watcher/__pycache__/local_sources_watcher.cpython-314.pyc,, +streamlit/watcher/__pycache__/path_watcher.cpython-314.pyc,, +streamlit/watcher/__pycache__/polling_path_watcher.cpython-314.pyc,, +streamlit/watcher/__pycache__/util.cpython-314.pyc,, +streamlit/watcher/event_based_path_watcher.py,sha256=d_aXGqM0Jkj2alsSUsRU91U2OLaO_aOoBcgChuY8hsY,22458 +streamlit/watcher/folder_black_list.py,sha256=NjclKQOQSVlEndLIRbi4TziDlEQMtlRmg-xCMJ2q1KA,2392 +streamlit/watcher/local_sources_watcher.py,sha256=GUOdIK5EmDNKY2uWBFN52WRej6HRA_YvxzznzLgNQ68,14124 +streamlit/watcher/path_watcher.py,sha256=RAA9Zdd9xWuZnc9atLVKcZw4uNPXoPFBPMn1bMc74no,8979 +streamlit/watcher/polling_path_watcher.py,sha256=LK7YvNJ2AQEYPBtgYoUgTl-lm9Wsd_cYBIRyrtmcev8,4416 +streamlit/watcher/util.py,sha256=fLZW1IaXRSQ1wEhhQpRGRWGPG00tWoVBMDvitBVnRMg,10042 +streamlit/web/__init__.py,sha256=iZwXNLk8xCKTqIiR1dIs0i-phfx1ipLkhGasCEwkD2Q,616 +streamlit/web/__pycache__/__init__.cpython-314.pyc,, +streamlit/web/__pycache__/bootstrap.cpython-314.pyc,, +streamlit/web/__pycache__/cache_storage_manager_config.cpython-314.pyc,, +streamlit/web/__pycache__/cli.cpython-314.pyc,, +streamlit/web/__pycache__/skills.cpython-314.pyc,, +streamlit/web/bootstrap.py,sha256=qHbQiivLKVh-5UIUNFs4HGieN8_Xh-OyYHXfkw2NR5A,17286 +streamlit/web/cache_storage_manager_config.py,sha256=kVVggwMktfKGFG_utuA27bPST3QnJxZ3eoO1H0iBB50,1216 +streamlit/web/cli.py,sha256=qKIxKgvNC2d5BQtWwK-oSzmHMxfP1EOY2AdXcDqzreU,20600 +streamlit/web/server/__init__.py,sha256=GSi74aZw1Hv5n-w6x2RIcf9Fo95S15ZPCtdqnL-RgY0,934 +streamlit/web/server/__pycache__/__init__.cpython-314.pyc,, +streamlit/web/server/__pycache__/app_discovery.cpython-314.pyc,, +streamlit/web/server/__pycache__/component_file_utils.cpython-314.pyc,, +streamlit/web/server/__pycache__/server.cpython-314.pyc,, +streamlit/web/server/__pycache__/server_util.cpython-314.pyc,, +streamlit/web/server/app_discovery.py,sha256=ouQ_AVSnCOLriOGBBxw7VwfmjyND8ohs8l_wrebPuco,13510 +streamlit/web/server/component_file_utils.py,sha256=S06490qeqROG63nXAY4z9wQXK72XbWadCfOxwKHpTYM,3849 +streamlit/web/server/server.py,sha256=GvFnC3ccoA-wvxWgIqbl2jspFZ5kwJrqcvcpdD-3QYM,4598 +streamlit/web/server/server_util.py,sha256=-eAEDC598yJjUVX4_1au_ImUqYYkEwFLJnNAM5tVwbo,6382 +streamlit/web/server/starlette/__init__.py,sha256=mwgSE6TIsl0l_s1eiIBWEk2PBIELBe2qhtXWQpCd7WA,885 +streamlit/web/server/starlette/__pycache__/__init__.cpython-314.pyc,, +streamlit/web/server/starlette/__pycache__/starlette_app.cpython-314.pyc,, +streamlit/web/server/starlette/__pycache__/starlette_app_utils.cpython-314.pyc,, +streamlit/web/server/starlette/__pycache__/starlette_auth_routes.cpython-314.pyc,, +streamlit/web/server/starlette/__pycache__/starlette_gzip_middleware.cpython-314.pyc,, +streamlit/web/server/starlette/__pycache__/starlette_path_security_middleware.cpython-314.pyc,, +streamlit/web/server/starlette/__pycache__/starlette_routes.cpython-314.pyc,, +streamlit/web/server/starlette/__pycache__/starlette_server.cpython-314.pyc,, +streamlit/web/server/starlette/__pycache__/starlette_server_config.cpython-314.pyc,, +streamlit/web/server/starlette/__pycache__/starlette_static_routes.cpython-314.pyc,, +streamlit/web/server/starlette/__pycache__/starlette_websocket.cpython-314.pyc,, +streamlit/web/server/starlette/starlette_app.py,sha256=DeZ9jXLlYntas6AsUjTI7L9J1IHy4UoBh3yPVf7MRgA,37966 +streamlit/web/server/starlette/starlette_app_utils.py,sha256=fIxh32VX8d9z6rnaBNFy9VSyCZI8Sd-9Ks3ZDscbck8,9307 +streamlit/web/server/starlette/starlette_auth_routes.py,sha256=JzkZwRRRizpxa6HWRsE5MFDFBUWw_MJPchZvYlOnkAo,25056 +streamlit/web/server/starlette/starlette_gzip_middleware.py,sha256=cab1W1eE5AfKuSvtEQhDE-F50PTurhDsd195_XfUOhA,5254 +streamlit/web/server/starlette/starlette_path_security_middleware.py,sha256=Lwyc7rtqlTj6PmMXT4Ft71-Qmj4tXAbtMQF9V4wJk4M,6809 +streamlit/web/server/starlette/starlette_routes.py,sha256=NmkIAmedQLcDvpfcCj5rHH2-z3hznwhXlUPnFaDccz4,35647 +streamlit/web/server/starlette/starlette_server.py,sha256=4kTPAJo6atNxkHtdql1B_sn8887OFiKOF7oHNX_k0nc,23510 +streamlit/web/server/starlette/starlette_server_config.py,sha256=oVf6IQBsDSvKM4NUh559y5wzRbb7JFzXVcIpgbdDOkA,3635 +streamlit/web/server/starlette/starlette_static_routes.py,sha256=YTokUDdCUNxpKRBLe14yA5J3OavsVHIRLeuO1U4eH6s,8567 +streamlit/web/server/starlette/starlette_websocket.py,sha256=swv8NGtgn9uwpjlZE192fLj8Jui5GS4SX1q3dCmS6aE,22410 +streamlit/web/skills.py,sha256=RJd4Hqscjsyt2gI1KdafkN2mgoyS1KY5BUAF53ri5qI,43445 diff --git a/venv/Lib/site-packages/streamlit-1.60.0.dist-info/REQUESTED b/venv/Lib/site-packages/streamlit-1.60.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/Lib/site-packages/streamlit-1.60.0.dist-info/WHEEL b/venv/Lib/site-packages/streamlit-1.60.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..1d472b6c22838de58d1c3c0dd2c795a5cde9e415 --- /dev/null +++ b/venv/Lib/site-packages/streamlit-1.60.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (83.0.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/venv/Lib/site-packages/streamlit-1.60.0.dist-info/entry_points.txt b/venv/Lib/site-packages/streamlit-1.60.0.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..f0eac89e3c4fe73122c7c7ad36e96f729ad44d9a --- /dev/null +++ b/venv/Lib/site-packages/streamlit-1.60.0.dist-info/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +streamlit = streamlit.web.cli:main diff --git a/venv/Lib/site-packages/streamlit-1.60.0.dist-info/top_level.txt b/venv/Lib/site-packages/streamlit-1.60.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..12a4706528df633fb7dc92f54e4304c6ccea630c --- /dev/null +++ b/venv/Lib/site-packages/streamlit-1.60.0.dist-info/top_level.txt @@ -0,0 +1 @@ +streamlit diff --git a/venv/Lib/site-packages/streamlit/runtime/memory_uploaded_file_manager.py b/venv/Lib/site-packages/streamlit/runtime/memory_uploaded_file_manager.py new file mode 100644 index 0000000000000000000000000000000000000000..1cf16ef126c1096b9e79df8da52cffc6a7e4bac7 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/memory_uploaded_file_manager.py @@ -0,0 +1,177 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import threading +import uuid +from collections import defaultdict +from typing import TYPE_CHECKING + +from streamlit import util +from streamlit.runtime.stats import CACHE_MEMORY_FAMILY, CacheStat, group_cache_stats +from streamlit.runtime.uploaded_file_manager import ( + UploadedFileManager, + UploadedFileRec, + UploadFileUrlInfo, +) + +if TYPE_CHECKING: + from collections.abc import Sequence + + +class MemoryUploadedFileManager(UploadedFileManager): + """Holds files uploaded by users of the running Streamlit app. + This class can be used safely from multiple threads simultaneously. + """ + + def __init__(self, upload_endpoint: str) -> None: + self.file_storage: dict[str, dict[str, UploadedFileRec]] = defaultdict(dict) + self.endpoint = upload_endpoint + self._total_bytes = 0 + self._file_count = 0 + self._lock = threading.Lock() + + @property + def stats_families(self) -> Sequence[str]: + return (CACHE_MEMORY_FAMILY,) + + def get_files( + self, session_id: str, file_ids: Sequence[str] + ) -> list[UploadedFileRec]: + """Return a list of UploadedFileRec for a given sequence of file_ids. + + Parameters + ---------- + session_id + The ID of the session that owns the files. + file_ids + The sequence of ids associated with files to retrieve. + + Returns + ------- + List[UploadedFileRec] + A list of URL UploadedFileRec instances, each instance contains information + about uploaded file. + """ + with self._lock: + # Use `.get` instead of indexing so that reading files for an + # unknown session does not create an empty entry in the defaultdict. + session_storage = self.file_storage.get(session_id) + if session_storage is None: + return [] + + return [ + file_rec + for file_id in file_ids + if (file_rec := session_storage.get(file_id)) is not None + ] + + def remove_session_files(self, session_id: str) -> None: + """Remove all files associated with a given session.""" + with self._lock: + session_storage = self.file_storage.pop(session_id, None) + if session_storage is not None: + self._total_bytes -= sum( + len(file.data) for file in session_storage.values() + ) + self._file_count -= len(session_storage) + + def __repr__(self) -> str: + return util.repr_(self) + + def add_file( + self, + session_id: str, + file: UploadedFileRec, + ) -> None: + """ + Safe to call from any thread. + + Parameters + ---------- + session_id + The ID of the session that owns the file. + file + The file to add. + """ + with self._lock: + session_storage = self.file_storage[session_id] + old_file = session_storage.get(file.file_id) + if old_file is not None: + self._total_bytes -= len(old_file.data) + else: + self._file_count += 1 + + session_storage[file.file_id] = file + self._total_bytes += len(file.data) + + def remove_file(self, session_id: str, file_id: str) -> None: + """Remove file with given file_id associated with a given session.""" + with self._lock: + # Use `.get` instead of indexing so that removing a file for an + # unknown session does not create an empty entry in the defaultdict. + session_storage = self.file_storage.get(session_id) + if session_storage is None: + return + + file = session_storage.pop(file_id, None) + if file is not None: + self._total_bytes -= len(file.data) + self._file_count -= 1 + + def get_upload_urls( + self, session_id: str, file_names: Sequence[str] + ) -> list[UploadFileUrlInfo]: + """Return a list of UploadFileUrlInfo for a given sequence of file_names.""" + result = [] + for _ in file_names: + file_id = str(uuid.uuid4()) + result.append( + UploadFileUrlInfo( + file_id=file_id, + upload_url=f"{self.endpoint}/{session_id}/{file_id}", + delete_url=f"{self.endpoint}/{session_id}/{file_id}", + ) + ) + return result + + def get_stats( + self, _family_names: Sequence[str] | None = None + ) -> dict[str, list[CacheStat]]: + """Return the manager's CacheStats. + + Safe to call from any thread. + """ + with self._lock: + total_bytes = self._total_bytes + file_count = self._file_count + + # Emit a stat whenever any files are tracked, even if they are all + # zero-byte uploads (matching the previous per-file behavior). Gating on + # total_bytes alone would drop zero-byte uploads from the metrics. + if file_count == 0: + return {} + + stats = [ + CacheStat( + category_name="UploadedFileManager", + cache_name="", + byte_length=total_bytes, + ) + ] + # In general, get_stats methods need to be able to return only requested stat + # families, but this method only returns a single family, and we're guaranteed + # that it was one of those requested if we make it here. + return {CACHE_MEMORY_FAMILY: group_cache_stats(stats)} diff --git a/venv/Lib/site-packages/streamlit/runtime/metrics_util.py b/venv/Lib/site-packages/streamlit/runtime/metrics_util.py new file mode 100644 index 0000000000000000000000000000000000000000..4f8f07b4baa2e8b6bb3fe47b61ff1c6a6051fbbe --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/metrics_util.py @@ -0,0 +1,661 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import contextlib +import inspect +import os +import sys +import threading +import time +import uuid +from collections.abc import Callable, Sequence, Sized +from functools import lru_cache, wraps +from typing import Any, Final, TypeVar, cast, overload + +from streamlit import config, file_util, type_util, util +from streamlit.logger import get_logger +from streamlit.proto.ForwardMsg_pb2 import ForwardMsg +from streamlit.proto.PageProfile_pb2 import Argument, Command +from streamlit.runtime.scriptrunner_utils.exceptions import RerunException +from streamlit.runtime.scriptrunner_utils.script_run_context import get_script_run_ctx + +_LOGGER: Final = get_logger(__name__) + +# Limit the number of commands to keep the page profile message small +_MAX_TRACKED_COMMANDS: Final = 400 +# Only track a maximum of 25 uses per unique command since some apps use +# commands excessively (e.g. calling write thousands of times in one rerun) +# making the page profile useless. +_MAX_TRACKED_PER_COMMAND: Final = 25 + +# A mapping to convert from the actual name to preferred/shorter representations +_OBJECT_NAME_MAPPING: Final = { + "streamlit.delta_generator.DeltaGenerator": "DG", + # pandas 2.x paths + "pandas.core.frame.DataFrame": "DataFrame", + "pandas.core.indexes.base.Index": "PandasIndex", + "pandas.core.series.Series": "PandasSeries", + # pandas 3.x paths (module changed from pandas.core.* to pandas.*) + "pandas.DataFrame": "DataFrame", + "pandas.Index": "PandasIndex", + "pandas.Series": "PandasSeries", + "plotly.graph_objs._figure.Figure": "PlotlyFigure", + "matplotlib.figure.Figure": "MatplotlibFigure", + "pandas.io.formats.style.Styler": "PandasStyler", + "streamlit.connections.sql_connection.SQLConnection": "SQLConnection", +} + +# A list of dependencies to check for attribution +_ATTRIBUTIONS_TO_CHECK: Final = [ + # DB Clients: + "pymysql", + "MySQLdb", + "mysql", + "pymongo", + "ibis", + "boto3", + "psycopg2", + "psycopg3", + "sqlalchemy", + "elasticsearch", + "pyodbc", + "pymssql", + "cassandra", + "azure", + "redis", + "sqlite3", + "neo4j", + "duckdb", + "opensearchpy", + "supabase", + "databricks", + # Dataframe Libraries: + "polars", + "dask", + "vaex", + "modin", + "pyspark", + "cudf", + "xarray", + "geopandas", + "mars", + "tables", + "zarr", + "datasets", + "daft", + # ML & LLM Tools: + "mistralai", + "openai", + "langchain", + "llama_index", + "llama_cpp", + "anthropic", + "pyllamacpp", + "cohere", + "transformers", + "nomic", + "diffusers", + "semantic_kernel", + "replicate", + "huggingface_hub", + "wandb", + "torch", + "tensorflow", + "trubrics", + "comet_ml", + "clarifai", + "reka", + "hegel", + "fastchat", + "assemblyai", + "openllm", + "embedchain", + "haystack", + "vllm", + "alpa", + "jinaai", + "guidance", + "litellm", + "comet_llm", + "instructor", + "xgboost", + "lightgbm", + "catboost", + "sklearn", + "pydantic_ai", + "datachain", + "docling", + "litserve", + "crawl4ai", + "baml_client", + "browser_use", + "crewai", + "unsloth", + "langgraph", + "dspy", + "ultralytics", + "instructor", + "ragas", + "swarm", + "faster_whisper", + "memori", + "autogen_agentchat", + "xai_sdk", + "agno", + "langfuse", + "smolagents", + "ollama", + "groq", + "together", + "ai21", + "marvin", + "outlines", + "guardrails", + "promptflow", + "semantic_router", + "mem0", + "aisuite", + "mlflow", + "optuna", + "keras", + "jax", + "shap", + "evidently", + "great_expectations", + "bentoml", + "modal", + "sagemaker", + "vertexai", + "tiktoken", + "sentence_transformers", + "spacy", + "nltk", + "onnxruntime", + "llama_api_client", + # Workflow Tools: + "prefect", + "luigi", + "airflow", + "dagster", + "celery", + # Vector Stores: + "pgvector", + "faiss", + "annoy", + "pinecone", + "chromadb", + "weaviate", + "qdrant_client", + "pymilvus", + "lancedb", + # Others: + "snowflake", + "pydantic", + "fastapi", + "playwright", + "folium", + "geopandas", + "httpx", + "pyecharts", + "fastplotlib", + "pygfx", + "highcharts_core", + # Optional streamlit dependencies: + "seaborn", + "graphviz", + "matplotlib", + "uvloop", + "orjson", + "rich", + "streamlit_extras", + "streamlit_pydantic", + "pygwalker", + "plotly", + "bokeh", + "plost", + "authlib", + # Document Processing: + "pypdf", + "pdfplumber", + "docx", + "openpyxl", + "xlsxwriter", + # Image/Vision: + "cv2", + "mediapipe", +] + +_ETC_MACHINE_ID_PATH = "/etc/machine-id" +_DBUS_MACHINE_ID_PATH = "/var/lib/dbus/machine-id" + + +def _get_machine_id_v3() -> str: + """Get the machine ID. + + This is a unique identifier for a user for tracking metrics, + that is broken in different ways in some Linux distros and Docker images. + - at times just a hash of '', which means many machines map to the same ID + - at times a hash of the same string, when running in a Docker container + """ + + if os.path.isfile(_ETC_MACHINE_ID_PATH): + with open(_ETC_MACHINE_ID_PATH, encoding="utf-8") as f: + machine_id = f.read() + + elif os.path.isfile(_DBUS_MACHINE_ID_PATH): + with open(_DBUS_MACHINE_ID_PATH, encoding="utf-8") as f: + machine_id = f.read() + + else: + machine_id = str(uuid.getnode()) + + return machine_id + + +def _get_machine_id_v4() -> str: + """Get a random ID that is stable for each machine, generating if needed. + + This is a unique identifier for a user for tracking metrics. + Instead of relying on a hardware address in the container or host we'll + generate a UUID and store it in the ~/.streamlit hidden folder. + """ + # If gatherUsageStats is False skip this whole code. + # This is just for people who don't want the extra machine_id_v4 file + # in their file system. + if not config.get_option("browser.gatherUsageStats"): + # This value will never be sent to our telemetry. Just including it here + # to help debug. + return "no-machine-id-v4" + + filepath = file_util.get_streamlit_file_path("machine_id_v4") + stable_id = None + + if os.path.exists(filepath): + with file_util.streamlit_read(filepath) as file: + stable_id = file.read() + + if not stable_id: + stable_id = str(uuid.uuid4()) + with file_util.streamlit_write(filepath) as output: + output.write(stable_id) + + return stable_id + + +class Installation: + _instance_lock = threading.Lock() + _instance: Installation | None = None + + @classmethod + def instance(cls) -> Installation: + """Returns the singleton Installation.""" + # We use a double-checked locking optimization to avoid the overhead + # of acquiring the lock in the common case: + # https://en.wikipedia.org/wiki/Double-checked_locking + if cls._instance is None: + with cls._instance_lock: + if cls._instance is None: + cls._instance = Installation() + + return cls._instance + + def __init__(self) -> None: + self.installation_id_v3 = str( + uuid.uuid5(uuid.NAMESPACE_DNS, _get_machine_id_v3()) + ) + + self.installation_id_v4 = _get_machine_id_v4() + + def __repr__(self) -> str: + return util.repr_(self) + + @property + def installation_id(self) -> str: + return self.installation_id_v3 + + +def _get_type_name(obj: object) -> str: + """Get a simplified name for the type of the given object.""" + with contextlib.suppress(Exception): + obj_type = obj if inspect.isclass(obj) else type(obj) + type_name = "unknown" + if hasattr(obj_type, "__qualname__"): + type_name = obj_type.__qualname__ + elif hasattr(obj_type, "__name__"): + type_name = obj_type.__name__ + + if obj_type.__module__ != "builtins": + # Add the full module path + type_name = f"{obj_type.__module__}.{type_name}" + + if type_name in _OBJECT_NAME_MAPPING: + type_name = _OBJECT_NAME_MAPPING[type_name] + return type_name + return "failed" + + +def _get_top_level_module(func: Callable[..., Any]) -> str: + """Get the top level module for the given function.""" + module = inspect.getmodule(func) + if module is None or not module.__name__: + return "unknown" + return module.__name__.split(".")[0] + + +def _get_arg_metadata(arg: object) -> str | None: + """Get metadata information related to the value of the given object.""" + with contextlib.suppress(Exception): + if isinstance(arg, (bool)): + return f"val:{arg}" + + if isinstance(arg, Sized): + return f"len:{len(arg)}" + + return None + + +@lru_cache(maxsize=256) +def _get_arg_keywords_cached(func: Callable[..., Any]) -> tuple[str, ...]: + """Return POSITIONAL_ONLY and POSITIONAL_OR_KEYWORD parameter names as an immutable tuple. + + Results are cached by function identity. Callers must pass ``func.__func__`` + for bound methods — this function operates on unbound callables only. + + On Python 3.14+, PEP 649 causes annotation evaluation to be deferred until + accessed. This can fail with NameError when annotations reference types + imported under TYPE_CHECKING. Since we only need parameter names (not + annotations), we use ``annotation_format=Format.STRING`` to avoid evaluation. + + See: https://github.com/streamlit/streamlit/issues/14324 + """ + params = type_util.get_func_parameters(func) + return tuple( + p.name + for p in params + if p.kind + in {inspect.Parameter.POSITIONAL_ONLY, inspect.Parameter.POSITIONAL_OR_KEYWORD} + ) + + +def _get_arg_keywords(func: Callable[..., Any]) -> list[str]: + """Return argument names from a function's signature. + + This returns argument names matching the behavior of getfullargspec().args: + - Both POSITIONAL_ONLY and POSITIONAL_OR_KEYWORD parameters (not keyword-only) + - Includes 'self' for bound methods + + Uses caching to avoid repeated expensive inspect.signature() calls. + + Note: The underlying LRU cache holds strong references to function objects. + This is fine for typical Streamlit usage with module-level functions, but + dynamically created callables (e.g., closures, partials) may be retained + until evicted from the cache. + """ + # For bound methods, use __func__ as cache key: this ensures cache hits + # across different bound instances of the same method, and + # get_func_parameters(__func__) already includes 'self'. + if inspect.ismethod(func): + return list(_get_arg_keywords_cached(func.__func__)) + return list(_get_arg_keywords_cached(func)) + + +def _get_command_telemetry( + _command_func: Callable[..., Any], _command_name: str, *args: Any, **kwargs: Any +) -> Command: + """Get telemetry information for the given callable and its arguments.""" + arg_keywords = _get_arg_keywords(_command_func) + self_arg: Any | None = None + arguments: list[Argument] = [] + is_method = inspect.ismethod(_command_func) + name = _command_name + + for i, arg in enumerate(args): + pos = i + if is_method: + # If func is a method, ignore the first argument (self) + i += 1 # noqa: PLW2901 + + keyword = arg_keywords[i] if len(arg_keywords) > i else f"{i}" + if keyword == "self": + self_arg = arg + continue + argument = Argument(k=keyword, t=_get_type_name(arg), p=pos) + + arg_metadata = _get_arg_metadata(arg) + if arg_metadata: + argument.m = arg_metadata + arguments.append(argument) + for kwarg, kwarg_value in kwargs.items(): + argument = Argument(k=kwarg, t=_get_type_name(kwarg_value)) + + arg_metadata = _get_arg_metadata(kwarg_value) + if arg_metadata: + argument.m = arg_metadata + arguments.append(argument) + + top_level_module = _get_top_level_module(_command_func) + if top_level_module != "streamlit": + # If the gather_metrics decorator is used outside of streamlit library + # we enforce a prefix to be added to the tracked command: + name = f"external:{top_level_module}:{name}" + + if ( + name == "create_instance" + and self_arg + and hasattr(self_arg, "name") + and self_arg.name + ): + name = f"component:{self_arg.name}" + + if name == "_bidi_component" and len(args) > 1 and isinstance(args[1], str): + # Bound DeltaGenerator methods always receive `self` as args[0], so args[1] + # is the user-supplied component name. + component_name = args[1] + name = f"component_v2:{component_name}" + + return Command(name=name, args=arguments) + + +def to_microseconds(seconds: float) -> int: + """Convert seconds into microseconds.""" + return int(seconds * 1_000_000) + + +F = TypeVar("F", bound=Callable[..., Any]) + + +@overload +def gather_metrics( + name: str, + func: F, +) -> F: ... + + +@overload +def gather_metrics( + name: str, + func: None = None, +) -> Callable[[F], F]: ... + + +def gather_metrics(name: str, func: F | None = None) -> Callable[[F], F] | F: + """Function decorator to add telemetry tracking to commands. + + Parameters + ---------- + name : str + The name to use for telemetry tracking. + func : callable or None + The function to track for telemetry. If ``None`` (default), returns a + decorator that can be applied to a function. + + Examples + -------- + >>> @st.gather_metrics("my_command") + ... def my_command(url): + ... return url + """ + + if not name: + _LOGGER.warning("gather_metrics: name is empty") + name = "undefined" + + if func is None: + # Support passing the params via function decorator + def wrapper(f: F) -> F: + return gather_metrics( + name=name, + func=f, + ) + + return wrapper + # To make mypy type narrow F | None -> F + non_optional_func = func + + @wraps(non_optional_func) + def wrapped_func(*args: Any, **kwargs: Any) -> Any: + from timeit import default_timer as timer + + exec_start = timer() + ctx = get_script_run_ctx(suppress_warning=True) + + tracking_activated = ( + ctx is not None + and ctx.gather_usage_stats + and not ctx.command_tracking_deactivated + and ctx.shared.tracked_commands_count + < _MAX_TRACKED_COMMANDS # Prevent too much memory usage + ) + + command_telemetry: Command | None = None + # This flag is needed to make sure that only the command (the outermost command) + # that deactivated tracking (via ctx.command_tracking_deactivated) is able to reset it + # again. This is important to prevent nested commands from reactivating tracking. + # At this point, we don't know yet if the command will deactivated tracking. + has_set_command_tracking_deactivated = False + + if ctx and tracking_activated: + try: + command_telemetry = _get_command_telemetry( + non_optional_func, name, *args, **kwargs + ) + + ctx.shared.track_command(command_telemetry, _MAX_TRACKED_PER_COMMAND) + # Deactivate tracking to prevent calls inside already tracked commands + ctx.command_tracking_deactivated = True + # The ctx.command_tracking_deactivated flag was set to True, + # we also need to set has_set_command_tracking_deactivated to True + # to make sure that this command is able to reset it again. + has_set_command_tracking_deactivated = True + except Exception as ex: + # Always capture all exceptions since we want to make sure that + # the telemetry never causes any issues. + _LOGGER.debug("Failed to collect command telemetry", exc_info=ex) + try: + result = non_optional_func(*args, **kwargs) + except RerunException: + # Duplicated from below, because static analysis tools get confused + # by deferring the rethrow. + if tracking_activated and command_telemetry: + command_telemetry.time = to_microseconds(timer() - exec_start) + raise + finally: + # Activate tracking again if command executes without any exceptions + # we only want to do that if this command has set the + # flag to deactivate tracking. + if ctx and has_set_command_tracking_deactivated: + ctx.command_tracking_deactivated = False + + if tracking_activated and command_telemetry: + # Set the execution time to the measured value + command_telemetry.time = to_microseconds(timer() - exec_start) + + return result + + with contextlib.suppress(AttributeError, NameError): + # Make this a well-behaved decorator by preserving important function + # attributes. + # NameError: Python 3.14 PEP 649 deferred annotation evaluation can raise + # NameError for TYPE_CHECKING-only imports in inspect.signature() + wrapped_func.__dict__.update(non_optional_func.__dict__) + wrapped_func.__signature__ = inspect.signature(non_optional_func) # type: ignore + return cast("F", wrapped_func) + + +def create_page_profile_message( + commands: Sequence[Command], + exec_time: int, + prep_time: int, + uncaught_exception: str | None = None, +) -> ForwardMsg: + """Create and return the full PageProfile ForwardMsg.""" + msg = ForwardMsg() + page_profile = msg.page_profile + + page_profile.commands.extend(commands) + page_profile.exec_time = exec_time + page_profile.prep_time = prep_time + + page_profile.headless = config.get_option("server.headless") + + # Include the server mode for metrics tracking + if config._server_mode: + page_profile.server_mode = config._server_mode + + # Collect all config options that have been manually set + config_options: set[str] = set() + if config._config_options: + for option_name in config._config_options: + if not config.is_manually_set(option_name): + # We only care about manually defined options + continue + + config_option = config._config_options[option_name] + config_options.add( + f"{option_name}:default" if config_option.is_default else option_name + ) + + page_profile.config.extend(config_options) + + # Check the predefined set of modules for attribution + attributions: set[str] = { + attribution + for attribution in _ATTRIBUTIONS_TO_CHECK + if attribution in sys.modules + } + + page_profile.os = str(sys.platform) + page_profile.timezone = str(time.tzname) + page_profile.attributions.extend(attributions) + + if uncaught_exception: + page_profile.uncaught_exception = uncaught_exception + + app_dir: str | None = None + if ctx := get_script_run_ctx(): + page_profile.is_fragment_run = bool(ctx.fragment_ids_this_run) + if ctx.main_script_path: + app_dir = os.path.dirname(ctx.main_script_path) + + # Skill/agent detection lives in ``streamlit.web.skills`` (co-located with + # the installer it must stay aligned with); imported lazily to avoid a + # module-load dependency from runtime onto web. + from streamlit.web import skills + + page_profile.installed_skills.extend(skills.detect_installed_skills(app_dir)) + page_profile.installed_agents.extend(skills.detect_installed_agents()) + + return msg diff --git a/venv/Lib/site-packages/streamlit/runtime/outside_container_wrapper.py b/venv/Lib/site-packages/streamlit/runtime/outside_container_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..106f1dafaa3a0321ef0c9a68c95fa0bfdcdc5561 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/outside_container_wrapper.py @@ -0,0 +1,46 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from streamlit.delta_generator import DeltaGenerator + from streamlit.proto import Block_pb2 + + +@dataclass +class OutsideContainerWrapper: + """Cached implicit wrapper between an outside container and a fragment's writes. + + Attributes + ---------- + delta_generator : DeltaGenerator + The wrapper DeltaGenerator that the fragment writes into. + creation_delta_path : list[int] + The delta path at which the wrapper was originally created, retained so + the wrapper's ``add_block`` delta can be re-emitted on each fragment rerun. + block_proto : Block_pb2.Block + The Block proto for the wrapper, also retained for re-emission. + creating_fragment_id : str | None + The fragment whose scope created the outside container (``None`` for the + main script). Drives per-fragment eviction when that scope reruns. + """ + + delta_generator: DeltaGenerator + creation_delta_path: list[int] + block_proto: Block_pb2.Block + creating_fragment_id: str | None diff --git a/venv/Lib/site-packages/streamlit/runtime/pages_manager.py b/venv/Lib/site-packages/streamlit/runtime/pages_manager.py new file mode 100644 index 0000000000000000000000000000000000000000..c4c0a2a742d8921acddbc79edb584314baaea21c --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/pages_manager.py @@ -0,0 +1,214 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import threading +from pathlib import Path +from typing import TYPE_CHECKING, Any + +from streamlit.util import calc_hash + +if TYPE_CHECKING: + from streamlit.runtime.scriptrunner.script_cache import ScriptCache + from streamlit.source_util import PageHash, PageInfo, PageName, ScriptPath + + +class PagesManager: + """ + PagesManager is responsible for managing the set of pages that make up + the entire application. At the start we assume the main script is the + only page. As the script runs, the main script can call `st.navigation` + to set the set of pages that make up the app. + """ + + uses_pages_directory: bool | None = None + + def __init__( + self, + main_script_path: ScriptPath, + script_cache: ScriptCache | None = None, + **kwargs: Any, + ) -> None: + self._lock = threading.Lock() + self._main_script_path = main_script_path + self._main_script_hash: PageHash = calc_hash(main_script_path) + self._script_cache = script_cache + self._intended_page_script_hash: PageHash | None = None + self._intended_page_name: PageName | None = None + self._current_page_script_hash: PageHash = "" + self._pages: dict[PageHash, PageInfo] | None = None + # A relic of v1 of Multipage apps, we performed special handling + # for apps with a pages directory. We will keep this flag around + # for now to maintain the behavior for apps that were created with + # the pages directory feature. + # + # NOTE: we will update the feature if the flag has not been set + # this means that if users use v2 behavior, the flag will + # always be set to False + if PagesManager.uses_pages_directory is None: + PagesManager.uses_pages_directory = Path( + self.main_script_parent / "pages" + ).exists() + + @property + def main_script_path(self) -> ScriptPath: + return self._main_script_path + + @property + def main_script_parent(self) -> Path: + return Path(self._main_script_path).parent + + @property + def main_script_hash(self) -> PageHash: + return self._main_script_hash + + @property + def current_page_script_hash(self) -> PageHash: + return self._current_page_script_hash + + @property + def intended_page_name(self) -> PageName | None: + return self._intended_page_name + + @property + def intended_page_script_hash(self) -> PageHash | None: + return self._intended_page_script_hash + + def set_current_page_script_hash(self, page_script_hash: PageHash) -> None: + self._current_page_script_hash = page_script_hash + + def get_main_page(self) -> PageInfo: + return { + "script_path": self._main_script_path, + "page_script_hash": self._main_script_hash, + } + + def set_script_intent( + self, page_script_hash: PageHash, page_name: PageName + ) -> None: + # Not lock-protected: attribute assignment is atomic in both GIL and + # free-threaded CPython, and intent is always set before script + # execution begins (not concurrently with set_pages_and_resolve). + self._intended_page_script_hash = page_script_hash + self._intended_page_name = page_name + + def get_initial_active_script(self, page_script_hash: PageHash) -> PageInfo | None: + return { + # We always run the main script in V2 as it's the common code + "script_path": self.main_script_path, + "page_script_hash": page_script_hash + or self.main_script_hash, # Default Hash + } + + def get_pages(self) -> dict[PageHash, PageInfo]: + """Return a snapshot of the current page registry. + + Lock-protected for free-threaded Python (PEP 703) where + iterating a dict during concurrent mutation is unsafe. + Returns a shallow copy so callers can safely iterate. + + If pages are not set, returns a default page info where the main + script path is the executing script and the page script hash/name + reflects the intended page requested. + """ + with self._lock: + if self._pages is not None: + return dict(self._pages) + return { + self.main_script_hash: { + "page_script_hash": self.intended_page_script_hash or "", + "page_name": self.intended_page_name or "", + "icon": "", + "script_path": self.main_script_path, + } + } + + def _set_pages(self, pages: dict[PageHash, PageInfo]) -> None: + """Internal method for setting pages. Use set_pages_and_resolve() instead.""" + with self._lock: + self._pages = pages + + def set_pages_and_resolve( + self, + pages: dict[PageHash, PageInfo], + fallback_page_hash: PageHash = "", + ) -> PageInfo | None: + """Atomically set the page registry and resolve the current page. + + Both operations are performed under a single lock, ensuring the page + resolution sees the pages that were just set even under concurrent + access. + + Parameters + ---------- + pages : dict[PageHash, PageInfo] + The page registry to set. + fallback_page_hash : PageHash + The fallback page hash to use if the intended page is not found. + + Returns + ------- + PageInfo | None + The resolved page info, or None if no matching page is found. + """ + with self._lock: + self._pages = pages + return self._resolve_page_script(fallback_page_hash) + + def _resolve_page_script( + self, fallback_page_hash: PageHash = "" + ) -> PageInfo | None: + """Internal resolver — caller must hold self._lock. + + Resolves the page script based on intended_page_script_hash or + intended_page_name, falling back to fallback_page_hash if needed. + """ + if self._pages is None: + return None + + if self.intended_page_script_hash: + # If a page hash is specified, we assume a page should exist. + # Return the matching page or fall back to the default page hash. + return self._pages.get( + self.intended_page_script_hash, + self._pages.get(fallback_page_hash, None), + ) + if self.intended_page_name: + # If a user navigates directly to a non-main page of an app, + # the page name can identify the page script to run. + # Note: The lambda captures self.intended_page_name at execution + # time. This is safe because attribute reads are atomic in both + # GIL and free-threaded CPython, and set_script_intent is always + # called before script execution begins. + return next( + filter( + # There seems to be this weird bug with mypy where it + # thinks that p can be None (which is impossible given the + # types of pages), so we add `p and` at the beginning of + # the predicate to circumvent this. + lambda p: p and (p["url_pathname"] == self.intended_page_name), + self._pages.values(), + ), + None, + ) + + return self._pages.get(fallback_page_hash, None) + + def get_page_script_byte_code(self, script_path: str) -> Any: + if self._script_cache is None: + # Returning an empty string for an empty script + return "" + + return self._script_cache.get_bytecode(script_path) diff --git a/venv/Lib/site-packages/streamlit/runtime/parallel_coordinator.py b/venv/Lib/site-packages/streamlit/runtime/parallel_coordinator.py new file mode 100644 index 0000000000000000000000000000000000000000..23a83c7a552f4832982cde29349f748452c83997 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/parallel_coordinator.py @@ -0,0 +1,241 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +"""ParallelFragmentCoordinator and supporting helpers. + +Manages a thread pool for parallel fragment execution. The coordinator +receives the caller's ``ScriptRunContext`` explicitly via ``submit()`` +so that worker threads can access the correct context. +""" + +from __future__ import annotations + +import contextlib +import contextvars +import threading +from concurrent.futures import ThreadPoolExecutor +from typing import TYPE_CHECKING, Any + +from streamlit.runtime.scriptrunner_utils.exceptions import ( + RerunException, + StopException, +) +from streamlit.runtime.scriptrunner_utils.script_run_context_attr import ( + SCRIPT_RUN_CONTEXT_ATTR_NAME, +) + +if TYPE_CHECKING: + from collections.abc import Callable, Iterator + + from streamlit.runtime.scriptrunner_utils.script_run_context import ( + ScriptRunContext, + ) + + +@contextlib.contextmanager +def _scoped_ctx_attach(ctx: ScriptRunContext | None) -> Iterator[None]: + """Bind *ctx* as the active ScriptRunContext on the current thread for + the duration of the block; restore the prior binding on exit. + + Used by ``ParallelFragmentCoordinator.submit()`` so a pool thread that + executes successive submissions sees the right ctx for each call and + never carries a stale ctx across submissions. + """ + thread = threading.current_thread() + prev = getattr(thread, SCRIPT_RUN_CONTEXT_ATTR_NAME, None) + setattr(thread, SCRIPT_RUN_CONTEXT_ATTR_NAME, ctx) + try: + yield + finally: + if prev is None: + try: + delattr(thread, SCRIPT_RUN_CONTEXT_ATTR_NAME) + except AttributeError: + pass + else: + setattr(thread, SCRIPT_RUN_CONTEXT_ATTR_NAME, prev) + + +class ParallelFragmentCoordinator: + """Manages the lifecycle of parallel fragment workers for one script run. + + Owned by ScriptRunContext (created in ctx.reset()) and exposed as + ctx.parallel_coordinator. The coordinator is single-use: a fresh + instance is created at the start of every script run, joined or drained + before the run ends, and discarded. + + Workers submitted via :meth:`submit` run inside a + ``contextvars.copy_context()`` snapshot of the caller's context with a + scoped ``ScriptRunContext`` attach so ``get_script_run_ctx()`` and + ``ThreadState.get()`` return the parent's values. Worker-side + ``ThreadState.update()`` writes stay local to the copied context. + """ + + def __init__( + self, + yield_check: Callable[[], None], + max_workers: int | None = None, + poll_interval: float = 0.1, + ) -> None: + if max_workers is not None and max_workers < 1: + raise ValueError( + f"runner.parallelMaxWorkers must be None or a positive " + f"integer, got {max_workers!r}" + ) + self._executor = ThreadPoolExecutor(max_workers=max_workers) + self._outstanding = 0 + self._join_condition = threading.Condition(threading.Lock()) + self._stop_event = threading.Event() + self._worker_exception: RerunException | StopException | None = None + self._exception_lock = threading.Lock() + self._yield_check = yield_check + self._poll_interval = poll_interval + + def submit( + self, + fn: Callable[..., Any], + ctx: ScriptRunContext | None, + *args: Any, + ) -> None: + """Submit a worker function to the thread pool. + + Captures the caller's full ``contextvars.Context`` (which includes + ``FragmentThreadState``) at submit time. The worker runs inside + ``copy_context().run(...)`` with a scoped ctx attach so + ``get_script_run_ctx()`` and ``ThreadState.get()`` return the parent's + values for the duration of the call. Worker-side + ``ThreadState.update()`` writes stay local to the captured copy — they + never leak back to the parent thread. + + Increments the outstanding counter before submitting so a nested + submit() from inside a running worker is visible to join() before + the parent's tracked() decrement runs. May be called from any + thread (main thread or worker threads for nested fragments). + + Parameters + ---------- + fn : Callable[..., Any] + The worker function to execute in the thread pool. + ctx : ScriptRunContext | None + The ScriptRunContext to propagate to the worker thread so that + ``get_script_run_ctx()`` returns the correct context inside the + worker. + *args : Any + Positional arguments forwarded to ``fn``. + """ + captured = contextvars.copy_context() + + with self._join_condition: + self._outstanding += 1 + + def tracked() -> None: + try: + with _scoped_ctx_attach(ctx): + captured.run(fn, *args) + finally: + with self._join_condition: + self._outstanding -= 1 + self._join_condition.notify_all() + + try: + self._executor.submit(tracked) + except RuntimeError: + with self._join_condition: + self._outstanding -= 1 + self._join_condition.notify_all() + raise + + def request_stop(self) -> None: + """Record an st.stop() from a worker. First writer wins.""" + with self._exception_lock: + if self._worker_exception is None: + self._worker_exception = StopException() + self._stop_event.set() + self.notify_yield_waiters() + + def request_rerun(self, exc: RerunException) -> None: + """Record an st.rerun(scope='app') from a worker. First writer wins.""" + with self._exception_lock: + if self._worker_exception is None: + self._worker_exception = exc + self._stop_event.set() + self.notify_yield_waiters() + + def should_stop(self) -> bool: + """Whether worker threads should cooperatively exit at their next + yield point. + """ + return self._stop_event.is_set() + + @property + def worker_exception(self) -> RerunException | StopException | None: + """The exception stored by the first worker to call request_stop() + or request_rerun(). + """ + with self._exception_lock: + return self._worker_exception + + def _raise_if_worker_exception(self) -> None: + """Re-raise the stored worker exception if one exists.""" + stored = self.worker_exception + if stored is not None: + raise stored + + def notify_yield_waiters(self) -> None: + """Wake the thread blocked in :meth:`join` so ``yield_check`` runs promptly. + + Called from workers (:meth:`request_stop` / :meth:`request_rerun`) and from + ``ScriptRunner`` when a rerun/stop request is enqueued from another thread + while the script thread is blocked inside :meth:`join`. + """ + with self._join_condition: + self._join_condition.notify_all() + + def join(self) -> None: + """Block until all outstanding work completes. + + Uses ``_join_condition`` so the script thread wakes immediately when a + worker finishes (via ``notify_all`` on ``_outstanding`` decrement) or when + :meth:`notify_yield_waiters` is called. Falls back to + ``poll_interval`` as a worst-case ceiling so ``yield_check()`` still runs + periodically even when ``_outstanding`` is unchanged (e.g. one slow + fragment still running). + + If a worker stored an exception, raises it instead of returning normally. + If join() raises (worker exception or yield-check exception), the + executor is left running and the caller is responsible for calling + drain() to shut down in-flight workers. + """ + while True: + with self._join_condition: + if self._outstanding == 0: + break + self._yield_check() + self._raise_if_worker_exception() + with self._join_condition: + if self._outstanding > 0: + self._join_condition.wait(timeout=self._poll_interval) + self._raise_if_worker_exception() + self._executor.shutdown(wait=False) + + def drain(self) -> None: + """Cleanup join after cancellation. + + Sets the stop event so workers at their next yield point exit, then + shuts down the executor synchronously, cancelling queued futures. + Does NOT call _yield_check — safe to call from except blocks + without risking recursive RerunException/StopException. + """ + self._stop_event.set() + self._executor.shutdown(wait=True, cancel_futures=True) diff --git a/venv/Lib/site-packages/streamlit/runtime/runtime.py b/venv/Lib/site-packages/streamlit/runtime/runtime.py new file mode 100644 index 0000000000000000000000000000000000000000..31597003e37a3e8a8166423387323032ef86bff3 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/runtime.py @@ -0,0 +1,788 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import asyncio +import sys +import time +import traceback +from dataclasses import dataclass, field +from enum import Enum +from typing import TYPE_CHECKING, Any, Final, NamedTuple + +from streamlit.components.lib.local_component_registry import LocalComponentRegistry +from streamlit.components.v2.component_manager import BidiComponentManager +from streamlit.logger import get_logger +from streamlit.proto.ForwardMsg_pb2 import ForwardMsg +from streamlit.runtime.app_session import AppSession +from streamlit.runtime.caching import ( + get_data_cache_stats_provider, + get_resource_cache_stats_provider, +) +from streamlit.runtime.caching.storage.local_disk_cache_storage import ( + LocalDiskCacheStorageManager, +) +from streamlit.runtime.media_file_manager import MediaFileManager +from streamlit.runtime.memory_session_storage import MemorySessionStorage +from streamlit.runtime.runtime_util import MESSAGE_FLUSH_INTERVAL_SECS +from streamlit.runtime.script_data import ScriptData +from streamlit.runtime.scriptrunner.script_cache import ScriptCache +from streamlit.runtime.session_manager import ( + ActiveSessionInfo, + SessionClient, + SessionClientDisconnectedError, + SessionManager, + SessionStorage, +) +from streamlit.runtime.state import ( + SCRIPT_RUN_WITHOUT_ERRORS_KEY, + SessionStateStatProvider, +) +from streamlit.runtime.stats import ( + StatsManager, + StatsProvider, +) +from streamlit.runtime.websocket_session_manager import WebsocketSessionManager + +if TYPE_CHECKING: + from collections.abc import Awaitable + + from streamlit.components.types.base_component_registry import BaseComponentRegistry + from streamlit.proto.BackMsg_pb2 import BackMsg + from streamlit.runtime.caching.storage import CacheStorageManager + from streamlit.runtime.media_file_storage import MediaFileStorage + from streamlit.runtime.scriptrunner_utils.script_run_context import ( + OnScriptErrorHandler, + UserInfoType, + ) + from streamlit.runtime.uploaded_file_manager import UploadedFileManager + +# Wait for the script run result for 60s and if no result is available give up +SCRIPT_RUN_CHECK_TIMEOUT: Final = 60 + +# On Windows, periodically check for signals when blocked in asyncio.wait() +# This ensures Ctrl+C can be processed even when no sessions are connected +_SIGNAL_CHECK_INTERVAL: Final = 0.5 if sys.platform == "win32" else None + +_LOGGER: Final = get_logger(__name__) + + +class RuntimeStoppedError(Exception): + """Raised by operations on a Runtime instance that is stopped.""" + + +@dataclass(frozen=True) +class RuntimeConfig: + """Config options for StreamlitRuntime.""" + + # The filesystem path of the Streamlit script to run. + script_path: str + + # The storage backend for Streamlit's MediaFileManager. + media_file_storage: MediaFileStorage + + # The upload file manager + uploaded_file_manager: UploadedFileManager + + # The cache storage backend for Streamlit's st.cache_data. + cache_storage_manager: CacheStorageManager = field( + default_factory=LocalDiskCacheStorageManager + ) + + # The ComponentRegistry instance to use. + component_registry: BaseComponentRegistry = field( + default_factory=LocalComponentRegistry + ) + + # The BidiComponentManager instance to use for v2 components. + bidi_component_registry: BidiComponentManager = field( + default_factory=BidiComponentManager + ) + + # The SessionManager class to be used. + session_manager_class: type[SessionManager] = WebsocketSessionManager + + # The SessionStorage instance for the SessionManager to use. + session_storage: SessionStorage = field(default_factory=MemorySessionStorage) + + # True if the command used to start Streamlit was `streamlit hello`. + is_hello: bool = False + + # Callback to invoke when an uncaught exception occurs in user script code. + on_script_error: OnScriptErrorHandler | None = None + + # TODO(vdonato): Eventually add a new fragment_storage_class field enabling the code + # creating a new Streamlit Runtime to configure the FragmentStorage instances + # created by each new AppSession. We choose not to do this for now to avoid adding + # additional complexity to RuntimeConfig/SessionManager/etc when it's unlikely + # we'll have a custom implementation of this class anytime soon. + + +class RuntimeState(Enum): + INITIAL = "INITIAL" + NO_SESSIONS_CONNECTED = "NO_SESSIONS_CONNECTED" + ONE_OR_MORE_SESSIONS_CONNECTED = "ONE_OR_MORE_SESSIONS_CONNECTED" + STOPPING = "STOPPING" + STOPPED = "STOPPED" + + +class AsyncObjects(NamedTuple): + """Container for all asyncio objects that Runtime manages. + These cannot be initialized until the Runtime's eventloop is assigned. + """ + + # The eventloop that Runtime is running on. + eventloop: asyncio.AbstractEventLoop + + # Set after Runtime.stop() is called. Never cleared. + must_stop: asyncio.Event + + # Set when a client connects; cleared when we have no connected clients. + has_connection: asyncio.Event + + # Set after a ForwardMsg is enqueued; cleared when we flush ForwardMsgs. + need_send_data: asyncio.Event + + # Completed when the Runtime has started. + started: asyncio.Future[None] + + # Completed when the Runtime has stopped. + stopped: asyncio.Future[None] + + +class Runtime: + _instance: Runtime | None = None + + @classmethod + def instance(cls) -> Runtime: + """Return the singleton Runtime instance. Raise an Error if the + Runtime hasn't been created yet. + """ + if cls._instance is None: + raise RuntimeError("Runtime hasn't been created!") + return cls._instance + + @classmethod + def exists(cls) -> bool: + """True if the singleton Runtime instance has been created. + + When a Streamlit app is running in "raw mode" - that is, when the + app is run via `python app.py` instead of `streamlit run app.py` - + the Runtime will not exist, and various Streamlit functions need + to adapt. + """ + return cls._instance is not None + + def __init__(self, config: RuntimeConfig) -> None: + """Create a Runtime instance. It won't be started yet. + + Runtime is *not* thread-safe. Its public methods are generally + safe to call only on the same thread that its event loop runs on. + + Parameters + ---------- + config + Config options. + """ + if Runtime._instance is not None: + raise RuntimeError("Runtime instance already exists!") + Runtime._instance = self + + # Will be created when we start. + self._async_objs: AsyncObjects | None = None + + # The task that runs our main loop. We need to save a reference + # to it so that it doesn't get garbage collected while running. + self._loop_coroutine_task: asyncio.Task[None] | None = None + + self._main_script_path = config.script_path + self._is_hello = config.is_hello + + self._state = RuntimeState.INITIAL + + # Initialize managers + self._component_registry = config.component_registry + self._bidi_component_registry = config.bidi_component_registry + self._uploaded_file_mgr = config.uploaded_file_manager + self._media_file_mgr = MediaFileManager(storage=config.media_file_storage) + self._cache_storage_manager = config.cache_storage_manager + self._script_cache = ScriptCache() + + # Discover and register components for CCv2 from installed packages + self._bidi_component_registry.discover_and_register_components() + + # Build kwargs, only including on_script_error when set to maintain + # backwards compatibility with custom SessionManager subclasses that + # may not accept this parameter yet. + session_mgr_kwargs: dict[str, Any] = { + "session_storage": config.session_storage, + "uploaded_file_manager": self._uploaded_file_mgr, + "script_cache": self._script_cache, + "message_enqueued_callback": self._enqueued_some_message, + } + if config.on_script_error is not None: + session_mgr_kwargs["on_script_error"] = config.on_script_error + + self._session_mgr = config.session_manager_class(**session_mgr_kwargs) + + self._stats_mgr = StatsManager() + self._stats_mgr.register_provider(get_data_cache_stats_provider()) + self._stats_mgr.register_provider(get_resource_cache_stats_provider()) + if self._uploaded_file_mgr is not None: + self._stats_mgr.register_provider(self._uploaded_file_mgr) + # Register media file storage for stats if it implements StatsProvider + if isinstance(config.media_file_storage, StatsProvider): + self._stats_mgr.register_provider(config.media_file_storage) + self._stats_mgr.register_provider(SessionStateStatProvider(self._session_mgr)) + + # Register session manager for session event metrics if it implements StatsProvider + if isinstance(self._session_mgr, StatsProvider): + self._stats_mgr.register_provider(self._session_mgr) + + @property + def state(self) -> RuntimeState: + return self._state + + @property + def component_registry(self) -> BaseComponentRegistry: + return self._component_registry + + @property + def bidi_component_registry(self) -> BidiComponentManager: + return self._bidi_component_registry + + @property + def uploaded_file_mgr(self) -> UploadedFileManager: + return self._uploaded_file_mgr + + @property + def cache_storage_manager(self) -> CacheStorageManager: + return self._cache_storage_manager + + @property + def media_file_mgr(self) -> MediaFileManager: + return self._media_file_mgr + + @property + def stats_mgr(self) -> StatsManager: + return self._stats_mgr + + @property + def stopped(self) -> Awaitable[None]: + """A Future that completes when the Runtime's run loop has exited.""" + return self._get_async_objs().stopped + + # NOTE: A few Runtime methods listed as threadsafe (get_client and + # is_active_session) currently rely on the implementation detail that + # WebsocketSessionManager's get_active_session_info and is_active_session methods + # happen to be threadsafe. This may change with future SessionManager implementations, + # at which point we'll need to formalize our thread safety rules for each + # SessionManager method. + def get_client(self, session_id: str) -> SessionClient | None: + """Get the SessionClient for the given session_id, or None + if no such session exists. + + Notes + ----- + Threading: SAFE. May be called on any thread. + """ + session_info = self._session_mgr.get_active_session_info(session_id) + if session_info is None: + return None + return session_info.client + + def clear_user_info_for_session(self, session_id: str) -> None: + """Clear the user_info for the given session_id. + + Notes + ----- + Threading: SAFE. May be called on any thread. + """ + session_info = self._session_mgr.get_session_info(session_id) + if session_info is not None: + session_info.session.clear_user_info() + + async def start(self) -> None: + """Start the runtime. This must be called only once, before + any other functions are called. + + When this coroutine returns, Streamlit is ready to accept new sessions. + + Notes + ----- + Threading: UNSAFE. Must be called on the eventloop thread. + """ + + # Create our AsyncObjects. We need to have a running eventloop to + # instantiate our various synchronization primitives. + async_objs = AsyncObjects( + eventloop=asyncio.get_running_loop(), + must_stop=asyncio.Event(), + has_connection=asyncio.Event(), + need_send_data=asyncio.Event(), + started=asyncio.Future(), + stopped=asyncio.Future(), + ) + self._async_objs = async_objs + + self._loop_coroutine_task = asyncio.create_task( + self._loop_coroutine(), name="Runtime.loop_coroutine" + ) + + await async_objs.started + + def stop(self) -> None: + """Request that Streamlit close all sessions and stop running. + Note that Streamlit won't stop running immediately. + + Notes + ----- + Threading: SAFE. May be called from any thread. + """ + + async_objs = self._get_async_objs() + + def stop_on_eventloop() -> None: + if self._state in {RuntimeState.STOPPING, RuntimeState.STOPPED}: + return + + _LOGGER.debug("Runtime stopping...") + self._set_state(RuntimeState.STOPPING) + async_objs.must_stop.set() + + async_objs.eventloop.call_soon_threadsafe(stop_on_eventloop) + + def is_active_session(self, session_id: str) -> bool: + """True if the session_id belongs to an active session. + + Notes + ----- + Threading: SAFE. May be called on any thread. + """ + return self._session_mgr.is_active_session(session_id) + + def connect_session( + self, + client: SessionClient, + user_info: UserInfoType, + existing_session_id: str | None = None, + session_id_override: str | None = None, + ) -> str: + """Create a new session (or connect to an existing one) and return its unique ID. + + Parameters + ---------- + client + A concrete SessionClient implementation for communicating with + the session's client. + user_info + A dict that contains information about the session's user. For now, + it only (optionally) contains the user's email address. + + { + "email": "example@example.com" + } + existing_session_id + The ID of an existing session to reconnect to. If one is not provided, a new + session is created. Note that whether the Runtime's SessionManager supports + reconnecting to an existing session depends on the SessionManager that this + runtime is configured with. + session_id_override + The ID to assign to a new session being created with this method. Setting + this can be useful when the service that a Streamlit Runtime is running in + wants to tie the lifecycle of a Streamlit session to some other session-like + object that it manages. Only one of existing_session_id and + session_id_override should be set. + + Returns + ------- + str + The session's unique string ID. + + Notes + ----- + Threading: UNSAFE. Must be called on the eventloop thread. + """ + if existing_session_id and session_id_override: # pragma: no cover - defensive + raise RuntimeError( + "Only one of existing_session_id and session_id_override should be set. " + "This should never happen." + ) + + if self._state in {RuntimeState.STOPPING, RuntimeState.STOPPED}: + raise RuntimeStoppedError(f"Can't connect_session (state={self._state})") + + session_id = self._session_mgr.connect_session( + client=client, + script_data=ScriptData(self._main_script_path, self._is_hello), + user_info=user_info, + existing_session_id=existing_session_id, + session_id_override=session_id_override, + ) + self._set_state(RuntimeState.ONE_OR_MORE_SESSIONS_CONNECTED) + self._get_async_objs().has_connection.set() + + return session_id + + def create_session( + self, + client: SessionClient, + user_info: UserInfoType, + existing_session_id: str | None = None, + session_id_override: str | None = None, + ) -> str: + """Create a new session (or connect to an existing one) and return its unique ID. + + Notes + ----- + This method is simply an alias for connect_session added for backwards + compatibility. + """ + _LOGGER.warning("create_session is deprecated! Use connect_session instead.") + return self.connect_session( + client=client, + user_info=user_info, + existing_session_id=existing_session_id, + session_id_override=session_id_override, + ) + + def close_session(self, session_id: str) -> None: + """Close and completely shut down a session. + + This differs from disconnect_session in that it always completely shuts down a + session, permanently losing any associated state (session state, uploaded files, + etc.). + + This function may be called multiple times for the same session, + which is not an error. (Subsequent calls just no-op.) + + Parameters + ---------- + session_id + The session's unique ID. + + Notes + ----- + Threading: UNSAFE. Must be called on the eventloop thread. + """ + session_info = self._session_mgr.get_session_info(session_id) + if session_info: + self._session_mgr.close_session(session_id) + self._on_session_disconnected() + + def disconnect_session(self, session_id: str) -> None: + """Disconnect a session. It will stop producing ForwardMsgs. + + Differs from close_session because disconnected sessions can be reconnected to + for a brief window (depending on the SessionManager/SessionStorage + implementations used by the runtime). + + This function may be called multiple times for the same session, + which is not an error. (Subsequent calls just no-op.) + + Parameters + ---------- + session_id + The session's unique ID. + + Notes + ----- + Threading: UNSAFE. Must be called on the eventloop thread. + """ + session_info = self._session_mgr.get_active_session_info(session_id) + if session_info: + self._session_mgr.disconnect_session(session_id) + self._on_session_disconnected() + + def handle_backmsg(self, session_id: str, msg: BackMsg) -> None: + """Send a BackMsg to an active session. + + Parameters + ---------- + session_id + The session's unique ID. + msg + The BackMsg to deliver to the session. + + Notes + ----- + Threading: UNSAFE. Must be called on the eventloop thread. + """ + if self._state in {RuntimeState.STOPPING, RuntimeState.STOPPED}: + raise RuntimeStoppedError(f"Can't handle_backmsg (state={self._state})") + + session_info = self._session_mgr.get_active_session_info(session_id) + if session_info is None: + _LOGGER.debug( + "Discarding BackMsg for disconnected session (id=%s)", session_id + ) + return + + session_info.session.handle_backmsg(msg) + + def handle_backmsg_deserialization_exception( + self, session_id: str, exc: BaseException + ) -> None: + """Handle an Exception raised during deserialization of a BackMsg. + + Parameters + ---------- + session_id + The session's unique ID. + exc + The Exception. + + Notes + ----- + Threading: UNSAFE. Must be called on the eventloop thread. + """ + if self._state in {RuntimeState.STOPPING, RuntimeState.STOPPED}: + raise RuntimeStoppedError( + f"Can't handle_backmsg_deserialization_exception (state={self._state})" + ) + + session_info = self._session_mgr.get_active_session_info(session_id) + if session_info is None: + _LOGGER.debug( + "Discarding BackMsg Exception for disconnected session (id=%s)", + session_id, + ) + return + + session_info.session.handle_backmsg_exception(exc) + + @property + async def is_ready_for_browser_connection(self) -> tuple[bool, str]: + if self._state not in { + RuntimeState.INITIAL, + RuntimeState.STOPPING, + RuntimeState.STOPPED, + }: + return True, "ok" + + return False, "unavailable" + + async def does_script_run_without_error(self) -> tuple[bool, str]: + """Load and execute the app's script to verify it runs without an error. + + Returns + ------- + (True, "ok") if the script completes without error, or (False, err_msg) + if the script raises an exception. + + Notes + ----- + Threading: UNSAFE. Must be called on the eventloop thread. + """ + # NOTE: We create an AppSession directly here instead of using the + # SessionManager intentionally. This isn't a "real" session and is only being + # used to test that the script runs without error. + session = AppSession( + script_data=ScriptData(self._main_script_path, self._is_hello), + uploaded_file_manager=self._uploaded_file_mgr, + script_cache=self._script_cache, + message_enqueued_callback=self._enqueued_some_message, + user_info={"email": "test@example.com"}, + ) + + try: + session.request_rerun(None) + + now = time.perf_counter() + while ( # noqa: ASYNC110 + SCRIPT_RUN_WITHOUT_ERRORS_KEY not in session.session_state + and (time.perf_counter() - now) < SCRIPT_RUN_CHECK_TIMEOUT + ): + await asyncio.sleep(0.1) + + if SCRIPT_RUN_WITHOUT_ERRORS_KEY not in session.session_state: + return False, "timeout" + + ok = session.session_state[SCRIPT_RUN_WITHOUT_ERRORS_KEY] + msg = "ok" if ok else "error" + + return ok, msg + finally: + session.shutdown() + + def _set_state(self, new_state: RuntimeState) -> None: + _LOGGER.debug("Runtime state: %s -> %s", self._state, new_state) + self._state = new_state + + async def _loop_coroutine(self) -> None: + """The main Runtime loop. + + This function won't exit until `stop` is called. + + Notes + ----- + Threading: UNSAFE. Must be called on the eventloop thread. + """ + + async_objs = self._get_async_objs() + + try: + if self._state == RuntimeState.INITIAL: + self._set_state(RuntimeState.NO_SESSIONS_CONNECTED) + elif self._state == RuntimeState.ONE_OR_MORE_SESSIONS_CONNECTED: + pass + else: + raise RuntimeError(f"Bad Runtime state at start: {self._state}") # noqa: TRY301 + + # Signal that we're started and ready to accept sessions + async_objs.started.set_result(None) + + while not async_objs.must_stop.is_set(): + if self._state == RuntimeState.NO_SESSIONS_CONNECTED: # type: ignore[comparison-overlap] + # mypy 1.4 incorrectly thinks this if-clause is unreachable, + # because it thinks self._state must be INITIAL | ONE_OR_MORE_SESSIONS_CONNECTED. + + # Wait for new websocket connections (new sessions): + done_tasks, pending_tasks = await asyncio.wait( # type: ignore[unreachable] + ( + asyncio.create_task(async_objs.must_stop.wait()), + asyncio.create_task(async_objs.has_connection.wait()), + ), + return_when=asyncio.FIRST_COMPLETED, + # On Windows, use a timeout to ensure signal handlers can be processed + timeout=_SIGNAL_CHECK_INTERVAL, + ) + # Clean up pending tasks to avoid memory leaks + for task in pending_tasks: + task.cancel() + + # If we timed out (Windows only), continue the loop to check must_stop + if not done_tasks and _SIGNAL_CHECK_INTERVAL is not None: + continue + elif self._state == RuntimeState.ONE_OR_MORE_SESSIONS_CONNECTED: + async_objs.need_send_data.clear() + + for active_session_info in self._session_mgr.list_active_sessions(): + msg_list = active_session_info.session.flush_browser_queue() + for msg in msg_list: + try: + self._send_message(active_session_info, msg) + except SessionClientDisconnectedError: + self._session_mgr.disconnect_session( + active_session_info.session.id + ) + + # Yield for a tick after sending a message. + await asyncio.sleep(0) + + # Yield briefly between session message flushing cycles. + await asyncio.sleep(MESSAGE_FLUSH_INTERVAL_SECS) + else: + # Break out of the thread loop if we encounter any other state. + break + + # Wait for new proto messages that need to be sent out: + done_tasks, pending_tasks = await asyncio.wait( + ( + asyncio.create_task(async_objs.must_stop.wait()), + asyncio.create_task(async_objs.need_send_data.wait()), + ), + return_when=asyncio.FIRST_COMPLETED, + # On Windows, use a timeout to ensure signal handlers can be processed + timeout=_SIGNAL_CHECK_INTERVAL, + ) + # We need to cancel the pending tasks (the `must_stop` one in most situations). + # Otherwise, this would stack up one waiting task per loop + # (e.g. per forward message). These tasks cannot be garbage collected + # causing an increase in memory (-> memory leak). + for task in pending_tasks: + task.cancel() + + # If we timed out (Windows only), continue to check must_stop + if not done_tasks and _SIGNAL_CHECK_INTERVAL is not None: + continue + + # Shut down all AppSessions. + for session_info in self._session_mgr.list_sessions(): + # NOTE: We want to fully shut down sessions when the runtime stops for + # now, but this may change in the future if/when our notion of a session + # is no longer so tightly coupled to a browser tab. + self._session_mgr.close_session(session_info.session.id) + + self._set_state(RuntimeState.STOPPED) + async_objs.stopped.set_result(None) + + except Exception as e: + async_objs.stopped.set_exception(e) + traceback.print_exc() + _LOGGER.info( + """ +Please report this bug at https://github.com/streamlit/streamlit/issues. +""" + ) + + def _send_message(self, session_info: ActiveSessionInfo, msg: ForwardMsg) -> None: + """Send a message to a client. + If the client is likely to have already cached the message, we may + instead send a "reference" message that contains only the hash of the + message. + + Parameters + ---------- + session_info : ActiveSessionInfo + The ActiveSessionInfo associated with websocket + msg : ForwardMsg + The message to send to the client + + Notes + ----- + Threading: UNSAFE. Must be called on the eventloop thread. + """ + + # If this was a `script_finished` message, we increment the + # script_run_count for this session + if msg.WhichOneof("type") == "script_finished" and ( + msg.script_finished == ForwardMsg.FINISHED_SUCCESSFULLY + ): + session_info.script_run_count += 1 + + # Ship it off! + session_info.client.write_forward_msg(msg) + + def _enqueued_some_message(self) -> None: + """Callback called by AppSession after the AppSession has enqueued a + message. Sets the "needs_send_data" event, which causes our core + loop to wake up and flush client message queues. + + Notes + ----- + Threading: SAFE. May be called on any thread. + """ + async_objs = self._get_async_objs() + async_objs.eventloop.call_soon_threadsafe(async_objs.need_send_data.set) + + def _get_async_objs(self) -> AsyncObjects: + """Return our AsyncObjects instance. If the Runtime hasn't been + started, this will raise an error. + """ + if self._async_objs is None: + raise RuntimeError("Runtime hasn't started yet!") + return self._async_objs + + def _on_session_disconnected(self) -> None: + """Set the runtime state to NO_SESSIONS_CONNECTED if the last active + session was disconnected. + """ + if ( + self._state == RuntimeState.ONE_OR_MORE_SESSIONS_CONNECTED + and self._session_mgr.num_active_sessions() == 0 + ): + self._get_async_objs().has_connection.clear() + self._set_state(RuntimeState.NO_SESSIONS_CONNECTED) diff --git a/venv/Lib/site-packages/streamlit/runtime/runtime_util.py b/venv/Lib/site-packages/streamlit/runtime/runtime_util.py new file mode 100644 index 0000000000000000000000000000000000000000..9fe7651f7bfed8e88395322bfeb0af4cb8cc1ba8 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/runtime_util.py @@ -0,0 +1,166 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +"""Runtime-related utility functions.""" + +from __future__ import annotations + +from logging import getLogger +from typing import TYPE_CHECKING, Any, Final, cast + +from streamlit import config +from streamlit.errors import MarkdownFormattedException, StreamlitAPIException + +if TYPE_CHECKING: + from streamlit.proto.ForwardMsg_pb2 import ForwardMsg + +_LOGGER: Final = getLogger(__name__) + +# The interval (in seconds) between message flush cycles in the runtime event loop. +# Also reused by callers that need to wait for outstanding messages to be delivered +# before requesting a rerun (e.g. `st.switch_page`). +# +# Message coalescing is implemented at the queue level (`_maybe_compose_delta_msgs`), +# but this interval is the window during which it can happen. A small non-zero value +# is important for single-element placeholders like `st.empty` and `st.skeleton`: +# when a placeholder is shown and then replaced within the same run, both deltas +# share a delta_path and coalesce into the final element, so the browser never +# renders the intermediate state. A too-small interval can flush the placeholder +# first and briefly unmount/remount the real element (e.g. flash a skeleton) on +# reruns. +MESSAGE_FLUSH_INTERVAL_SECS: Final[float] = 0.005 + + +class MessageSizeError(MarkdownFormattedException): + """Exception raised when a websocket message is larger than the configured limit.""" + + def __init__(self, failed_msg_str: Any) -> None: + msg = self._get_message(failed_msg_str) + super().__init__(msg) + + def _get_message(self, failed_msg_str: Any) -> str: + # This needs to have zero indentation otherwise the markdown will render incorrectly. + return ( + f""" +**Data of size {len(failed_msg_str) / 1e6:.1f} MB exceeds the message size limit of +{get_max_message_size_bytes() / 1e6} MB.** + +This is often caused by a large chart or dataframe. Please decrease the amount of data sent +to the browser, or increase the limit by setting the config option `server.maxMessageSize`. +[Click here to learn more about config options](https://docs.streamlit.io/develop/api-reference/configuration/config.toml). + +_Note that increasing the limit may lead to long loading times and large memory consumption +of the client's browser and the Streamlit server._ +""" + ).strip("\n") + + +class WidgetStateSizeError(MarkdownFormattedException): + """Exception raised when client-sent widget state is larger than the limit.""" + + def __init__(self, failed_msg_size: int) -> None: + msg = self._get_message(failed_msg_size) + super().__init__(msg) + + def _get_message(self, failed_msg_size: int) -> str: + # This needs to have zero indentation otherwise the markdown will render incorrectly. + return ( + f""" +**Widget state of size {failed_msg_size / 1e6:.1f} MB exceeds the widget state size limit of +{get_max_widget_state_size_bytes() / 1e6} MB.** + +This can happen when a widget or custom component sends a large value to Streamlit. +Please decrease the amount of data sent from the browser, or increase the limit by +setting the config option `server.maxWidgetStateSize`. +[Click here to learn more about config options](https://docs.streamlit.io/develop/api-reference/configuration/config.toml). + +_Note that increasing the limit may lead to long loading times and large memory consumption +of the Streamlit server._ +""" + ).strip("\n") + + +class BadDurationStringError(StreamlitAPIException): + """Raised when a bad duration argument string is passed.""" + + def __init__(self, duration: str) -> None: + MarkdownFormattedException.__init__( + self, + "TTL string doesn't look right. It should be formatted as" + f"`'1d2h34m'` or `2 days`, for example. Got: {duration}", + ) + + +def serialize_forward_msg(msg: ForwardMsg) -> bytes: + """Serialize a ForwardMsg to send to a client. + + If the message is too large, it will be converted to an exception message + instead. + """ + + msg_str = msg.SerializeToString() + + if len(msg_str) > get_max_message_size_bytes(): + # Overwrite the offending ForwardMsg.delta with an error to display. + # This assumes that the size limit wasn't exceeded due to metadata. + from streamlit.elements import exception + + msg_size_error = MessageSizeError(msg_str) + _LOGGER.warning( + "Websocket message size limit exceeded. Showing error to the user: %s", + msg_size_error, + ) + exception.marshall(msg.delta.new_element.exception, msg_size_error) + # Deactivate caching for this error message: + msg.metadata.cacheable = False + msg_str = msg.SerializeToString() + + return msg_str + + +# This needs to be initialized lazily to avoid calling config.get_option() and +# thus initializing config options when this file is first imported. +_max_message_size_bytes: int | None = None +_max_widget_state_size_bytes: int | None = None + + +def get_max_message_size_bytes() -> int: + """Returns the max websocket message size in bytes. + + This will lazyload the value from the config and store it in the global symbol table. + """ + global _max_message_size_bytes # noqa: PLW0603 + + if _max_message_size_bytes is None: + _max_message_size_bytes = config.get_option("server.maxMessageSize") * int(1e6) + + return cast("int", _max_message_size_bytes) + + +def get_max_widget_state_size_bytes() -> int: + """Returns the max client-sent message size in bytes. + + This limit is applied both to raw inbound WebSocket frames in the Starlette + handler and to the aggregate widget state protobuf in the runtime layer. + + This will lazyload the value from the config and store it in the global symbol table. + """ + global _max_widget_state_size_bytes # noqa: PLW0603 + + if _max_widget_state_size_bytes is None: + _max_widget_state_size_bytes = config.get_option( + "server.maxWidgetStateSize" + ) * int(1e6) + + return cast("int", _max_widget_state_size_bytes) diff --git a/venv/Lib/site-packages/streamlit/runtime/script_data.py b/venv/Lib/site-packages/streamlit/runtime/script_data.py new file mode 100644 index 0000000000000000000000000000000000000000..d6de8643738992274cf50e45cd1e221168c6dee8 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/script_data.py @@ -0,0 +1,46 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import os +from dataclasses import dataclass, field + + +@dataclass(frozen=True) +class ScriptData: + """Contains parameters related to running a script.""" + + main_script_path: str + is_hello: bool = False + script_folder: str = field(init=False) + name: str = field(init=False) + + def __post_init__(self) -> None: + """Set some computed values derived from main_script_path. + + The usage of object.__setattr__ is necessary because trying to set + self.script_folder or self.name normally, even within the __init__ method, will + explode since we declared this dataclass to be frozen. + + We do this in __post_init__ so that we can use the auto-generated __init__ + method that most dataclasses use. + """ + main_script_path = os.path.abspath(self.main_script_path) + script_folder = os.path.dirname(main_script_path) + object.__setattr__(self, "script_folder", script_folder) + + basename = os.path.basename(main_script_path) + name = str(os.path.splitext(basename)[0]) + object.__setattr__(self, "name", name) diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__init__.py b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7c41802a2642162f84c7213349a3860c4eac3b00 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__init__.py @@ -0,0 +1,38 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from streamlit.runtime.scriptrunner.script_runner import ScriptRunner, ScriptRunnerEvent +from streamlit.runtime.scriptrunner_utils.exceptions import ( + RerunException, + StopException, +) +from streamlit.runtime.scriptrunner_utils.script_requests import RerunData +from streamlit.runtime.scriptrunner_utils.script_run_context import ( + ScriptRunContext, + add_script_run_ctx, + enqueue_message, + get_script_run_ctx, +) + +__all__ = [ + "RerunData", + "RerunException", + "ScriptRunContext", + "ScriptRunner", + "ScriptRunnerEvent", + "StopException", + "add_script_run_ctx", + "enqueue_message", + "get_script_run_ctx", +] diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/__init__.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..554dd8d4818e78b92ee8275a7bebdd9fd4f511d9 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/__init__.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/exec_code.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/exec_code.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..00e1d00c64a99a2c787c7d49457cb1c3bb851474 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/exec_code.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/magic.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/magic.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82fc33c8c93f59b55f007f542303f23c7f810a68 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/magic.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/magic_funcs.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/magic_funcs.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1761b2212e53bd0396e00e1492f4c7f9696e76d5 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/magic_funcs.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/script_cache.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/script_cache.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..92e9b28f19bcd92bc855390d0dff394152d36d3e Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/script_cache.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/script_runner.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/script_runner.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5656069f460f47b42d293848df37ce287a0268b5 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/__pycache__/script_runner.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner/exec_code.py b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/exec_code.py new file mode 100644 index 0000000000000000000000000000000000000000..55441a30394e80d59de42d037b9eef83a637948b --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/exec_code.py @@ -0,0 +1,167 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import sys +from typing import TYPE_CHECKING, Any, Literal + +from streamlit import util +from streamlit.delta_generator_singletons import ( + context_dg_stack, + get_default_dg_stack_value, +) +from streamlit.error_util import handle_user_script_exception +from streamlit.errors import FragmentHandledException +from streamlit.runtime.scriptrunner_utils.exceptions import ( + RerunException, + StopException, +) + +if TYPE_CHECKING: + from collections.abc import Callable + from types import TracebackType + + from streamlit.runtime.scriptrunner_utils.script_requests import RerunData + from streamlit.runtime.scriptrunner_utils.script_run_context import ScriptRunContext + + +class modified_sys_path: # noqa: N801 + """A context for prepending a directory to sys.path for a second. + + Code inspired by IPython: + Source: https://github.com/ipython/ipython/blob/master/IPython/utils/syspathcontext.py#L42 + """ + + def __init__(self, main_script_path: str) -> None: + self._main_script_path = main_script_path + self._added_path = False + + def __repr__(self) -> str: + return util.repr_(self) + + def __enter__(self) -> None: + if self._main_script_path not in sys.path: + sys.path.insert(0, self._main_script_path) + self._added_path = True + + def __exit__( + self, + typ: type[BaseException] | None, + exc: BaseException | None, + tb: TracebackType | None, + ) -> Literal[False]: + if self._added_path: + try: + sys.path.remove(self._main_script_path) + except ValueError: + # It's already removed. + pass + + # Returning False causes any exceptions to be re-raised. + return False + + +def exec_func_with_error_handling( + func: Callable[[], Any], ctx: ScriptRunContext +) -> tuple[ + Any | None, + bool, + RerunData | None, + bool, + Exception | None, +]: + """Execute the passed function wrapped in a try/except block. + + This function is called by the script runner to execute the user's script or + fragment reruns, but also for the execution of fragment code in context of a normal + app run. This wrapper ensures that handle_uncaught_exception messages show up in the + correct context. + + Parameters + ---------- + func : callable + The function to execute wrapped in the try/except block. + ctx : ScriptRunContext + The context in which the script is being run. + + Returns + ------- + tuple + A tuple containing: + - The result of the passed function. + - A boolean indicating whether the script ran without errors (RerunException and + StopException don't count as errors). + - The RerunData instance belonging to a RerunException if the script was + interrupted by a RerunException. + - A boolean indicating whether the script was stopped prematurely (False for + RerunExceptions, True for all other exceptions). + - The uncaught exception if one occurred, None otherwise + """ + run_without_errors = True + + # This will be set to a RerunData instance if our execution + # is interrupted by a RerunException. + rerun_exception_data: RerunData | None = None + + # If the script stops early, we don't want to remove unseen widgets, + # so we track this to potentially skip session state cleanup later. + premature_stop: bool = False + + # The result of the passed function + result: Any | None = None + + # The uncaught exception if one occurred, None otherwise + uncaught_exception: Exception | None = None + + try: + result = func() + except RerunException as e: + rerun_exception_data = e.rerun_data + + # Since the script is about to rerun, we may need to reset our cursors/dg_stack + # so that we write to the right place in the app. For full script runs, this + # needs to happen in case the same thread reruns our script (a different thread + # would automatically come with fresh cursors/dg_stack values). For fragments, + # it doesn't matter either way since the fragment resets these values from its + # snapshot before execution. + ctx.cursors.clear() + context_dg_stack.set(get_default_dg_stack_value()) + + # Interruption due to a rerun is usually from `st.rerun()`, which + # we want to count as a script completion so triggers reset. + # It is also possible for this to happen if fast reruns is off, + # but this is very rare. + premature_stop = False + + except StopException: + # This is thrown when the script executes `st.stop()`. + # We don't have to do anything here. + premature_stop = True + except FragmentHandledException: + run_without_errors = False + premature_stop = True + except Exception as ex: + run_without_errors = False + premature_stop = True + uncaught_exception = ex + handle_user_script_exception(ex, ctx.on_script_error) + + return ( + result, + run_without_errors, + rerun_exception_data, + premature_stop, + uncaught_exception, + ) diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner/magic.py b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/magic.py new file mode 100644 index 0000000000000000000000000000000000000000..706e631b387281dbcc0f3c0c042eeba4af4e18c3 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/magic.py @@ -0,0 +1,277 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import ast +import sys +from typing import Any, Final + +from streamlit import config + +# When a Streamlit app is magicified, we insert a `magic_funcs` import near the top of +# its module's AST: import streamlit.runtime.scriptrunner.magic_funcs as __streamlitmagic__ +MAGIC_MODULE_NAME: Final = "__streamlitmagic__" + + +def add_magic(code: str, script_path: str) -> Any: + """Modifies the code to support magic Streamlit commands. + + Parameters + ---------- + code : str + The Python code. + script_path : str + The path to the script file. + + Returns + ------- + ast.Module + The syntax tree for the code. + + """ + # Pass script_path so we get pretty exceptions. + tree = ast.parse(code, script_path, "exec") + + file_ends_in_semicolon = _does_file_end_in_semicolon(tree, code) + + _modify_ast_subtree( + tree, is_root=True, file_ends_in_semicolon=file_ends_in_semicolon + ) + + return tree + + +def _modify_ast_subtree( + tree: Any, + body_attr: str = "body", + is_root: bool = False, + file_ends_in_semicolon: bool = False, +) -> None: + """Parses magic commands and modifies the given AST (sub)tree.""" + + body = getattr(tree, body_attr) + + for i, node in enumerate(body): + node_type = type(node) + + # Recursively parses the content of the statements + # `with` as well as function definitions. + # Also covers their async counterparts + if ( + node_type is ast.FunctionDef + or node_type is ast.With + or node_type is ast.AsyncFunctionDef + or node_type is ast.AsyncWith + ): + _modify_ast_subtree(node) + + # Recursively parses the content of the statements + # `for` and `while`. + # Also covers their async counterparts + elif ( + node_type is ast.For or node_type is ast.While or node_type is ast.AsyncFor + ): + _modify_ast_subtree(node) + _modify_ast_subtree(node, "orelse") + + # Recursively parses methods in a class. + elif node_type is ast.ClassDef: + for inner_node in node.body: + if type(inner_node) in {ast.FunctionDef, ast.AsyncFunctionDef}: + _modify_ast_subtree(inner_node) + + # Recursively parses the contents of try statements, + # all their handlers (except and else) and the finally body + elif node_type is ast.Try or ( + sys.version_info >= (3, 11) and node_type is ast.TryStar + ): + _modify_ast_subtree(node) + _modify_ast_subtree(node, body_attr="finalbody") + _modify_ast_subtree(node, body_attr="orelse") + for handler_node in node.handlers: + _modify_ast_subtree(handler_node) + + # Recursively parses if blocks, as well as their else/elif blocks + # (else/elif are both mapped to orelse) + # it intentionally does not parse the test expression. + elif node_type is ast.If: + _modify_ast_subtree(node) + _modify_ast_subtree(node, "orelse") + + elif sys.version_info >= (3, 10) and node_type is ast.Match: + for case_node in node.cases: + _modify_ast_subtree(case_node) + + # Convert standalone expression nodes to st.write + elif node_type is ast.Expr: + value = _get_st_write_from_expr( + node, + i, + parent_type=type(tree), + is_root=is_root, + is_last_expr=(i == len(body) - 1), + file_ends_in_semicolon=file_ends_in_semicolon, + ) + if value is not None: + node.value = value + + if is_root: + # Import Streamlit so we can use it in the new_value above. + _insert_import_statement(tree) + + ast.fix_missing_locations(tree) + + +def _insert_import_statement(tree: Any) -> None: + """Insert Streamlit import statement at the top(ish) of the tree.""" + + st_import = _build_st_import_statement() + + # If the 0th node is already an import statement, put the Streamlit + # import below that, so we don't break "from __future__ import". + if tree.body and type(tree.body[0]) in {ast.ImportFrom, ast.Import}: + tree.body.insert(1, st_import) + + # If the 0th node is a docstring and the 1st is an import statement, + # put the Streamlit import below those, so we don't break "from + # __future__ import". + elif ( + len(tree.body) > 1 + and ( + type(tree.body[0]) is ast.Expr + and _is_string_constant_node(tree.body[0].value) + ) + and type(tree.body[1]) in {ast.ImportFrom, ast.Import} + ): + tree.body.insert(2, st_import) + + else: + tree.body.insert(0, st_import) + + +def _build_st_import_statement() -> ast.Import: + """Build AST node for `import magic_funcs as __streamlitmagic__`.""" + return ast.Import( + names=[ + ast.alias( + name="streamlit.runtime.scriptrunner.magic_funcs", + asname=MAGIC_MODULE_NAME, + ) + ] + ) + + +def _build_st_write_call(nodes: list[Any]) -> ast.Call: + """Build AST node for `__streamlitmagic__.transparent_write(*nodes)`.""" + return ast.Call( + func=ast.Attribute( + attr="transparent_write", + value=ast.Name(id=MAGIC_MODULE_NAME, ctx=ast.Load()), + ctx=ast.Load(), + ), + args=nodes, + keywords=[], + ) + + +def _get_st_write_from_expr( + node: Any, + i: int, + parent_type: Any, + is_root: bool, + is_last_expr: bool, + file_ends_in_semicolon: bool, +) -> ast.Call | None: + # Don't wrap function calls + # (Unless the function call happened at the end of the root node, AND + # magic.displayLastExprIfNoSemicolon is True. This allows us to support notebook-like + # behavior, where we display the last function in a cell) + if type(node.value) is ast.Call and not _is_displayable_last_expr( + is_root, is_last_expr, file_ends_in_semicolon + ): + return None + + # Don't wrap DocString nodes + # (Unless magic.displayRootDocString, in which case we do wrap the root-level + # docstring with st.write. This allows us to support notebook-like behavior + # where you can have a cell with a markdown string) + if _is_docstring_node( + node.value, i, parent_type + ) and not _should_display_docstring_like_node_anyway(is_root): + return None + + # Don't wrap yield nodes + if type(node.value) is ast.Yield or type(node.value) is ast.YieldFrom: + return None + + # Don't wrap await nodes + if type(node.value) is ast.Await: + return None + + # If tuple, call st.write(*the_tuple). This allows us to add a comma at the end of a + # statement to turn it into an expression that should be + # st-written. Ex: "np.random.randn(1000, 2)," + args = node.value.elts if type(node.value) is ast.Tuple else [node.value] + return _build_st_write_call(args) + + +def _is_string_constant_node(node: Any) -> bool: + return isinstance(node, ast.Constant) and isinstance(node.value, str) + + +def _is_docstring_node(node: Any, node_index: int, parent_type: Any) -> bool: + return ( + node_index == 0 + and _is_string_constant_node(node) + and parent_type in {ast.FunctionDef, ast.AsyncFunctionDef, ast.Module} + ) + + +def _does_file_end_in_semicolon(tree: Any, code: str) -> bool: + file_ends_in_semicolon = False + + # Avoid spending time with this operation if magic.displayLastExprIfNoSemicolon is + # not set. + if config.get_option("magic.displayLastExprIfNoSemicolon"): + if len(tree.body) == 0: + return False + + last_line_num = getattr(tree.body[-1], "end_lineno", None) + + if last_line_num is not None: + last_line_str: str = code.split("\n")[last_line_num - 1] + file_ends_in_semicolon = last_line_str.strip(" ").endswith(";") + + return file_ends_in_semicolon + + +def _is_displayable_last_expr( + is_root: bool, is_last_expr: bool, file_ends_in_semicolon: bool +) -> bool: + return ( + # This is a "displayable last expression" if... + # ...it's actually the last expression... + is_last_expr + # ...in the root scope... + and is_root + # ...it does not end in a semicolon... + and not file_ends_in_semicolon + # ...and this config option is telling us to show it + and config.get_option("magic.displayLastExprIfNoSemicolon") + ) + + +def _should_display_docstring_like_node_anyway(is_root: bool) -> bool: + return config.get_option("magic.displayRootDocString") and is_root diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner/magic_funcs.py b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/magic_funcs.py new file mode 100644 index 0000000000000000000000000000000000000000..d9c6db5707eead654d95ad6c9e9fd60fa018cd81 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/magic_funcs.py @@ -0,0 +1,32 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +from typing import Any + +from streamlit.runtime.metrics_util import gather_metrics + + +@gather_metrics("magic") +def transparent_write(*args: Any) -> Any: + """The function that gets magic-ified into Streamlit apps. + This is just st.write, but returns the arguments you passed to it. + """ + import streamlit as st + + st.write(*args) + if len(args) == 1: + return args[0] + return args diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner/script_cache.py b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/script_cache.py new file mode 100644 index 0000000000000000000000000000000000000000..29c7279e4052e6d1a8ea5e9688de0cb2d201fc1f --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/script_cache.py @@ -0,0 +1,89 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import os.path +import threading +from typing import Any + +from streamlit import config +from streamlit.runtime.scriptrunner import magic +from streamlit.source_util import open_python_file + + +class ScriptCache: + """Thread-safe cache of Python script bytecode.""" + + def __init__(self) -> None: + # Mapping of script_path: bytecode + self._cache: dict[str, Any] = {} + self._lock = threading.Lock() + + def clear(self) -> None: + """Remove all entries from the cache. + + Notes + ----- + Threading: SAFE. May be called on any thread. + """ + with self._lock: + self._cache.clear() + + def get_bytecode(self, script_path: str) -> Any: + """Return the bytecode for the Python script at the given path. + + If the bytecode is not already in the cache, the script will be + compiled first. + + Raises + ------ + Any Exception raised while reading or compiling the script. + + Notes + ----- + Threading: SAFE. May be called on any thread. + """ + + script_path = os.path.abspath(script_path) + + with self._lock: + bytecode = self._cache.get(script_path, None) + if bytecode is not None: + # Fast path: the code is already cached. + return bytecode + + # Populate the cache + with open_python_file(script_path) as f: + filebody = f.read() + + if config.get_option("runner.magicEnabled"): + filebody = magic.add_magic(filebody, script_path) + + bytecode = compile( # type: ignore + filebody, + # Pass in the file path so it can show up in exceptions. + script_path, + # We're compiling entire blocks of Python, so we need "exec" + # mode (as opposed to "eval" or "single"). + mode="exec", + # Don't inherit any flags or "future" statements. + flags=0, + dont_inherit=1, + # Use the default optimization options. + optimize=-1, + ) + + self._cache[script_path] = bytecode + return bytecode diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner/script_runner.py b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/script_runner.py new file mode 100644 index 0000000000000000000000000000000000000000..cef1e0713c4b11859f2adcb09cc3ebe7975cd392 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/scriptrunner/script_runner.py @@ -0,0 +1,937 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import gc +import sys +import threading +import types +from contextlib import contextmanager +from enum import Enum +from timeit import default_timer as timer +from typing import TYPE_CHECKING, Any, Final, Literal, cast + +from blinker import Signal + +from streamlit import config, runtime, util +from streamlit.errors import FragmentStorageKeyError +from streamlit.logger import get_logger +from streamlit.proto.ClientState_pb2 import ClientState +from streamlit.proto.ForwardMsg_pb2 import ForwardMsg +from streamlit.runtime.metrics_util import ( + create_page_profile_message, + to_microseconds, +) +from streamlit.runtime.pages_manager import PagesManager +from streamlit.runtime.scriptrunner.exec_code import ( + exec_func_with_error_handling, + modified_sys_path, +) +from streamlit.runtime.scriptrunner_utils.exceptions import ( + RerunException, + StopException, +) +from streamlit.runtime.scriptrunner_utils.script_requests import ( + RerunData, + ScriptRequests, + ScriptRequestType, +) +from streamlit.runtime.scriptrunner_utils.script_run_context import ( + ScriptRunContext, + UserInfoType, + add_script_run_ctx, + get_script_run_ctx, +) +from streamlit.runtime.state import ( + SCRIPT_RUN_WITHOUT_ERRORS_KEY, + SafeSessionState, + SessionState, +) +from streamlit.source_util import page_sort_key + +if TYPE_CHECKING: + from collections.abc import Callable, Generator + + from streamlit.runtime.fragment import FragmentStorage + from streamlit.runtime.parallel_coordinator import ParallelFragmentCoordinator + from streamlit.runtime.scriptrunner.script_cache import ScriptCache + from streamlit.runtime.scriptrunner_utils.script_run_context import ( + OnScriptErrorHandler, + ) + from streamlit.runtime.uploaded_file_manager import UploadedFileManager + from streamlit.watcher.local_sources_watcher import LocalSourcesWatcher + +_LOGGER: Final = get_logger(__name__) + + +class ScriptRunnerEvent(Enum): + # "Control" events. These are emitted when the ScriptRunner's state changes. + + # The script started running. + SCRIPT_STARTED = "SCRIPT_STARTED" + + # The script run stopped because of a compile error. + SCRIPT_STOPPED_WITH_COMPILE_ERROR = "SCRIPT_STOPPED_WITH_COMPILE_ERROR" + + # The script run stopped because it ran to completion, or was + # interrupted by the user. + SCRIPT_STOPPED_WITH_SUCCESS = "SCRIPT_STOPPED_WITH_SUCCESS" + + # The script run stopped in order to start a script run with newer widget state. + SCRIPT_STOPPED_FOR_RERUN = "SCRIPT_STOPPED_FOR_RERUN" + + # The script run corresponding to a fragment ran to completion, or was interrupted + # by the user. + FRAGMENT_STOPPED_WITH_SUCCESS = "FRAGMENT_STOPPED_WITH_SUCCESS" + + # The ScriptRunner is done processing the ScriptEventQueue and + # is shut down. + SHUTDOWN = "SHUTDOWN" + + # "Data" events. These are emitted when the ScriptRunner's script has + # data to send to the frontend. + + # The script has a ForwardMsg to send to the frontend. + ENQUEUE_FORWARD_MSG = "ENQUEUE_FORWARD_MSG" + + +""" +Note [Threading] +There are two kinds of threads in Streamlit, the main thread and script threads. +The main thread is started by invoking the Streamlit CLI, and bootstraps the +framework and runs the Uvicorn webserver. +A script thread is created by a ScriptRunner when it starts. The script thread +is where the ScriptRunner executes, including running the user script itself, +processing messages to/from the frontend, and all the Streamlit library function +calls in the user script. +It is possible for the user script to spawn its own threads, which could call +Streamlit functions. We restrict the ScriptRunner's execution control to the +script thread. Calling Streamlit functions from other threads is unlikely to +work correctly due to lack of ScriptRunContext, so we may add a guard against +it in the future. +""" + + +# For projects that have a pages folder, we assume that this is a script that +# is designed to leverage our original v1 version of multi-page apps. This +# function will be called to run the script in lieu of the main script. This +# function simulates the v1 setup using the modern v2 commands (st.navigation) +def _mpa_v1(main_script_path: str) -> None: + from pathlib import Path + + from streamlit.commands.navigation import PageType, _navigation + from streamlit.navigation.page import StreamlitPage + + # Select the folder that should be used for the pages: + resolved_main_script_path: Final = Path(main_script_path).resolve() + pages_folder: Final = resolved_main_script_path.parent / "pages" + + # Read out the my_pages folder and create a page for every script: + pages = sorted( + [ + page + for page in pages_folder.glob("*.py") + if page.name.endswith(".py") + and not page.name.startswith(".") + and page.name != "__init__.py" + ], + key=page_sort_key, + ) + + # Use this script as the main page and + main_page = StreamlitPage(resolved_main_script_path, default=True) + all_pages = [main_page] + [ + StreamlitPage(pages_folder / page.name) for page in pages + ] + # Initialize the navigation with all the pages: + position: Literal["sidebar", "hidden", "top"] = ( + "hidden" + if config.get_option("client.showSidebarNavigation") is False + else "sidebar" + ) + page = _navigation( + cast("list[PageType]", all_pages), + position=position, + expanded=False, + ) + + page.run() + + +class ScriptRunner: + def __init__( + self, + session_id: str, + main_script_path: str, + session_state: SessionState, + uploaded_file_mgr: UploadedFileManager, + script_cache: ScriptCache, + initial_rerun_data: RerunData, + user_info: UserInfoType, + fragment_storage: FragmentStorage, + pages_manager: PagesManager, + on_script_error: OnScriptErrorHandler | None = None, + local_sources_watcher: LocalSourcesWatcher | None = None, + ) -> None: + """Initialize the ScriptRunner. + + (The ScriptRunner won't start executing until start() is called.) + + Parameters + ---------- + session_id + The AppSession's id. + + main_script_path + Path to our main app script. + + session_state + The AppSession's SessionState instance. + + uploaded_file_mgr + The File manager to store the data uploaded by the file_uploader widget. + + script_cache + A ScriptCache instance. + + initial_rerun_data + RerunData to initialize this ScriptRunner with. + + user_info + A dict that contains information about the current user. For now, + it only contains the user's email address. + + { + "email": "example@example.com" + } + + Information about the current user is optionally provided when a + websocket connection is initialized via the "X-Streamlit-User" header. + + fragment_storage + The AppSession's FragmentStorage instance. + + on_script_error + Callback to invoke when an uncaught exception occurs in user script code. + Returns True to suppress the default exception display, or False/None + to show the exception normally. + + local_sources_watcher + The session's file watcher, if any. Its ``on_script_run`` hook is + called at the start of each script run (on the script thread) + before any user code executes. + """ + self._session_id = session_id + self._main_script_path = main_script_path + self._session_state = SafeSessionState( + session_state, yield_callback=self._maybe_handle_execution_control_request + ) + self._uploaded_file_mgr = uploaded_file_mgr + self._script_cache = script_cache + self._user_info = user_info + self._fragment_storage = fragment_storage + self._on_script_error = on_script_error + + self._pages_manager = pages_manager + self._local_sources_watcher = local_sources_watcher + self._requests = ScriptRequests() + self._requests.request_rerun(initial_rerun_data) + + self.on_event = Signal( + doc="""Emitted when a ScriptRunnerEvent occurs. + + This signal is generally emitted on the ScriptRunner's script + thread (which is *not* the same thread that the ScriptRunner was + created on). + + Parameters + ---------- + sender: ScriptRunner + The sender of the event (this ScriptRunner). + + event : ScriptRunnerEvent + + forward_msg : ForwardMsg | None + The ForwardMsg to send to the frontend. Set only for the + ENQUEUE_FORWARD_MSG event. + + exception : BaseException | None + Our compile error. Set only for the + SCRIPT_STOPPED_WITH_COMPILE_ERROR event. + + widget_states : streamlit.proto.WidgetStates_pb2.WidgetStates | None + The ScriptRunner's final WidgetStates. Set only for the + SHUTDOWN event. + """ + ) + + # Set to true while we're executing. Used by + # _maybe_handle_execution_control_request. + self._execing = False + + # This is initialized in the start() method + self._script_thread: threading.Thread | None = None + + # Coordinator blocking the script thread in join(); other threads poke + # notify_yield_waiters() when rerun/stop is enqueued during that window. + # Lock-protected so this is safe under free-threaded Python (PEP 703). + self._join_wake_lock = threading.Lock() + self._join_wake_coordinator: ParallelFragmentCoordinator | None = None + + def __repr__(self) -> str: + return util.repr_(self) + + def request_stop(self) -> None: + """Request that the ScriptRunner stop running its script and + shut down. The ScriptRunner will handle this request when it reaches + an interrupt point. + + Safe to call from any thread. + """ + self._requests.request_stop() + self._wake_parallel_join_barrier_if_waiting() + + def request_rerun(self, rerun_data: RerunData) -> bool: + """Request that the ScriptRunner interrupt its currently-running + script and restart it. + + If the ScriptRunner has been stopped, this request can't be honored: + return False. + + Otherwise, record the request and return True. The ScriptRunner will + handle the rerun request as soon as it reaches an interrupt point. + + Safe to call from any thread. + """ + rv = self._requests.request_rerun(rerun_data) + self._wake_parallel_join_barrier_if_waiting() + return rv + + def _wake_parallel_join_barrier_if_waiting(self) -> None: + """If the script thread is blocked in ParallelFragmentCoordinator.join(), wake it. + + Rerun/stop requests can arrive on other threads; join() sleeps on a + Condition bounded by poll_interval unless notified. + """ + with self._join_wake_lock: + coord = self._join_wake_coordinator + if coord is not None: + coord.notify_yield_waiters() + + def start(self) -> None: + """Start a new thread to process the ScriptEventQueue. + + This must be called only once. + + """ + if self._script_thread is not None: + raise RuntimeError("ScriptRunner was already started") + + self._script_thread = threading.Thread( + target=self._run_script_thread, + name="ScriptRunner.scriptThread", + ) + self._script_thread.start() + + def _get_script_run_ctx(self) -> ScriptRunContext: + """Get the ScriptRunContext for the current thread. + + Returns + ------- + ScriptRunContext + The ScriptRunContext for the current thread. + + Raises + ------ + AssertionError + If called outside of a ScriptRunner thread. + RuntimeError + If there is no ScriptRunContext for the current thread. + + """ + if not self._is_in_script_thread(): + raise RuntimeError( + "ScriptRunner._get_script_run_ctx must be called from the script thread." + ) + + ctx = get_script_run_ctx() + if ctx is None: + # This should never be possible on the script_runner thread. + raise RuntimeError( + "ScriptRunner thread has a null ScriptRunContext. " + "Something has gone very wrong!" + ) + return ctx + + def _run_script_thread(self) -> None: + """The entry point for the script thread. + + Processes the ScriptRequestQueue, which will at least contain the RERUN + request that will trigger the first script-run. + + When the ScriptRequestQueue is empty, or when a SHUTDOWN request is + dequeued, this function will exit and its thread will terminate. + """ + if not self._is_in_script_thread(): + raise RuntimeError( + "ScriptRunner._run_script_thread must be called from the script thread." + ) + + _LOGGER.debug("Beginning script thread") + + # Create and attach the thread's ScriptRunContext + ctx = ScriptRunContext( + session_id=self._session_id, + _enqueue=self._enqueue_forward_msg, + script_requests=self._requests, + query_string="", + session_state=self._session_state, + uploaded_file_mgr=self._uploaded_file_mgr, + main_script_path=self._main_script_path, + user_info=self._user_info, + gather_usage_stats=bool(config.get_option("browser.gatherUsageStats")), + fragment_storage=self._fragment_storage, + pages_manager=self._pages_manager, + context_info=None, + on_script_error=self._on_script_error, + ) + add_script_run_ctx(threading.current_thread(), ctx) + + request = self._requests.on_scriptrunner_ready() + while request.type == ScriptRequestType.RERUN: + # When the script thread starts, we'll have a pending rerun + # request that we'll handle immediately. When the script finishes, + # it's possible that another request has come in that we need to + # handle, which is why we call _run_script in a loop. + self._run_script(request.rerun_data) + request = self._requests.on_scriptrunner_ready() + + if request.type != ScriptRequestType.STOP: # pragma: no cover - defensive + raise RuntimeError( + f"Unrecognized ScriptRequestType: {request.type}. This should never happen." + ) + + # Send a SHUTDOWN event before exiting, so some state can be saved + # for use in a future script run when not triggered by the client. + client_state = ClientState() + client_state.query_string = ctx.query_string + client_state.page_script_hash = ctx.page_script_hash + if ctx.context_info: + client_state.context_info.CopyFrom(ctx.context_info) + self.on_event.send( + self, event=ScriptRunnerEvent.SHUTDOWN, client_state=client_state + ) + + def _is_in_script_thread(self) -> bool: + """True if the calling function is running in the script thread.""" + return self._script_thread == threading.current_thread() + + def _enqueue_forward_msg(self, msg: ForwardMsg) -> None: + """Enqueue a ForwardMsg to our browser queue. + This private function is called by ScriptRunContext only. + + It may be called from the script thread OR the main thread. + """ + # Whenever we enqueue a ForwardMsg, we also handle any pending + # execution control request. This means that a script can be + # cleanly interrupted and stopped inside most `st.foo` calls. + self._maybe_handle_execution_control_request() + + # Pass the message to our associated AppSession. + self.on_event.send( + self, event=ScriptRunnerEvent.ENQUEUE_FORWARD_MSG, forward_msg=msg + ) + + def _maybe_handle_execution_control_request(self) -> None: + """Check our current ScriptRequestState to see if we have a + pending STOP or RERUN request. + + This function is called every time the app script enqueues a + ForwardMsg, which means that most `st.foo` commands - which generally + involve sending a ForwardMsg to the frontend - act as implicit + yield points in the script's execution. + """ + if not self._is_in_script_thread(): + # We can only handle execution_control_request if we're on the + # script execution thread. However, this function also runs from + # parallel fragment worker threads, since deltas enqueued there + # flow through _enqueue_forward_msg. On a worker thread we can't + # service script-level rerun/stop requests, but we do check the + # coordinator so a cooperatively-cancelled worker raises at its + # next yield point. + ctx = get_script_run_ctx(suppress_warning=True) + if ( + ctx is not None + and ctx.parallel_coordinator is not None + and ctx.parallel_coordinator.should_stop() + ): + raise StopException() + return + + if not self._execing: + # If the _execing flag is not set, we're not actually inside + # an exec() call. This happens when our script exec() completes, + # we change our state to STOPPED, and a statechange-listener + # enqueues a new ForwardEvent + return + + # Re-raise any worker-stored exception before consulting _requests. + # Worker-initiated cancellation takes precedence because it + # captured user intent in-band. + ctx = get_script_run_ctx(suppress_warning=True) + if ctx is not None and ctx.parallel_coordinator is not None: + worker_exc = ctx.parallel_coordinator.worker_exception + if worker_exc is not None: + raise worker_exc + + request = self._requests.on_scriptrunner_yield() + if request is None: + # No RERUN or STOP request. + return + + if request.type == ScriptRequestType.RERUN: + raise RerunException(request.rerun_data) + + if request.type != ScriptRequestType.STOP: # pragma: no cover - defensive + raise RuntimeError( + f"Unrecognized ScriptRequestType: {request.type}. This should never happen." + ) + raise StopException() + + @contextmanager + def _set_execing_flag(self) -> Generator[None, None, None]: + """A context for setting the ScriptRunner._execing flag. + + Used by _maybe_handle_execution_control_request to ensure that + we only handle requests while we're inside an exec() call + """ + if self._execing: + raise RuntimeError("Nested set_execing_flag call") + self._execing = True + try: + yield + finally: + self._execing = False + + def _run_script(self, rerun_data: RerunData) -> None: + """Run our script. + + Parameters + ---------- + rerun_data: RerunData + The RerunData to use. + + """ + + if not self._is_in_script_thread(): + raise RuntimeError( + "ScriptRunner._run_script must be called from the script thread." + ) + + # An explicit loop instead of recursion to avoid stack overflows + while True: + if self._local_sources_watcher is not None: + self._local_sources_watcher.on_script_run() + + _LOGGER.debug("Running script") + start_time: float = timer() + prep_time: float = 0 # This will be overwritten once preparations are done. + + if not rerun_data.fragment_id_queue: + # Don't clear session refs for media files if we're running a fragment. + # Otherwise, we're likely to remove files that still have corresponding + # download buttons/links to them present in the app, which will result + # in a 404 should the user click on them. + runtime.get_instance().media_file_mgr.clear_session_refs() + + self._pages_manager.set_script_intent( + rerun_data.page_script_hash, rerun_data.page_name + ) + active_script = self._pages_manager.get_initial_active_script( + rerun_data.page_script_hash + ) + main_page_info = self._pages_manager.get_main_page() + + page_script_hash = ( + active_script["page_script_hash"] + if active_script is not None + else main_page_info["page_script_hash"] + ) + + ctx = self._get_script_run_ctx() + # Clear widget state on page change. This normally happens implicitly + # in the script run cleanup steps, but doing it explicitly ensures + # it happens even if a script run was interrupted. + previous_page_script_hash = ctx.page_script_hash + if previous_page_script_hash != page_script_hash: + # Page changed, enforce reset widget state where possible. + # This enforcement matters when a new script thread is started + # before the previous script run is completed (from user + # interaction). Use the widget ids from the rerun data to + # maintain some widget state, as the rerun data should + # contain the latest widget ids from the frontend. + widget_ids: frozenset[str] = frozenset() + + if ( + rerun_data.widget_states is not None + and rerun_data.widget_states.widgets is not None + ): + widget_ids = frozenset( + w.id for w in rerun_data.widget_states.widgets + ) + + # For MPA page transitions: filter query params BEFORE cleanup. + # This uses existing bindings to remove params from other pages, + # ensuring st.query_params is accurate when the new page runs. + # (st.query_params in user code will reflect the correct params for the new page) + main_script_hash = self._pages_manager.main_script_hash + valid_script_hashes = {main_script_hash, page_script_hash} + with self._session_state.query_params() as qp: + qp.populate_from_query_string( + rerun_data.query_string, valid_script_hashes + ) + # Set initial params from FILTERED state for widget seeding. + # This prevents stale params from previous pages from seeding + # widgets on the new page if keys collide. + qp.set_initial_query_params_from_current() + + # Now safe to do normal cleanup - filtering already done + self._session_state.on_script_finished(widget_ids) + + fragment_ids_this_run: list[str] | None = None + if rerun_data.fragment_id_queue: + fragment_ids_this_run = self._fragment_storage.order_fragment_ids( + rerun_data.fragment_id_queue + ) + + ctx.reset( + query_string=rerun_data.query_string, + page_script_hash=page_script_hash, + fragment_ids_this_run=fragment_ids_this_run, + cached_message_hashes=rerun_data.cached_message_hashes, + context_info=rerun_data.context_info, + yield_check=self._maybe_handle_execution_control_request, + ) + with self._join_wake_lock: + self._join_wake_coordinator = ctx.parallel_coordinator + + self.on_event.send( + self, + event=ScriptRunnerEvent.SCRIPT_STARTED, + page_script_hash=page_script_hash, + fragment_ids_this_run=fragment_ids_this_run, + pages=self._pages_manager.get_pages(), + ) + + # Compile the script. Any errors thrown here will be surfaced + # to the user via a modal dialog in the frontend, and won't result + # in their previous script elements disappearing. + try: + if active_script is not None: + script_path = active_script["script_path"] + else: + # page must not be found + script_path = main_page_info["script_path"] + + # At this point, we know that either + # * the script corresponding to the hash requested no longer + # exists, or + # * we were not able to find a script with the requested page + # name. + # In both of these cases, we want to send a page_not_found + # message to the frontend. + msg = ForwardMsg() + msg.page_not_found.page_name = rerun_data.page_name + ctx.enqueue(msg) + + code = self._script_cache.get_bytecode(script_path) + + except Exception as ex: + # We got a compile error. Send an error event and bail immediately. + _LOGGER.exception("Script compilation error", exc_info=ex) + self._session_state[SCRIPT_RUN_WITHOUT_ERRORS_KEY] = False + with self._join_wake_lock: + self._join_wake_coordinator = None + self.on_event.send( + self, + event=ScriptRunnerEvent.SCRIPT_STOPPED_WITH_COMPILE_ERROR, + exception=ex, + ) + return + + # If we get here, we've successfully compiled our script. The next step + # is to run it. Errors thrown during execution will be shown to the + # user as ExceptionElements. + + # Create fake module. This gives us a name global namespace to + # execute the code in. + module = self._new_module("__main__") + + # Install the fake module as the __main__ module. This allows + # the pickle module to work inside the user's code, since it now + # can know the module where the pickled objects stem from. + # IMPORTANT: This means we can't use "if __name__ == '__main__'" in + # our code, as it will point to the wrong module!!! + sys.modules["__main__"] = module + + # Add special variables to the module's globals dict. + # Note: The following is a requirement for the CodeHasher to + # work correctly. The CodeHasher is scoped to + # files contained in the directory of __main__.__file__, which we + # assume is the main script directory. + module.__dict__["__file__"] = script_path + + def code_to_exec( + code: str = code, + module: types.ModuleType = module, + ctx: ScriptRunContext = ctx, + rerun_data: RerunData = rerun_data, + fragment_ids_this_run: list[str] | None = fragment_ids_this_run, + ) -> None: + with ( + modified_sys_path(self._main_script_path), + self._set_execing_flag(), + ): + # Run callbacks for widgets whose values have changed. + if rerun_data.widget_states is not None: + self._session_state.on_script_will_rerun( + rerun_data.widget_states + ) + + ctx.on_script_start() + + if fragment_ids_this_run: + for fragment_id in fragment_ids_this_run: + registration_sequence_before = ( + self._fragment_storage.registration_sequence() + ) + try: + wrapped_fragment = self._fragment_storage.lookup( + fragment_id + ) + except FragmentStorageKeyError: + # This can happen if the fragment_id is removed from the + # storage before the script runner gets to it. In this + # case, the fragment is simply skipped. + # Also, only log an error if the fragment is not an + # auto_rerun to avoid noise. If it is an auto_rerun, we + # might have a race condition where the fragment_id is + # removed but the webapp sends a rerun request before + # the removal information has reached the web app + # (see https://github.com/streamlit/streamlit/issues/9080). + if not rerun_data.is_auto_rerun: + _LOGGER.warning( + "Couldn't find fragment with id %s." + " This can happen if the fragment does not" + " exist anymore when this request is processed," + " for example because a full app rerun happened" + " that did not register the fragment." + " Usually this doesn't happen or no action is" + " required, so its mainly for debugging.", + fragment_id, + ) + continue + + try: + wrapped_fragment() + except (RerunException, StopException): + # The wrapped_fragment function is executed + # inside of a exec_func_with_error_handling call, so + # there is a correct handler for these exceptions. + raise + except Exception: # noqa: S110 + # Ignore exceptions raised by fragments here as we don't + # want to stop the execution of other fragments. The + # error itself is already rendered within the wrapped + # fragment. + pass + finally: + # Cleanup always uses what was actually re-registered + # during this attempt, regardless of how the fragment + # exited (normal return, RerunException, StopException, + # or a swallowed user exception). Children that the + # fragment did not get a chance to re-register will be + # dropped here and re-created on the next rerun. + registered_ids = ( + self._fragment_storage.ids_registered_after( + registration_sequence_before + ) + ) + removed_fragment_ids = ( + self._fragment_storage.clear_stale_descendants( + fragment_id, + registered_ids, + ) + ) + # Tell the frontend to cancel auto-rerun timers for + # fragments that were evicted (e.g. a nested + # ``run_every`` child that is no longer rendered), so + # they don't keep sending stale rerun requests. + if removed_fragment_ids: + stop_msg = ForwardMsg() + stop_msg.stop_auto_rerun.fragment_ids.extend( + removed_fragment_ids + ) + ctx.enqueue(stop_msg) + + else: + # Drop wrappers from the previous run before the main + # script recreates its outside containers as new DG + # objects. Clearing here (rather than after the script + # body) lets the wrappers created during this run survive + # for the fragment reruns that follow it. + self._fragment_storage.clear_outside_wrappers() + + # Expect parallel_coordinator to be initialized; + # cast makes this clear to the type checker. + coordinator = cast( + "ParallelFragmentCoordinator", + ctx.parallel_coordinator, + ) + try: + if PagesManager.uses_pages_directory: + _mpa_v1(self._main_script_path) + else: + exec(code, module.__dict__) # noqa: S102 + coordinator.join() + except BaseException: + # Always drain so in-flight worker fragments + # don't outlive the script run, regardless of + # whether the escape was a script-control + # exception, an uncaught user error, or an + # interrupt. + coordinator.drain() + raise + self._fragment_storage.clear( + new_fragment_ids=ctx.shared.new_fragment_ids.snapshot() + ) + + self._session_state.maybe_check_serializable() + # check for control requests, e.g. rerun requests have arrived + self._maybe_handle_execution_control_request() + + prep_time = timer() - start_time + ( + _, + run_without_errors, + rerun_exception_data, + premature_stop, + uncaught_exception, + ) = exec_func_with_error_handling(code_to_exec, ctx) + # setting the session state here triggers a yield-callback call + # which reads self._requests and checks for rerun data + self._session_state[SCRIPT_RUN_WITHOUT_ERRORS_KEY] = run_without_errors + + if rerun_exception_data: + # The handling for when a full script run or a fragment is stopped early + # is the same, so we only have one ScriptRunnerEvent for this scenario. + finished_event = ScriptRunnerEvent.SCRIPT_STOPPED_FOR_RERUN + elif rerun_data.fragment_id_queue: + finished_event = ScriptRunnerEvent.FRAGMENT_STOPPED_WITH_SUCCESS + else: + finished_event = ScriptRunnerEvent.SCRIPT_STOPPED_WITH_SUCCESS + + if ctx.gather_usage_stats: + try: + # Create and send page profile information + ctx.enqueue( + create_page_profile_message( + commands=ctx.shared.tracked_commands, + exec_time=to_microseconds(timer() - start_time), + prep_time=to_microseconds(prep_time), + uncaught_exception=( + type(uncaught_exception).__name__ + if uncaught_exception + else None + ), + ) + ) + except Exception as ex: + # Always capture all exceptions since we want to make sure that + # the telemetry never causes any issues. + _LOGGER.debug("Failed to create page profile", exc_info=ex) + self._on_script_finished(ctx, finished_event, premature_stop) + + # # Use _log_if_error() to make sure we never ever ever stop running the + # # script without meaning to. + _log_if_error(_clean_problem_modules) + + if rerun_exception_data is not None: + rerun_data = rerun_exception_data + else: + break + + def _on_script_finished( + self, ctx: ScriptRunContext, event: ScriptRunnerEvent, premature_stop: bool + ) -> None: + """Called when our script finishes executing, even if it finished + early with an exception. We perform post-run cleanup here. + """ + with self._join_wake_lock: + self._join_wake_coordinator = None + + # Tell session_state to update itself in response + if not premature_stop: + self._session_state.on_script_finished( + ctx.shared.widget_ids_this_run.snapshot() + ) + + # Signal that the script has finished. (We use SCRIPT_STOPPED_WITH_SUCCESS + # even if we were stopped with an exception.) + self.on_event.send(self, event=event) + + # Remove orphaned files now that the script has run and files in use + # are marked as active. + runtime.get_instance().media_file_mgr.remove_orphaned_files() + + # Force garbage collection to run, to help avoid memory use building up + # This is usually not an issue, but sometimes GC takes time to kick in and + # causes apps to go over resource limits, and forcing it to run between + # script runs is low cost, since we aren't doing much work anyway. + if config.get_option("runner.postScriptGC"): + gc.collect(2) + + def _new_module(self, name: str) -> types.ModuleType: + """Create a new module with the given name.""" + return types.ModuleType(name) + + +def _clean_problem_modules() -> None: + """Some modules are stateful, so we have to clear their state.""" + + if "keras" in sys.modules: + try: + keras = sys.modules["keras"] + cast("Any", keras).backend.clear_session() + except Exception: # noqa: S110 + # We don't want to crash the app if we can't clear the Keras session. + pass + + if "matplotlib.pyplot" in sys.modules: + try: + plt = sys.modules["matplotlib.pyplot"] + cast("Any", plt).close("all") + except Exception: # noqa: S110 + # We don't want to crash the app if we can't close matplotlib + pass + + +# The reason this is not a decorator is because we want to make it clear at the +# calling location that this function is being used. +def _log_if_error(fn: Callable[[], None]) -> None: + try: + fn() + except Exception as e: + _LOGGER.warning(e) diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__init__.py b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..618e97e2a1bc8e1f86ba8625acc28664342b2d42 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__init__.py @@ -0,0 +1,19 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +"""The modules in this package are separated from +the scriptrunner-package, because they are more or less +standalone and other modules import them quite frequently. +This separation helps us to remove dependency cycles. +""" diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/__init__.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0e4a176f53a964179a93c8d916b42bd83331e50d Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/__init__.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/exceptions.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/exceptions.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b7a47c5357b5ba106f95636f8a3e25f6e102cbe1 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/exceptions.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/script_requests.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/script_requests.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b61c105a1ddfdaa947b7e1d955a27487a003a10f Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/script_requests.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/script_run_context.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/script_run_context.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..010222ee87b7b24bc03b0103898e417dde4ad020 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/script_run_context.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/script_run_context_attr.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/script_run_context_attr.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..86b9443d72785c4d0e61773fe021c4d5455753c5 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/script_run_context_attr.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/shared_run_state.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/shared_run_state.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0511bd666ca16f537d1286c2bbe2ed2e81307124 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/shared_run_state.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/thread_safe_set.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/thread_safe_set.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1dab07eba5647820782408a216a86580d9a5cea Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/__pycache__/thread_safe_set.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/exceptions.py b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..afeae7d5c8dd927d2f25cb04fe3ba177f83f47bf --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/exceptions.py @@ -0,0 +1,44 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from streamlit.runtime.scriptrunner_utils.script_requests import RerunData +from streamlit.util import repr_ + + +# We inherit from BaseException to avoid being caught by user code. +# For example, having it inherit from Exception might make st.rerun not +# work in a try/except block. +class ScriptControlException(BaseException): # NOSONAR + """Base exception for ScriptRunner.""" + + +class StopException(ScriptControlException): + """Silently stop the execution of the user's script.""" + + +class RerunException(ScriptControlException): + """Silently stop and rerun the user's script.""" + + def __init__(self, rerun_data: RerunData) -> None: + """Construct a RerunException. + + Parameters + ---------- + rerun_data : RerunData + The RerunData that should be used to rerun the script + """ + self.rerun_data = rerun_data + + def __repr__(self) -> str: + return repr_(self) diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/script_requests.py b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/script_requests.py new file mode 100644 index 0000000000000000000000000000000000000000..44ce4c4f30321ba282d4826c0dd336da39903d39 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/script_requests.py @@ -0,0 +1,311 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import threading +from dataclasses import dataclass, field, replace +from enum import Enum +from typing import TYPE_CHECKING, cast + +from streamlit import util +from streamlit.proto.Common_pb2 import ChatInputValue as ChatInputValueProto +from streamlit.proto.WidgetStates_pb2 import WidgetState, WidgetStates + +if TYPE_CHECKING: + from streamlit.proto.ClientState_pb2 import ContextInfo + + +class ScriptRequestType(Enum): + # The ScriptRunner should continue running its script. + CONTINUE = "CONTINUE" + + # If the script is running, it should be stopped as soon + # as the ScriptRunner reaches an interrupt point. + # This is a terminal state. + STOP = "STOP" + + # A script rerun has been requested. The ScriptRunner should + # handle this request as soon as it reaches an interrupt point. + RERUN = "RERUN" + + +@dataclass(frozen=True) +class RerunData: + """Data attached to RERUN requests. Immutable.""" + + query_string: str = "" + widget_states: WidgetStates | None = None + page_script_hash: str = "" + page_name: str = "" + + # A single fragment_id to append to fragment_id_queue. + fragment_id: str | None = None + # The queue of fragment_ids waiting to be run. + fragment_id_queue: list[str] = field(default_factory=list) + is_fragment_scoped_rerun: bool = False + # set to true when a script is rerun by the fragment auto-rerun mechanism + is_auto_rerun: bool = False + # Hashes of messages that are cached in the client browser: + cached_message_hashes: frozenset[str] = field(default_factory=frozenset) + # context_info is used to store information from the user browser (e.g. timezone) + context_info: ContextInfo | None = None + + def __repr__(self) -> str: + return util.repr_(self) + + +@dataclass(frozen=True) +class ScriptRequest: + """A STOP or RERUN request and associated data.""" + + type: ScriptRequestType + _rerun_data: RerunData | None = None + + @property + def rerun_data(self) -> RerunData: + if self.type is not ScriptRequestType.RERUN: + raise RuntimeError("RerunData is only set for RERUN requests.") + return cast("RerunData", self._rerun_data) + + def __repr__(self) -> str: + return util.repr_(self) + + +def _fragment_run_should_not_preempt_script( + fragment_id_queue: list[str], + is_fragment_scoped_rerun: bool, +) -> bool: + """Returns whether the currently running script should be preempted due to a + fragment rerun. + + Reruns corresponding to fragment runs that weren't caused by calls to + `st.rerun(scope="fragment")` should *not* cancel the current script run + as doing so will affect elements outside of the fragment. + """ + return bool(fragment_id_queue) and not is_fragment_scoped_rerun + + +def _coalesce_widget_states( + old_states: WidgetStates | None, new_states: WidgetStates | None +) -> WidgetStates | None: + """Coalesce an older WidgetStates into a newer one, and return a new + WidgetStates containing the result. + + For most widget values, we just take the latest version. + + However, any trigger_values (which are set by buttons) that are True in + `old_states` will be set to True in the coalesced result, so that button + presses don't go missing. + """ + if not old_states and not new_states: + return None + if not old_states: + return new_states + if not new_states: + return old_states + + states_by_id: dict[str, WidgetState] = { + wstate.id: wstate for wstate in new_states.widgets + } + + trigger_value_types = [ + ("trigger_value", False), + ("chat_input_value", ChatInputValueProto(data=None)), + ] + for old_state in old_states.widgets: + for trigger_value_type, unset_value in trigger_value_types: + if ( + old_state.WhichOneof("value") == trigger_value_type + and getattr(old_state, trigger_value_type) != unset_value + ): + new_trigger_val = states_by_id.get(old_state.id) + # It should nearly always be the case that new_trigger_val is None + # here as trigger values are deleted from the client's WidgetStateManager + # as soon as a rerun_script BackMsg is sent to the server. Since it's + # impossible to test that the client sends us state in the expected + # format in a unit test, we test for this behavior in + # e2e_playwright/test_fragment_queue_test.py + if not new_trigger_val or ( + # Ensure the corresponding new_state is also a trigger; + # otherwise, a widget that was previously a button/chat_input but no + # longer is could get a bad value. + new_trigger_val.WhichOneof("value") == trigger_value_type + # We only want to take the value of old_state if new_trigger_val is + # unset as the old value may be stale if a newer one was entered. + and getattr(new_trigger_val, trigger_value_type) == unset_value + ): + states_by_id[old_state.id] = old_state + + coalesced = WidgetStates() + coalesced.widgets.extend(states_by_id.values()) + + return coalesced + + +class ScriptRequests: + """An interface for communicating with a ScriptRunner. Thread-safe. + + AppSession makes requests of a ScriptRunner through this class, and + ScriptRunner handles those requests. + """ + + def __init__(self) -> None: + self._lock = threading.Lock() + self._state = ScriptRequestType.CONTINUE + self._rerun_data = RerunData() + + def request_stop(self) -> None: + """Request that the ScriptRunner stop running. A stopped ScriptRunner + can't be used anymore. STOP requests succeed unconditionally. + """ + with self._lock: + self._state = ScriptRequestType.STOP + + def request_rerun(self, new_data: RerunData) -> bool: + """Request that the ScriptRunner rerun its script. + + If the ScriptRunner has been stopped, this request can't be honored: + return False. + + Otherwise, record the request and return True. The ScriptRunner will + handle the rerun request as soon as it reaches an interrupt point. + """ + + with self._lock: + if self._state == ScriptRequestType.STOP: + # We can't rerun after being stopped. + return False + + if self._state == ScriptRequestType.CONTINUE: + # The script is currently running, and we haven't received a request to + # rerun it as of yet. We can handle a rerun request unconditionally so + # just change self._state and set self._rerun_data. + self._state = ScriptRequestType.RERUN + + # Convert from a single fragment_id into fragment_id_queue. + if new_data.fragment_id: + new_data = replace( + new_data, + fragment_id=None, + fragment_id_queue=[new_data.fragment_id], + ) + + self._rerun_data = new_data + return True + + if self._state == ScriptRequestType.RERUN: + # We already have an existing Rerun request, so we can coalesce the new + # rerun request into the existing one. + + coalesced_states = _coalesce_widget_states( + self._rerun_data.widget_states, new_data.widget_states + ) + + if new_data.fragment_id: + # This RERUN request corresponds to a new fragment run. We append + # the new fragment ID to the end of the current fragment_id_queue if + # it isn't already contained in it. + fragment_id_queue = [*self._rerun_data.fragment_id_queue] + + if new_data.fragment_id not in fragment_id_queue: + fragment_id_queue.append(new_data.fragment_id) + elif new_data.fragment_id_queue: + # new_data contains a new fragment_id_queue, so we just use it. + fragment_id_queue = new_data.fragment_id_queue + else: + # Otherwise, this is a request to rerun the full script, so we want + # to clear out any fragments we have queued to run since they'll all + # be run with the full script anyway. + fragment_id_queue = [] + + self._rerun_data = RerunData( + query_string=new_data.query_string, + widget_states=coalesced_states, + page_script_hash=new_data.page_script_hash, + page_name=new_data.page_name, + fragment_id_queue=fragment_id_queue, + cached_message_hashes=new_data.cached_message_hashes, + is_fragment_scoped_rerun=new_data.is_fragment_scoped_rerun, + is_auto_rerun=new_data.is_auto_rerun, + context_info=new_data.context_info, + ) + + return True + + # We'll never get here + raise RuntimeError(f"Unrecognized ScriptRunnerState: {self._state}") + + def on_scriptrunner_yield(self) -> ScriptRequest | None: + """Called by the ScriptRunner when it's at a yield point. + + If we have no request or a RERUN request corresponding to one or more fragments + (that is not a fragment-scoped rerun), return None. + + If we have a (full script or fragment-scoped) RERUN request, return the request + and set our internal state to CONTINUE. + + If we have a STOP request, return the request and remain stopped. + """ + if self._state == ScriptRequestType.CONTINUE or ( + self._state == ScriptRequestType.RERUN + and _fragment_run_should_not_preempt_script( + self._rerun_data.fragment_id_queue, + self._rerun_data.is_fragment_scoped_rerun, + ) + ): + # We avoid taking the lock in the common cases described above. If a STOP or + # preempting RERUN request is received after we've taken this code path, it + # will be handled at the next `on_scriptrunner_yield`, or when + # `on_scriptrunner_ready` is called. + return None + + with self._lock: + if self._state == ScriptRequestType.RERUN: + # We already made this check in the fast-path above but need to do so + # again in case our state changed while we were waiting on the lock. + if _fragment_run_should_not_preempt_script( + self._rerun_data.fragment_id_queue, + self._rerun_data.is_fragment_scoped_rerun, + ): + return None + + self._state = ScriptRequestType.CONTINUE + return ScriptRequest(ScriptRequestType.RERUN, self._rerun_data) + + if self._state != ScriptRequestType.STOP: # pragma: no cover - defensive + raise RuntimeError( + f"Unrecognized ScriptRunnerState: {self._state}. This should never happen." + ) + return ScriptRequest(ScriptRequestType.STOP) + + def on_scriptrunner_ready(self) -> ScriptRequest: + """Called by the ScriptRunner when it's about to run its script for + the first time, and also after its script has successfully completed. + + If we have a RERUN request, return the request and set + our internal state to CONTINUE. + + If we have a STOP request or no request, set our internal state + to STOP. + """ + with self._lock: + if self._state == ScriptRequestType.RERUN: + self._state = ScriptRequestType.CONTINUE + return ScriptRequest(ScriptRequestType.RERUN, self._rerun_data) + + # If we don't have a rerun request, unconditionally change our + # state to STOP. + self._state = ScriptRequestType.STOP + return ScriptRequest(ScriptRequestType.STOP) diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/script_run_context.py b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/script_run_context.py new file mode 100644 index 0000000000000000000000000000000000000000..213117d1a8dbdf2bbf8c51e7423fcd7f5c60e5fa --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/script_run_context.py @@ -0,0 +1,463 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import contextlib +import contextvars +import dataclasses +import threading +from collections.abc import Callable +from dataclasses import dataclass, field +from typing import ( + TYPE_CHECKING, + Final, + TypeAlias, + TypedDict, +) + +from typing_extensions import Unpack + +from streamlit import config +from streamlit.errors import ( + NoSessionContext, +) +from streamlit.logger import get_logger +from streamlit.runtime.forward_msg_cache import ( + create_reference_msg, + populate_hash_if_needed, +) +from streamlit.runtime.parallel_coordinator import ParallelFragmentCoordinator +from streamlit.runtime.scriptrunner_utils.script_run_context_attr import ( + SCRIPT_RUN_CONTEXT_ATTR_NAME, +) +from streamlit.runtime.scriptrunner_utils.shared_run_state import SharedRunState + +if TYPE_CHECKING: + from collections.abc import Generator + from pathlib import Path + + from streamlit.cursor import RunningCursor + from streamlit.proto.ClientState_pb2 import ContextInfo + from streamlit.proto.ForwardMsg_pb2 import ForwardMsg + from streamlit.runtime.fragment import FragmentStorage + from streamlit.runtime.pages_manager import PagesManager + from streamlit.runtime.scriptrunner_utils.script_requests import ScriptRequests + from streamlit.runtime.state import SafeSessionState + from streamlit.runtime.uploaded_file_manager import UploadedFileManager + +OnScriptErrorHandler: TypeAlias = Callable[[Exception], bool | None] + +_LOGGER: Final = get_logger(__name__) + +UserInfoType: TypeAlias = dict[str, str | bool | dict[str, str] | None] + + +# If true, it indicates that we are in a cached function that disallows the usage of +# widgets. Using contextvars to be thread-safe. +in_cached_function: contextvars.ContextVar[bool] = contextvars.ContextVar( + "in_cached_function", default=False +) + + +@dataclass(frozen=True) +class FragmentThreadState: + """Per-thread state for a fragment execution. + + Frozen so that all mutations must go through ThreadState.update() or + ThreadState.scoped(), which rebind the ContextVar and guarantee context + isolation when using copy_context(). + """ + + fragment_id: str | None = None + delta_path: tuple[int, ...] | None = None + in_fragment_callback: bool = False + active_script_hash: str = "" + # Set on parallel-fragment workers so wrapped_fragment() skips creating a + # second st.container(); the main thread already pre-allocated one before + # dispatching the worker. Cleared after first use. + pre_allocated_container_fragment_id: str | None = None + # True while executing inside a parallel fragment worker thread; used by + # _check_not_parallel_worker() to gate APIs that are unsafe during + # concurrent execution (e.g. st.dialog, st.switch_page). + is_parallel_worker: bool = False + + +class _FragmentThreadStateFields(TypedDict, total=False): + """Keyword-arg shape for ``ThreadState.{initialize, update, scoped}``. + + Mirrors ``FragmentThreadState``'s fields. Using ``TypedDict + Unpack`` + catches typos (e.g., ``fragmentid=`` vs ``fragment_id=``) and wrong + value types at type-check time rather than as a runtime ``TypeError``. + """ + + fragment_id: str | None + delta_path: tuple[int, ...] | None + in_fragment_callback: bool + active_script_hash: str + pre_allocated_container_fragment_id: str | None + is_parallel_worker: bool + + +_thread_state: contextvars.ContextVar[FragmentThreadState] = contextvars.ContextVar( + "fragment_thread_state", +) + + +class ThreadState: + """Encapsulates all access to the per-thread FragmentThreadState ContextVar. + + The ContextVar ``_thread_state`` is module-private. External code interacts + exclusively through this class. The frozen dataclass ensures callers cannot + bypass the API — in-place mutation raises ``FrozenInstanceError``. + """ + + @staticmethod + def initialize(**kwargs: Unpack[_FragmentThreadStateFields]) -> None: + """Create a fresh FragmentThreadState and bind it in the current context. + + Called from ``reset()`` at the start of every script run, and from + parallel fragment worker setup to seed the worker's copied context + with the parent's snapshot. + """ + _thread_state.set(FragmentThreadState(**kwargs)) + + @staticmethod + def get() -> FragmentThreadState: + """Read the current context's FragmentThreadState. + + Returns a frozen object — callers can read fields but cannot mutate + them. Raises ``RuntimeError`` if called before ``initialize()``. + """ + try: + return _thread_state.get() + except LookupError: + raise RuntimeError( + "FragmentThreadState not initialized — " + "ScriptRunContext.reset() or add_script_run_ctx() must be " + "called on this thread first." + ) from None + + @staticmethod + def update(**kwargs: Unpack[_FragmentThreadStateFields]) -> None: + """Update one or more fields on the current context's state. + + Creates a new frozen dataclass via ``dataclasses.replace()`` and + rebinds the ContextVar, ensuring context isolation. + """ + _thread_state.set(dataclasses.replace(ThreadState.get(), **kwargs)) + + @staticmethod + @contextlib.contextmanager + def scoped( + **overrides: Unpack[_FragmentThreadStateFields], + ) -> Generator[None, None, None]: + """Temporarily override fields, automatically restore on exit. + + Uses ``ContextVar.reset(token)`` to atomically restore the entire + previous state. Used for nesting within a single thread (e.g. nested + fragments) where ``copy_context()`` is not involved. + """ + token = _thread_state.set(dataclasses.replace(ThreadState.get(), **overrides)) + try: + yield + finally: + _thread_state.reset(token) + + +@dataclass +class ScriptRunContext: + """A context object that contains data for a "script run" - that is, + data that's scoped to a single ScriptRunner execution (and therefore also + scoped to a single connected "session"). + + ScriptRunContext is used internally by virtually every `st.foo()` function. + It is accessed only from the script thread that's created by ScriptRunner, + or from app-created helper threads that have been "attached" to the + ScriptRunContext via `add_script_run_ctx`. + + Streamlit code typically retrieves the active ScriptRunContext via the + `get_script_run_ctx` function. + + Note: ``__post_init__`` adds a non-field ``_main_thread_ident`` used + by ``reset()``'s thread guard. + """ + + session_id: str + _enqueue: Callable[[ForwardMsg], None] + query_string: str + session_state: SafeSessionState + uploaded_file_mgr: UploadedFileManager + main_script_path: str + user_info: UserInfoType + fragment_storage: FragmentStorage + pages_manager: PagesManager + on_script_error: OnScriptErrorHandler | None = None + + # Hashes of messages that are cached in the client browser: + cached_message_hashes: frozenset[str] = field(default_factory=frozenset) + context_info: ContextInfo | None = None + gather_usage_stats: bool = False + command_tracking_deactivated: bool = False + _has_script_started: bool = False + shared: SharedRunState = field(default_factory=SharedRunState) + cursors: dict[int, RunningCursor] = field(default_factory=dict) + script_requests: ScriptRequests | None = None + fragment_ids_this_run: list[str] | None = None + # we allow only one dialog to be open at the same time + has_dialog_opened: bool = False + parallel_coordinator: ParallelFragmentCoordinator | None = None + + def __post_init__(self) -> None: + # Capture the main script thread's identity so reset() can refuse to + # run from worker threads. + self._main_thread_ident = threading.get_ident() + + @property + def page_script_hash(self) -> str: + return self.pages_manager.current_page_script_hash + + @property + def main_script_parent(self) -> Path: + return self.pages_manager.main_script_parent + + @contextlib.contextmanager + def run_with_active_hash(self, page_hash: str) -> Generator[None, None, None]: + with ThreadState.scoped(active_script_hash=page_hash): + yield + + def set_mpa_v2_page(self, page_script_hash: str) -> None: + ThreadState.update(active_script_hash=self.pages_manager.main_script_hash) + self.pages_manager.set_current_page_script_hash(page_script_hash) + + def reset( + self, + query_string: str = "", + page_script_hash: str = "", + fragment_ids_this_run: list[str] | None = None, + cached_message_hashes: frozenset[str] | None = None, + context_info: ContextInfo | None = None, + # Checked by fragment workers to cease execution. + yield_check: Callable[[], None] = lambda: None, + ) -> None: + if threading.get_ident() != self._main_thread_ident: + raise RuntimeError( + "ScriptRunContext.reset() must only be called from the main " + "script thread" + ) + # Check if this is a same-page rerun BEFORE updating page_script_hash + is_same_page = self.page_script_hash == page_script_hash + + self.cursors = {} + self.shared.reset() + self.query_string = query_string + self.context_info = context_info + self.pages_manager.set_current_page_script_hash(page_script_hash) + ThreadState.initialize( + active_script_hash=self.pages_manager.main_script_hash, + ) + self.parallel_coordinator = ParallelFragmentCoordinator( + yield_check=yield_check, + max_workers=config.get_option("runner.parallelMaxWorkers"), + ) + self._has_script_started = False + self.command_tracking_deactivated: bool = False + self.fragment_ids_this_run = fragment_ids_this_run + self.has_dialog_opened = False + self.cached_message_hashes = frozenset(cached_message_hashes or ()) + + in_cached_function.set(False) + + with self.session_state.query_params() as qp: + # For same-page reruns (widget interactions), populate _query_params from URL + # and set initial params for widget seeding. + # For page transitions, both populate_from_query_string() AND + # set_initial_query_params_from_current() are called in script_runner.py + # BEFORE reset() to ensure filtering is applied to both _query_params + # AND _initial_query_params, preventing stale params from previous pages + # from seeding widgets on the new page. + if is_same_page: + qp.set_initial_query_params(query_string) + qp.populate_from_query_string(query_string) + + def on_script_start(self) -> None: + self._has_script_started = True + + def enqueue(self, msg: ForwardMsg) -> None: + """Enqueue a ForwardMsg for this context's session.""" + msg.metadata.active_script_hash = ThreadState.get().active_script_hash + + # We populate the hash and cacheable field for all messages. + # Besides the forward message cache, the hash might also be used + # for other aspects within the frontend. + populate_hash_if_needed(msg) + msg_to_send = msg + if ( + msg.metadata.cacheable + and msg.hash + and msg.hash in self.cached_message_hashes + ): + _LOGGER.debug("Sending cached message ref (hash=%s)", msg.hash) + msg_to_send = create_reference_msg(msg) + + # Pass the message up to our associated ScriptRunner. + self._enqueue(msg_to_send) + + +# Thread-attached storage used by add_script_run_ctx: +# - Fields slot: parent FragmentThreadState snapshot, applied at run() time. +# - Install slot: sentinel that prevents thread.run from being wrapped +# more than once across repeated add_script_run_ctx() calls. +_FRAGMENT_THREAD_STATE_FIELDS_ATTR: Final = "_streamlit_fragment_thread_state_fields" +_FRAGMENT_THREAD_STATE_WRAP_INSTALLED_ATTR: Final = ( + "_streamlit_fragment_thread_state_wrap_installed" +) + + +def add_script_run_ctx( + thread: threading.Thread | None = None, ctx: ScriptRunContext | None = None +) -> threading.Thread: + """Attach the current ScriptRunContext to a thread and propagate the + parent's FragmentThreadState snapshot. + + Normal usage: call from the parent thread, before the child starts. + Repeat attaches on the same not-yet-started thread are last-wins for + both ``ctx`` and the FragmentThreadState snapshot. + + Self-attach fallback: when called from inside the thread it is + attaching to (current thread, or ``thread`` omitted with explicit + ``ctx``), ``ThreadState`` is seeded directly from ``ctx``. The + parent's ContextVar is not visible from another thread, so: + + - ``fragment_id`` and ``delta_path`` are NOT propagated; worker + writes won't be stamped with the parent's ``fragment_id``. + - ``active_script_hash`` is seeded from + ``ctx.pages_manager.main_script_hash``. MPA v1 page bodies will + therefore see the main hash, not the page hash; migrate to MPA v2 + / ``st.navigation`` if that matters. Locked in by + ``test_add_script_run_ctx_self_attach_uses_main_script_hash_not_page_hash``. + + Parameters + ---------- + thread : threading.Thread or None + Thread to attach to. Defaults to the current thread. + ctx : ScriptRunContext or None + Context to attach. Defaults to the caller's current + ScriptRunContext. + + Returns + ------- + threading.Thread + The same thread that was passed in, for chaining. + + """ + if thread is None: + thread = threading.current_thread() + if ctx is None: + ctx = get_script_run_ctx() + if ctx is not None: + setattr(thread, SCRIPT_RUN_CONTEXT_ATTR_NAME, ctx) + + # ContextVars don't cross thread boundaries, so capture the parent's + # FragmentThreadState and initialize it when the child thread starts. + try: + parent_ts = ThreadState.get() + except RuntimeError: + parent_ts = None + + if parent_ts is not None: + # Store the parent snapshot on the thread; the run() wrapper below + # reads it at start time. Repeat add_script_run_ctx() calls refresh + # the snapshot — last attach wins, matching the ctx attachment above. + setattr( + thread, + _FRAGMENT_THREAD_STATE_FIELDS_ATTR, + dataclasses.asdict(parent_ts), + ) + # Skip the wrap if the target is already running: run() has + # already been called, and setting the sentinel here would + # pollute the main thread across tests. + if thread is not threading.current_thread() and not getattr( + thread, _FRAGMENT_THREAD_STATE_WRAP_INSTALLED_ATTR, False + ): + original_run = thread.run + + def _run_with_thread_state(*args: object, **kwargs: object) -> None: + fields = getattr(thread, _FRAGMENT_THREAD_STATE_FIELDS_ATTR, None) + if fields is not None: + ThreadState.initialize(**fields) + original_run(*args, **kwargs) + + thread.run = _run_with_thread_state # type: ignore[method-assign] # ty: ignore[invalid-assignment] + setattr(thread, _FRAGMENT_THREAD_STATE_WRAP_INSTALLED_ATTR, True) + elif ctx is not None and thread is threading.current_thread(): + # Caller is attaching ctx from inside the currently-running + # thread, so the thread.run wrap above is moot. Seed ThreadState + # directly from ctx so subsequent ThreadState.get() / + # enqueue_message() calls don't crash. See the add_script_run_ctx + # docstring for the self-attach behaviour contract. + # + # Two callers exercise this branch: + # 1. ScriptRunner._run_script_thread, before ctx.reset() reseeds. + # 2. User code calling add_script_run_ctx(ctx=saved_ctx) from + # inside a worker thread (documented against, but a real + # pattern). + ThreadState.initialize( + active_script_hash=ctx.pages_manager.main_script_hash, + ) + + return thread + + +def get_script_run_ctx(suppress_warning: bool = False) -> ScriptRunContext | None: + """ + Parameters + ---------- + suppress_warning : bool + If True, don't log a warning if there's no ScriptRunContext. + + Returns + ------- + ScriptRunContext | None + The current thread's ScriptRunContext, or None if it doesn't have one. + + """ + thread = threading.current_thread() + ctx: ScriptRunContext | None = getattr(thread, SCRIPT_RUN_CONTEXT_ATTR_NAME, None) + if ctx is None and not suppress_warning: + # Only warn about a missing ScriptRunContext if suppress_warning is False, and + # we were started via `streamlit run`. Otherwise, the user is likely running a + # script "bare", and doesn't need to be warned about streamlit + # bits that are irrelevant when not connected to a session. + _LOGGER.warning( + "Thread '%s': missing ScriptRunContext! This warning can be ignored when " + "running in bare mode.", + thread.name, + ) + + return ctx + + +def enqueue_message(msg: ForwardMsg) -> None: + """Enqueues a ForwardMsg proto to send to the app.""" + ctx = get_script_run_ctx() + + if ctx is None: + raise NoSessionContext() + + ts = ThreadState.get() + if ts.fragment_id and msg.WhichOneof("type") == "delta": + msg.delta.fragment_id = ts.fragment_id + + ctx.enqueue(msg) diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/script_run_context_attr.py b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/script_run_context_attr.py new file mode 100644 index 0000000000000000000000000000000000000000..acb37c9c0692cdeb2feced3b374af7c133af3dad --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/script_run_context_attr.py @@ -0,0 +1,25 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +"""The thread attribute name under which the active ScriptRunContext is stored. + +This is a dependency-free leaf module so that both ``script_run_context`` and +``parallel_coordinator`` can share the constant without importing each other. +""" + +from __future__ import annotations + +from typing import Final + +SCRIPT_RUN_CONTEXT_ATTR_NAME: Final = "streamlit_script_run_ctx" diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/shared_run_state.py b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/shared_run_state.py new file mode 100644 index 0000000000000000000000000000000000000000..424fadf1e8e3e75446916720faf45f3def54e207 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/shared_run_state.py @@ -0,0 +1,86 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import collections +import threading +from typing import TYPE_CHECKING + +from streamlit.runtime.scriptrunner_utils.thread_safe_set import ThreadSafeSet + +if TYPE_CHECKING: + from streamlit.proto.PageProfile_pb2 import Command + + +class SharedRunState: + """Thread-safe container for shared mutable state during a script run. + + A single instance is shared across the main thread and all worker threads. + Callers access state only through synchronized methods — direct field + access to the underlying data structures is not exposed. + """ + + def __init__(self) -> None: + self.widget_ids_this_run: ThreadSafeSet[str] = ThreadSafeSet() + self.widget_user_keys_this_run: ThreadSafeSet[str] = ThreadSafeSet() + self.form_ids_this_run: ThreadSafeSet[str] = ThreadSafeSet() + self.new_fragment_ids: ThreadSafeSet[str] = ThreadSafeSet() + + self._telemetry_lock = threading.Lock() + self._tracked_commands: list[Command] = [] + self._tracked_commands_counter: collections.Counter[str] = collections.Counter() + + def reset(self) -> None: + """Re-initialize all shared mutable state for a new script run. + + Must only be called from the main script thread before parallel + dispatch. + """ + self.widget_ids_this_run.clear() + self.widget_user_keys_this_run.clear() + self.form_ids_this_run.clear() + self.new_fragment_ids.clear() + + with self._telemetry_lock: + self._tracked_commands = [] + self._tracked_commands_counter = collections.Counter() + + @property + def tracked_commands(self) -> tuple[Command, ...]: + """An immutable snapshot of tracked commands.""" + with self._telemetry_lock: + return tuple(self._tracked_commands) + + @property + def tracked_commands_count(self) -> int: + """The number of commands stored in the tracked list (capped).""" + with self._telemetry_lock: + return len(self._tracked_commands) + + def track_command(self, command: Command, max_per_command: int) -> None: + """Atomically track a command. + + Appends the command to the list if it is under the per-command cap, and + always updates the counter. + """ + with self._telemetry_lock: + if self._tracked_commands_counter[command.name] < max_per_command: + self._tracked_commands.append(command) + self._tracked_commands_counter.update([command.name]) + + def command_count_for(self, name: str) -> int: + """Return how many times a command name has been tracked.""" + with self._telemetry_lock: + return self._tracked_commands_counter[name] diff --git a/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/thread_safe_set.py b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/thread_safe_set.py new file mode 100644 index 0000000000000000000000000000000000000000..e984d81fe201b539d7d6c934792b3d0d007dabd2 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/scriptrunner_utils/thread_safe_set.py @@ -0,0 +1,69 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import threading +from collections.abc import Hashable +from typing import Generic, NoReturn, TypeVar + +T = TypeVar("T", bound=Hashable) + + +class ThreadSafeSet(Generic[T]): + """A thread-safe set wrapper that enforces controlled access via atomic methods. + + This replaces bare ``set[str]`` fields where callers previously did non-atomic + check-then-add operations. The underlying set is never exposed directly — + callers interact only through ``check_and_add``, ``__contains__``, ``snapshot``, + and ``clear``. The ``snapshot`` method returns an immutable ``frozenset``, + enforcing the expectation that these sets are read-only once handed off to + downstream consumers (e.g. ``SessionState.on_script_finished``). + """ + + def __init__(self) -> None: + self._lock = threading.Lock() + self._data: set[T] = set() + + def check_and_add(self, value: T) -> bool: + """Atomically check membership and add. Returns True if the value was new.""" + with self._lock: + is_new = value not in self._data + self._data.add(value) + return is_new + + def __contains__(self, value: object) -> bool: + with self._lock: + return value in self._data + + def clear(self) -> None: + """Reset to empty.""" + with self._lock: + self._data.clear() + + def snapshot(self) -> frozenset[T]: + """Return an immutable copy for read-only consumers.""" + with self._lock: + return frozenset(self._data) + + def __deepcopy__(self, memo: dict[int, object]) -> NoReturn: + raise TypeError( + "ThreadSafeSet does not support deepcopy; " + "use .snapshot() for an immutable copy" + ) + + def __copy__(self) -> NoReturn: + raise TypeError( + "ThreadSafeSet does not support copy; use .snapshot() for an immutable copy" + ) diff --git a/venv/Lib/site-packages/streamlit/runtime/secrets.py b/venv/Lib/site-packages/streamlit/runtime/secrets.py new file mode 100644 index 0000000000000000000000000000000000000000..65f559b4725fdfed2b215f138c86ec3713976c0f --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/secrets.py @@ -0,0 +1,652 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import os +import threading +from collections.abc import Callable, ItemsView, Iterator, KeysView, Mapping, ValuesView +from copy import deepcopy +from typing import ( + Any, + Final, + NoReturn, +) + +from blinker import Signal + +import streamlit.watcher.path_watcher +from streamlit import config, runtime +from streamlit.errors import StreamlitMaxRetriesError, StreamlitSecretNotFoundError +from streamlit.logger import get_logger + +_LOGGER: Final = get_logger(__name__) + +# Type alias for programmatic secrets values. +# Supported types: str, int, float, bool, lists, and nested dicts. +SecretsValue = ( + str | int | float | bool | list["SecretsValue"] | dict[str, "SecretsValue"] +) + +# Allowed scalar types for secrets values +_ALLOWED_SCALAR_TYPES: Final[frozenset[type]] = frozenset({str, int, float, bool}) + + +def _validate_secrets_value(value: Any, path: str = "") -> None: + """Validate that a secrets value has an allowed type. + + Parameters + ---------- + value + The value to validate. + path + The path to this value (for error messages). Dict keys use dotted + notation (e.g. ``outer.inner``) and list elements use bracket indexing + (e.g. ``outer.inner[2]``). + + Raises + ------ + TypeError + If the value has an unsupported type. + """ + if isinstance(value, dict): + for key, nested_value in value.items(): + if not isinstance(key, str): + key_path = f"in '{path}'" if path else "at top level" + raise TypeError( + f"Dictionary keys in secrets must be strings, " + f"got {type(key).__name__!r} {key_path}." + ) + nested_path = f"{path}.{key}" if path else key + _validate_secrets_value(nested_value, nested_path) + elif isinstance(value, list): + for index, nested_value in enumerate(value): + nested_path = f"{path}[{index}]" if path else f"[{index}]" + _validate_secrets_value(nested_value, nested_path) + # Use type() instead of isinstance() because bool is a subclass of int, + # and we need to distinguish them for os.environ promotion (bool excluded). + elif type(value) not in _ALLOWED_SCALAR_TYPES: + type_name = type(value).__name__ + path_info = f" at '{path}'" if path else "" + raise TypeError( + f"Unsupported type '{type_name}'{path_info} in secrets. " + f"Allowed types are: str, int, float, bool, lists, and nested dicts." + ) + + +class SecretErrorMessages: + """SecretErrorMessages stores all error messages we use for secrets to allow customization + for different environments. + + For example Streamlit Cloud can customize the message to be different than the open source. + + For internal use, may change in future releases without notice. + """ + + def __init__(self) -> None: + self.missing_attr_message: Callable[[str], str] = lambda attr_name: ( + f'st.secrets has no attribute "{attr_name}". ' + "Did you forget to add it to secrets.toml, mount it to secret directory, or the app settings " + "on Streamlit Cloud? More info: " + "https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app/secrets-management" + ) + self.missing_key_message: Callable[[str], str] = lambda key: ( + f'st.secrets has no key "{key}". ' + "Did you forget to add it to secrets.toml, mount it to secret directory, or the app settings " + "on Streamlit Cloud? More info: " + "https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app/secrets-management" + ) + self.no_secrets_found: Callable[[list[str]], str] = lambda file_paths: ( + f"No secrets found. Valid paths for a secrets.toml file or secret directories are: {', '.join(file_paths)}" + ) + self.error_parsing_file_at_path: Callable[[str, Exception], str] = ( + lambda path, ex: f"Error parsing secrets file at {path}: {ex}" + ) + self.subfolder_path_is_not_a_folder: Callable[[str], str] = ( + lambda sub_folder_path: ( + f"{sub_folder_path} is not a folder. " + "To use directory based secrets, mount every secret in a subfolder under the secret directory" + ) + ) + self.invalid_secret_path: Callable[[str], str] = lambda path: ( + f"Invalid secrets path: {path}: path is not a .toml file or a directory" + ) + + def set_missing_attr_message(self, message: Callable[[str], str]) -> None: + """Set the missing attribute error message.""" + self.missing_attr_message = message + + def set_missing_key_message(self, message: Callable[[str], str]) -> None: + """Set the missing key error message.""" + self.missing_key_message = message + + def set_no_secrets_found_message(self, message: Callable[[list[str]], str]) -> None: + """Set the no secrets found error message.""" + self.no_secrets_found = message + + def set_error_parsing_file_at_path_message( + self, message: Callable[[str, Exception], str] + ) -> None: + """Set the error parsing file at path error message.""" + self.error_parsing_file_at_path = message + + def set_subfolder_path_is_not_a_folder_message( + self, message: Callable[[str], str] + ) -> None: + """Set the subfolder path is not a folder error message.""" + self.subfolder_path_is_not_a_folder = message + + def set_invalid_secret_path_message(self, message: Callable[[str], str]) -> None: + """Set the invalid secret path error message.""" + self.invalid_secret_path = message + + def get_missing_attr_message(self, attr_name: str) -> str: + """Get the missing attribute error message.""" + return self.missing_attr_message(attr_name) + + def get_missing_key_message(self, key: str) -> str: + """Get the missing key error message.""" + return self.missing_key_message(key) + + def get_no_secrets_found_message(self, file_paths: list[str]) -> str: + """Get the no secrets found error message.""" + return self.no_secrets_found(file_paths) + + def get_error_parsing_file_at_path_message(self, path: str, ex: Exception) -> str: + """Get the error parsing file at path error message.""" + return self.error_parsing_file_at_path(path, ex) + + def get_subfolder_path_is_not_a_folder_message(self, sub_folder_path: str) -> str: + """Get the subfolder path is not a folder error message.""" + return self.subfolder_path_is_not_a_folder(sub_folder_path) + + def get_invalid_secret_path_message(self, path: str) -> str: + """Get the invalid secret path error message.""" + return self.invalid_secret_path(path) + + +secret_error_messages_singleton: Final = SecretErrorMessages() + + +def _convert_to_dict(obj: Mapping[str, Any] | AttrDict) -> dict[str, Any]: + """Convert Mapping or AttrDict objects to dictionaries.""" + if isinstance(obj, AttrDict): + return obj.to_dict() + return {k: v.to_dict() if isinstance(v, AttrDict) else v for k, v in obj.items()} + + +def _missing_attr_error_message(attr_name: str) -> str: + return secret_error_messages_singleton.get_missing_attr_message(attr_name) + + +def _missing_key_error_message(key: str) -> str: + return secret_error_messages_singleton.get_missing_key_message(key) + + +class AttrDict(Mapping[str, Any]): + """We use AttrDict to wrap up dictionary values from secrets + to provide dot access to nested secrets. + """ + + def __init__(self, value: Mapping[str, Any]) -> None: + self.__dict__["__nested_secrets__"] = dict(value) + + @staticmethod + def _maybe_wrap_in_attr_dict(value: Any) -> Any: + if not isinstance(value, Mapping): + return value + return AttrDict(value) + + def __len__(self) -> int: + return len(self.__nested_secrets__) + + def __iter__(self) -> Iterator[str]: + return iter(self.__nested_secrets__) + + def __getitem__(self, key: str) -> Any: + try: + value = self.__nested_secrets__[key] + return self._maybe_wrap_in_attr_dict(value) + except KeyError: + raise KeyError(_missing_key_error_message(key)) + + def __getattr__(self, attr_name: str) -> Any: + try: + value = self.__nested_secrets__[attr_name] + return self._maybe_wrap_in_attr_dict(value) + except KeyError: + raise AttributeError(_missing_attr_error_message(attr_name)) + + def __repr__(self) -> str: + return repr(self.__nested_secrets__) + + def __setitem__(self, key: str, value: Any) -> NoReturn: + raise TypeError("Secrets does not support item assignment.") + + def __setattr__(self, key: str, value: Any) -> NoReturn: + raise TypeError("Secrets does not support attribute assignment.") + + def to_dict(self) -> dict[str, Any]: + return deepcopy(self.__nested_secrets__) + + +class Secrets(Mapping[str, Any]): + """A dict-like class that stores secrets. + Parses secrets.toml on-demand. Cannot be externally mutated. + + Safe to use from multiple threads. + """ + + def __init__(self) -> None: + # Our secrets dict. + self._secrets: Mapping[str, Any] | None = None + self._lock = threading.RLock() + self._file_watchers_installed = False + # Store programmatic secrets separately so they survive file-change reloads + self._programmatic_secrets: Mapping[str, SecretsValue] | None = None + + self.file_change_listener = Signal( + doc="Emitted when a `secrets.toml` file has been changed." + ) + + def load_if_toml_exists(self) -> bool: + """Load secrets.toml files from disk if they exists. If none exist, + no exception will be raised. (If a file exists but is malformed, + an exception *will* be raised.). + + Returns True if a secrets.toml file was successfully parsed, False otherwise. + + Thread-safe. + """ + try: + self._parse() + + return True + except StreamlitSecretNotFoundError: + # No secrets.toml files exist. That's fine. + return False + + def set_suppress_print_error_on_exception( + self, suppress_print_error_on_exception: bool + ) -> None: + """Left in place for compatibility with integrations until integration + code can be updated. + """ + + def _reset(self) -> None: + """Clear the secrets dictionary and remove any secrets that were + added to os.environ. + + Thread-safe. + """ + with self._lock: + if self._secrets is None: + return + + for k, v in self._secrets.items(): + self._maybe_delete_environment_variable(k, v) + self._secrets = None + + def _parse_toml_file(self, path: str) -> tuple[Mapping[str, Any], bool]: + """Parse a TOML file and return the secrets as a dictionary.""" + secrets = {} + found_secrets_file = False + + try: + with open(path, encoding="utf-8") as f: + secrets_file_str = f.read() + + found_secrets_file = True + except FileNotFoundError: + # the default config for secrets contains two paths. It's likely one of will not have secrets file. + return {}, False + + import toml + + try: + secrets.update(toml.loads(secrets_file_str)) + except (TypeError, toml.TomlDecodeError) as ex: + msg = ( + secret_error_messages_singleton.get_error_parsing_file_at_path_message( + path, ex + ) + ) + raise StreamlitSecretNotFoundError(msg) from ex + + return secrets, found_secrets_file + + def _parse_directory(self, path: str) -> tuple[Mapping[str, Any], bool]: + """Parse a directory for secrets. Directory style can be used to support Kubernetes secrets that are + mounted to folders. + + Example structure: + - top_level_secret_folder + - user_pass_secret (folder) + - username (file), content: myuser + - password (file), content: mypassword + - my_plain_secret (folder) + - regular_secret (file), content: mysecret + + See: https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#create-a-pod-that-has-access-to-the-secret-data-through-a-volume + And: https://docs.snowflake.com/en/developer-guide/snowpark-container-services/additional-considerations-services-jobs#passing-secrets-in-local-container-files + """ + secrets: dict[str, Any] = {} + found_secrets_file = False + + for dirname in os.listdir(path): + sub_folder_path = os.path.join(path, dirname) + if not os.path.isdir(sub_folder_path): + error_msg = secret_error_messages_singleton.get_subfolder_path_is_not_a_folder_message( + sub_folder_path + ) + raise StreamlitSecretNotFoundError(error_msg) + sub_secrets = {} + + for filename in os.listdir(sub_folder_path): + file_path = os.path.join(sub_folder_path, filename) + + # ignore folders + if os.path.isdir(file_path): + continue + + with open(file_path, encoding="utf-8") as f: + sub_secrets[filename] = f.read().strip() + found_secrets_file = True + + if len(sub_secrets) == 1: + # if there's just one file, collapse it so it's directly under `dirname` + secrets[dirname] = sub_secrets[next(iter(sub_secrets.keys()))] + else: + secrets[dirname] = sub_secrets + + return secrets, found_secrets_file + + def _parse_file_path(self, path: str) -> tuple[Mapping[str, Any], bool]: + if path.endswith(".toml"): + return self._parse_toml_file(path) + + if os.path.isdir(path): + return self._parse_directory(path) + + error_msg = secret_error_messages_singleton.get_invalid_secret_path_message( + path + ) + raise StreamlitSecretNotFoundError(error_msg) + + def _parse(self) -> Mapping[str, Any]: + """Parse our secrets.toml files if they're not already parsed. + This function is safe to call from multiple threads. + + Raises + ------ + StreamlitSecretNotFoundError + Raised if secrets.toml doesn't exist. + + """ + # Avoid taking a lock for the common case where secrets are already + # loaded. + secrets = self._secrets + if secrets is not None: + return secrets + + with self._lock: + if self._secrets is not None: + return self._secrets + + secrets = {} + + file_paths = config.get_option("secrets.files") + found_secrets_file = False + for path in file_paths: + path_secrets, found_secrets_file_in_path = self._parse_file_path(path) + found_secrets_file = found_secrets_file or found_secrets_file_in_path + secrets.update(path_secrets) + + if not found_secrets_file: + error_msg = ( + secret_error_messages_singleton.get_no_secrets_found_message( + file_paths + ) + ) + raise StreamlitSecretNotFoundError(error_msg) + + for k, v in secrets.items(): + self._maybe_set_environment_variable(k, v) + + self._secrets = secrets + self._maybe_install_file_watchers() + + return self._secrets + + def to_dict(self) -> dict[str, Any]: + """Converts the secrets store into a nested dictionary, where nested AttrDict objects are + also converted into dictionaries. + """ + secrets = self._parse() + return _convert_to_dict(secrets) + + def merge_programmatic_secrets( + self, programmatic_secrets: Mapping[str, SecretsValue] + ) -> None: + """Merge programmatic secrets into the secrets store. + + Programmatic secrets are shallow-merged with file-based secrets at the + top level: entire top-level keys are replaced, not individual nested keys. + + Parameters + ---------- + programmatic_secrets + A dictionary of secrets to merge. Supported value types are: + ``str``, ``int``, ``float``, ``bool``, ``list``, and nested ``dict``. + Lists and dicts are validated recursively, so their elements must + themselves be supported secrets types. + + Raises + ------ + TypeError + If any value in the dictionary has an unsupported type. + + Notes + ----- + This method is intended to be called once during application startup, + after file-based secrets have been loaded. It is thread-safe. + + Top-level ``str``, ``int``, and ``float`` values are promoted to + ``os.environ`` (as strings), matching the behavior of file-based secrets. + """ + # Validate all keys are strings and values have allowed types + _validate_secrets_value(dict(programmatic_secrets)) + + with self._lock: + # Store programmatic secrets so they survive file-change reloads + self._programmatic_secrets = programmatic_secrets + self._apply_programmatic_secrets(programmatic_secrets) + + def _apply_programmatic_secrets( + self, programmatic_secrets: Mapping[str, SecretsValue] + ) -> None: + """Apply programmatic secrets to the secrets store. + + This is an internal helper that merges the given programmatic secrets + into `self._secrets`. It does NOT store them in `_programmatic_secrets` + (that is the caller's responsibility). + + Must be called with `self._lock` held. + """ + # Create a mutable copy of current secrets + current_secrets: dict[str, Any] = ( + dict(self._secrets) if self._secrets is not None else {} + ) + + for key, value in programmatic_secrets.items(): + # Remove old environment variable if the key existed + if key in current_secrets: + self._maybe_delete_environment_variable(key, current_secrets[key]) + + # Shallow-merge: replace entire top-level key (deep copy to prevent + # external mutation) + current_secrets[key] = deepcopy(value) + + # Promote to os.environ if appropriate + self._maybe_set_environment_variable(key, value) + + self._secrets = current_secrets + + @staticmethod + def _maybe_set_environment_variable(k: Any, v: Any) -> None: + """Add the given key/value pair to os.environ if the value + is a string, int, or float. + """ + value_type = type(v) + if value_type in {str, int, float}: + os.environ[k] = str(v) + + @staticmethod + def _maybe_delete_environment_variable(k: Any, v: Any) -> None: + """Remove the given key/value pair from os.environ if the value + is a string, int, or float. + """ + value_type = type(v) + # Compare with str(v) since os.environ values are always strings + if value_type in {str, int, float} and os.environ.get(k) == str(v): + del os.environ[k] + + def _maybe_install_file_watchers(self) -> None: + with self._lock: + if self._file_watchers_installed: + return + + file_paths = config.get_option("secrets.files") + for path in file_paths: + try: + if path.endswith(".toml"): + streamlit.watcher.path_watcher.watch_file( + path, + self._on_secrets_changed, + watcher_type="poll", + ) + else: + streamlit.watcher.path_watcher.watch_dir( + path, + self._on_secrets_changed, + watcher_type="poll", + ) + except (StreamlitMaxRetriesError, FileNotFoundError): # noqa: PERF203 + # A user may only have one secrets.toml file defined, so we'd expect + # exceptions to be raised here when attempting to install a + # watcher on the nonexistent ones. + pass + + # We set file_watchers_installed to True even if the installation attempt + # failed to avoid repeatedly trying to install it. + self._file_watchers_installed = True + + def _on_secrets_changed(self, changed_file_path: str) -> None: + with self._lock: + _LOGGER.debug("Secret path %s changed, reloading", changed_file_path) + self._reset() + self._parse() + # Re-apply programmatic secrets so they survive file-change reloads + if self._programmatic_secrets: + self._apply_programmatic_secrets(self._programmatic_secrets) + + # Emit a signal to notify receivers that the `secrets.toml` file + # has been changed. + self.file_change_listener.send() + + def __getattr__(self, key: str) -> Any: + """Return the value with the given key. If no such key + exists, raise an AttributeError. + + Thread-safe. + """ + try: + value = self._parse()[key] + if not isinstance(value, Mapping): + return value + return AttrDict(value) + # We add FileNotFoundError since __getattr__ is expected to only raise + # AttributeError and mocking utilities expect that contract. + except (KeyError, FileNotFoundError): + raise AttributeError(_missing_attr_error_message(key)) + + def __getitem__(self, key: str) -> Any: + """Return the value with the given key. If no such key + exists, raise a KeyError. + + Thread-safe. + """ + try: + value = self._parse()[key] + if not isinstance(value, Mapping): + return value + return AttrDict(value) + except KeyError: + raise KeyError(_missing_key_error_message(key)) + + def __setattr__(self, key: str, value: Any) -> None: + # Allow internal attributes to be set + if key in { + "_secrets", + "_lock", + "_file_watchers_installed", + "_suppress_print_error_on_exception", + "_programmatic_secrets", + "file_change_listener", + "load_if_toml_exists", + }: + super().__setattr__(key, value) + else: + raise TypeError("Secrets does not support attribute assignment.") + + def __repr__(self) -> str: + # If the runtime is NOT initialized, it is a method call outside + # the streamlit app, so we avoid reading the secrets file as it may not exist. + # If the runtime is initialized, display the contents of the file and + # the file must already exist. + """A string representation of the contents of the dict. Thread-safe.""" + if not runtime.exists(): + return f"{self.__class__.__name__}" + return repr(self._parse()) + + def __len__(self) -> int: + """The number of entries in the dict. Thread-safe.""" + return len(self._parse()) + + def has_key(self, k: str) -> bool: + """True if the given key is in the dict. Thread-safe.""" + return k in self._parse() + + def keys(self) -> KeysView[str]: + """A view of the keys in the dict. Thread-safe.""" + return self._parse().keys() + + def values(self) -> ValuesView[Any]: + """A view of the values in the dict. Thread-safe.""" + return self._parse().values() + + def items(self) -> ItemsView[str, Any]: + """A view of the key-value items in the dict. Thread-safe.""" + return self._parse().items() + + def __contains__(self, key: Any) -> bool: + """True if the given key is in the dict. Thread-safe.""" + return key in self._parse() + + def __iter__(self) -> Iterator[str]: + """An iterator over the keys in the dict. Thread-safe.""" + return iter(self._parse()) + + +secrets_singleton: Final = Secrets() diff --git a/venv/Lib/site-packages/streamlit/runtime/session_manager.py b/venv/Lib/site-packages/streamlit/runtime/session_manager.py new file mode 100644 index 0000000000000000000000000000000000000000..d6d733a99de1153a73a44d42fc24e91f71afea45 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/session_manager.py @@ -0,0 +1,438 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +from abc import abstractmethod +from dataclasses import dataclass +from typing import TYPE_CHECKING, Protocol, cast, runtime_checkable + +if TYPE_CHECKING: + from collections.abc import Callable, Iterable, Mapping + + from streamlit.proto.ForwardMsg_pb2 import ForwardMsg + from streamlit.runtime.app_session import AppSession + from streamlit.runtime.script_data import ScriptData + from streamlit.runtime.scriptrunner.script_cache import ScriptCache + from streamlit.runtime.scriptrunner_utils.script_run_context import ( + OnScriptErrorHandler, + UserInfoType, + ) + from streamlit.runtime.uploaded_file_manager import UploadedFileManager + + +class SessionClientDisconnectedError(Exception): + """Raised by operations on a disconnected SessionClient.""" + + +@runtime_checkable +class ClientContext(Protocol): + """Context for the client WebSocket connection. + + Provides a consistent interface for accessing headers, cookies, and client + info from the initial WebSocket handshake. + """ + + @property + def headers(self) -> Iterable[tuple[str, str]]: + """All headers as (name, value) tuples. Headers may be repeated.""" + ... + + @property + def cookies(self) -> Mapping[str, str]: + """Cookies as a name-to-value mapping.""" + ... + + @property + def remote_ip(self) -> str | None: + """The remote IP address of the client, or None if unavailable.""" + ... + + +class SessionClient(Protocol): + """Interface for sending data to a session's client.""" + + @abstractmethod + def write_forward_msg(self, msg: ForwardMsg) -> None: + """Deliver a ForwardMsg to the client. + + If the SessionClient has been disconnected, it should raise a + SessionClientDisconnectedError. + """ + raise NotImplementedError # pragma: no cover - abstract + + @property + def client_context(self) -> ClientContext | None: + """The client's connection context (headers, cookies, IP). + + Returns None if request context information is not available. + """ + return None # pragma: no cover - abstract + + +@dataclass +class ActiveSessionInfo: + """Type containing data related to an active session. + + This type is nearly identical to SessionInfo. The difference is that when using it, + we are guaranteed that SessionClient is not None. + """ + + client: SessionClient + session: AppSession + # The number of times the script has been run for this session. + # At the moment, this is only used for testing and debugging purposes. + script_run_count: int = 0 + + +@dataclass +class SessionInfo: + """Type containing data related to an AppSession.""" + + client: SessionClient | None + session: AppSession + # The number of times the script has been run for this session. + # At the moment, this is only used for testing and debugging purposes. + script_run_count: int = 0 + + def is_active(self) -> bool: + return self.client is not None + + def to_active(self) -> ActiveSessionInfo: + if not self.is_active(): + raise RuntimeError("A SessionInfo with no client cannot be active!") + + # NOTE: The cast here (rather than copying this SessionInfo's fields into a new + # ActiveSessionInfo) is important as the Runtime expects to be able to mutate + # what's returned from get_active_session_info to increment script_run_count. + return cast("ActiveSessionInfo", self) + + +class SessionStorageError(Exception): + """Exception class for errors raised by SessionStorage. + + The original error that causes a SessionStorageError to be (re)raised will generally + be an I/O error specific to the concrete SessionStorage implementation. + """ + + +class SessionStorage(Protocol): + @abstractmethod + def get(self, session_id: str) -> SessionInfo | None: + """Return the SessionInfo corresponding to session_id, or None if one does not + exist. + + Parameters + ---------- + session_id + The unique ID of the session being fetched. + + Returns + ------- + SessionInfo or None + + Raises + ------ + SessionStorageError + Raised if an error occurs while attempting to fetch the session. This will + generally happen if there is an error with the underlying storage backend + (e.g. if we lose our connection to it). + """ + raise NotImplementedError # pragma: no cover - abstract + + @abstractmethod + def save(self, session_info: SessionInfo) -> None: + """Save the given session. + + Parameters + ---------- + session_info + The SessionInfo being saved. + + Raises + ------ + SessionStorageError + Raised if an error occurs while saving the given session. + """ + raise NotImplementedError # pragma: no cover - abstract + + @abstractmethod + def delete(self, session_id: str) -> None: + """Mark the session corresponding to session_id for deletion and stop tracking + it. + + Note that: + - Calling delete on an ID corresponding to a nonexistent session is a no-op. + - Calling delete on an ID should cause the given session to no longer be + tracked by this SessionStorage, but exactly when and how the session's data + is eventually cleaned up is a detail left up to the implementation. + + Parameters + ---------- + session_id + The unique ID of the session to delete. + + Raises + ------ + SessionStorageError + Raised if an error occurs while attempting to delete the session. + """ + raise NotImplementedError # pragma: no cover - abstract + + @abstractmethod + def list(self) -> list[SessionInfo]: # ty: ignore[invalid-type-form] + """List all sessions tracked by this SessionStorage. + + Returns + ------- + List[SessionInfo] + + Raises + ------ + SessionStorageError + Raised if an error occurs while attempting to list sessions. + """ + raise NotImplementedError # pragma: no cover - abstract + + +class SessionManager(Protocol): + """SessionManagers are responsible for encapsulating all session lifecycle behavior + that the Streamlit Runtime may care about. + + A SessionManager must define the following required methods: + - __init__ + - connect_session + - close_session + - get_session_info + - list_sessions + + SessionManager implementations may also choose to define the notions of active and + inactive sessions. The precise definitions of active/inactive are left to the + concrete implementation. SessionManagers that wish to differentiate between active + and inactive sessions should have the required methods listed above operate on *all* + sessions. Additionally, they should define the following methods for working with + active sessions: + - disconnect_session + - get_active_session_info + - is_active_session + - list_active_sessions + + When active session-related methods are left undefined, their default + implementations are the naturally corresponding required methods. + + The Runtime, unless there's a good reason to do otherwise, should generally work + with the active-session versions of a SessionManager's methods. There isn't currently + a need for us to be able to operate on inactive sessions stored in SessionStorage + outside of the SessionManager itself. However, it's highly likely that we'll + eventually have to do so, which is why the abstractions allow for this now. + + Notes + ----- + Threading: All SessionManager methods are *not* threadsafe -- they must be called + from the runtime's eventloop thread. + """ + + @abstractmethod + def __init__( + self, + session_storage: SessionStorage, + uploaded_file_manager: UploadedFileManager, + script_cache: ScriptCache, + message_enqueued_callback: Callable[[], None] | None, + on_script_error: OnScriptErrorHandler | None = None, + ) -> None: + """Initialize a SessionManager with the given SessionStorage. + + Parameters + ---------- + session_storage + The SessionStorage instance backing this SessionManager. + + uploaded_file_manager + Used to manage files uploaded by users via the Streamlit web client. + + script_cache + ScriptCache instance. Caches user script bytecode. + + message_enqueued_callback + A callback invoked after a message is enqueued to be sent to a web client. + + on_script_error + Callback to invoke when an uncaught exception occurs in user script code. + Returns True to suppress the default exception display, or False/None + to show the exception normally. + """ + raise NotImplementedError # pragma: no cover - abstract + + @abstractmethod + def connect_session( + self, + client: SessionClient, + script_data: ScriptData, + user_info: UserInfoType, + existing_session_id: str | None = None, + session_id_override: str | None = None, + ) -> str: + """Create a new session or connect to an existing one. + + Parameters + ---------- + client + A concrete SessionClient implementation for communicating with + the session's client. + script_data + Contains parameters related to running a script. + user_info + A dict that contains information about the session's user. For now, + it only (optionally) contains the user's email address. + + { + "email": "example@example.com" + } + existing_session_id + The ID of an existing session to reconnect to. If one is not provided, a new + session is created. Note that whether a SessionManager supports reconnecting + to an existing session is left up to the concrete SessionManager + implementation. Those that do not support reconnection should simply ignore + this argument. + session_id_override + The ID to assign to a new session being created with this method. Setting + this can be useful when the service that a Streamlit Runtime is running in + wants to tie the lifecycle of a Streamlit session to some other session-like + object that it manages. Only one of existing_session_id and + session_id_override should be set. + + Returns + ------- + str + The session's unique string ID. + """ + raise NotImplementedError # pragma: no cover - abstract + + @abstractmethod + def close_session(self, session_id: str) -> None: + """Close and completely delete the session with the given id. + + This function may be called multiple times for the same session, + which is not an error. (Subsequent calls just no-op.) + + Parameters + ---------- + session_id + The session's unique ID. + """ + raise NotImplementedError # pragma: no cover - abstract + + @abstractmethod + def get_session_info(self, session_id: str) -> SessionInfo | None: + """Return the SessionInfo for the given id, or None if no such session + exists. + + Parameters + ---------- + session_id + The session's unique ID. + + Returns + ------- + SessionInfo or None + """ + raise NotImplementedError # pragma: no cover - abstract + + @abstractmethod + def list_sessions(self) -> list[SessionInfo]: + """Return the SessionInfo for all sessions managed by this SessionManager. + + Returns + ------- + List[SessionInfo] + """ + raise NotImplementedError # pragma: no cover - abstract + + def num_sessions(self) -> int: + """Return the number of sessions tracked by this SessionManager. + + Subclasses of SessionManager shouldn't provide their own implementation of this + method without a *very* good reason. + + Returns + ------- + int + """ + return len(self.list_sessions()) + + # NOTE: The following methods only need to be overwritten when a concrete + # SessionManager implementation has a notion of active vs inactive sessions. + # If left unimplemented in a subclass, the default implementations of these methods + # call corresponding SessionManager methods in a natural way. + + def disconnect_session(self, session_id: str) -> None: + """Disconnect the given session. + + This method should be idempotent. + + Parameters + ---------- + session_id + The session's unique ID. + """ + self.close_session(session_id) + + def get_active_session_info(self, session_id: str) -> ActiveSessionInfo | None: + """Return the ActiveSessionInfo for the given id, or None if either no such + session exists or the session is not active. + + Parameters + ---------- + session_id + The active session's unique ID. + + Returns + ------- + ActiveSessionInfo or None + """ + session = self.get_session_info(session_id) + if session is None or not session.is_active(): + return None + return session.to_active() + + def is_active_session(self, session_id: str) -> bool: + """Return True if the given session exists and is active, False otherwise. + + Returns + ------- + bool + """ + return self.get_active_session_info(session_id) is not None + + def list_active_sessions(self) -> list[ActiveSessionInfo]: + """Return the session info for all active sessions tracked by this SessionManager. + + Returns + ------- + List[ActiveSessionInfo] + """ + return [s.to_active() for s in self.list_sessions()] + + def num_active_sessions(self) -> int: + """Return the number of active sessions tracked by this SessionManager. + + Subclasses of SessionManager shouldn't provide their own implementation of this + method without a *very* good reason. + + Returns + ------- + int + """ + return len(self.list_active_sessions()) diff --git a/venv/Lib/site-packages/streamlit/runtime/state/__init__.py b/venv/Lib/site-packages/streamlit/runtime/state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1f5e624918f8bf68242b37339a0ea0466b37c0bd --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/state/__init__.py @@ -0,0 +1,49 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from streamlit.runtime.state.common import ( + BindOption, + PersistStateOption, + WidgetArgs, + WidgetCallback, + WidgetKwargs, +) +from streamlit.runtime.state.query_params_proxy import QueryParamsProxy +from streamlit.runtime.state.safe_session_state import SafeSessionState +from streamlit.runtime.state.session_state import ( + SCRIPT_RUN_WITHOUT_ERRORS_KEY, + SessionState, + SessionStateStatProvider, +) +from streamlit.runtime.state.session_state_proxy import ( + SessionStateProxy, + get_session_state, +) +from streamlit.runtime.state.widgets import register_widget + +__all__ = [ + "SCRIPT_RUN_WITHOUT_ERRORS_KEY", + "BindOption", + "PersistStateOption", + "QueryParamsProxy", + "SafeSessionState", + "SessionState", + "SessionStateProxy", + "SessionStateStatProvider", + "WidgetArgs", + "WidgetCallback", + "WidgetKwargs", + "get_session_state", + "register_widget", +] diff --git a/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/__init__.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e14615af5658f4568134fafc1d640a75524c8cf Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/__init__.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/common.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/common.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..948897ad08c861f65b3e0ed489e2858ad0461986 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/common.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/presentation.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/presentation.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ad1183d93ad4e6dbd59915d7152758ec3d96bdb Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/presentation.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/query_params.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/query_params.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a8220f77e82f0e1409356943adc10741c3531156 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/query_params.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/query_params_proxy.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/query_params_proxy.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..08d40d974527573f379af3cb559ce5f9e34eabd0 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/query_params_proxy.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/safe_session_state.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/safe_session_state.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..86664188c3184f77a5b016492c80facdbcdd6ad8 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/safe_session_state.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/session_state.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/session_state.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54a90a33313e1a800e51ff7ff2eb13f52e2daa67 Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/session_state.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/session_state_proxy.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/session_state_proxy.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6a59b547c01a1f590fbe434e9574d1ec7088c68f Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/session_state_proxy.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/widgets.cpython-314.pyc b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/widgets.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a1375ed2f94d7d97ab6715d2a5850b7a78881fbc Binary files /dev/null and b/venv/Lib/site-packages/streamlit/runtime/state/__pycache__/widgets.cpython-314.pyc differ diff --git a/venv/Lib/site-packages/streamlit/runtime/state/common.py b/venv/Lib/site-packages/streamlit/runtime/state/common.py new file mode 100644 index 0000000000000000000000000000000000000000..446577638a44125671d89b714345bf944453cbe1 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/state/common.py @@ -0,0 +1,274 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +"""Functions and data structures shared by session_state.py and widgets.py.""" + +from __future__ import annotations + +from collections.abc import Callable +from dataclasses import dataclass, field +from typing import ( + TYPE_CHECKING, + Any, + Final, + Generic, + Literal, + TypeAlias, + TypeGuard, + TypeVar, + cast, + get_args, +) + +from streamlit import util +from streamlit.errors import ( + StreamlitAPIException, +) + +if TYPE_CHECKING: + from streamlit.runtime.state.session_state import SessionState + +GENERATED_ELEMENT_ID_PREFIX: Final = "$$ID" +TESTING_KEY = "$$STREAMLIT_INTERNAL_KEY_TESTING" + + +T = TypeVar("T") +T_co = TypeVar("T_co", covariant=True) + + +WidgetArgs: TypeAlias = tuple[Any, ...] | list[Any] +WidgetKwargs: TypeAlias = dict[str, Any] +WidgetCallback: TypeAlias = Callable[..., None] + +# Type for the bind parameter on widgets +# Currently only supports binding to query params +BindOption: TypeAlias = Literal["query-params"] | None + +# Type for the persist_state parameter on widgets. +# "page" keeps the widget value while it is not rendered on the same page. +# "session" keeps it for the whole session, including across page switches. +PersistStateOption: TypeAlias = Literal["page", "session"] | None + +# A deserializer receives the value from whatever field is set on the +# WidgetState proto, and returns a regular python value. A serializer +# receives a regular python value, and returns something suitable for +# a value field on WidgetState proto. They should be inverses. +WidgetDeserializer: TypeAlias = Callable[[Any], T] +WidgetSerializer: TypeAlias = Callable[[T], Any] + +# The array value field names are part of the larger set of possible value +# field names. See the explanation for said set below. The message types +# associated with these fields are distinguished by storing data in a `data` +# field in their messages, meaning they need special treatment in certain +# circumstances. Hence, they need their own, dedicated, sub-type. +ArrayValueFieldName: TypeAlias = Literal[ + "double_array_value", + "int_array_value", + "string_array_value", +] + +# A frozenset containing the allowed values of the ArrayValueFieldName type. +# Useful for membership checking. +_ARRAY_VALUE_FIELD_NAMES: Final = frozenset( + cast( + "tuple[ArrayValueFieldName, ...]", + # NOTE: get_args is not recursive, so this only works as long as + # ArrayValueFieldName remains flat. + get_args(ArrayValueFieldName), + ) +) + +# These are the possible field names that can be set in the `value` oneof-field +# of the WidgetState message (schema found in .proto/WidgetStates.proto). +# We need these as a literal type to ensure correspondence with the protobuf +# schema in certain parts of the python code. +# TODO(harahu): It would be preferable if this type was automatically derived +# from the protobuf schema, rather than manually maintained. Not sure how to +# achieve that, though. +ValueFieldName: TypeAlias = Literal[ + ArrayValueFieldName, + "arrow_value", + "bool_value", + "bytes_value", + "double_value", + "file_uploader_state_value", + "int_value", + "json_value", + "json_trigger_value", + "string_value", + "trigger_value", + "string_trigger_value", + "chat_input_value", +] + + +def is_array_value_field_name(obj: object) -> TypeGuard[ArrayValueFieldName]: + return obj in _ARRAY_VALUE_FIELD_NAMES + + +# Optional hook that allows a widget to customize how its value should be +# presented in `st.session_state` without altering the underlying stored value +# or callback semantics. The presenter receives the widget's base value and the +# SessionState instance in case it needs to access additional widget state. +WidgetValuePresenter: TypeAlias = Callable[[Any, "SessionState"], Any] + + +@dataclass(frozen=True) +class WidgetMetadata(Generic[T]): + """Metadata associated with a single widget. Immutable.""" + + id: str + deserializer: WidgetDeserializer[T] = field(repr=False) + serializer: WidgetSerializer[T] = field(repr=False) + value_type: ValueFieldName + + # An optional user-code callback invoked when the widget's value changes. + # Widget callbacks are called at the start of a script run, before the + # body of the script is executed. + callback: WidgetCallback | None = None + + # An optional dictionary of event names to user-code callbacks. These are + # invoked when the corresponding widget event occurs. Callbacks are called + # at the start of a script run, before the body of the script is executed. + # Right now, multiple callbacks are only supported for widgets with a + # `value_type` of `json_value` or `json_trigger_value`. The keys in this + # dictionary should correspond to keys in the widget's JSON state. + callbacks: dict[str, WidgetCallback] | None = None + callback_args: WidgetArgs | None = None + callback_kwargs: WidgetKwargs | None = None + + fragment_id: str | None = None + + # Optional presenter hook used for customizing the user-visible value in + # st.session_state. This is intended for advanced widgets (e.g. Custom + # Components v2) that need to synthesize a presentation-only value from + # multiple internal widget states. + presenter: WidgetValuePresenter | None = None + + # Optional binding for the widget's value to external state (e.g. query params) + bind: BindOption = None + + # Optional server-side persistence of the widget's value when it is not + # rendered. "page" keeps the value while on the same page; "session" keeps it + # for the whole session, including across page switches. None disables it. + persist_state: PersistStateOption = None + + # The list of valid formatted option strings for selection widgets. + # When set, _seed_widget_from_url validates URL values against this list and + # rejects any that aren't valid options (e.g., ?foo=invalid). Widgets with a fixed set + # of options (radio, selectbox) pass this; widgets that accept arbitrary values (selectbox + # with accept_new_options=True) should not, since any string is valid. + formatted_options: list[str] | None = None + + # Whether the widget can be cleared to an empty state (reflects widget's UI behavior). + # When True, an empty URL param (e.g., ?foo=) will seed the widget with an empty value. + # When False, an empty URL param will be ignored and the widget uses its default. + # Examples: + # - multiselect: always clearable (users can remove all selections) + # - checkbox: never clearable (always has a boolean value) + # - selectbox: clearable only if index=None (allows "no selection" state) + clearable: bool = False + + # Maximum number of elements allowed in array-valued widgets (e.g. multiselect + # max_selections). When set, _seed_widget_from_url truncates URL-seeded arrays + # that exceed this limit to the first max_array_length values, preventing URL + # params from triggering selection-count errors. + max_array_length: int | None = None + + # Whether duplicate values in URL array params are semantically valid for this + # widget. When False (default), _sanitize_url_array deduplicates URL values + # (e.g., ?tags=Red&tags=Red → ["Red"]) because the UI prevents duplicate + # selections (multiselect). When True, duplicates are preserved because the UI + # allows them (e.g., select_slider range mode: ?color=red&color=red is a valid + # zero-width range). + allow_url_duplicates: bool = False + + def __repr__(self) -> str: + return util.repr_(self) + + +@dataclass(frozen=True) +class RegisterWidgetResult(Generic[T_co]): + """Result returned by the `register_widget` family of functions/methods. + + Should be usable by widget code to determine what value to return, and + whether to update the UI. + + Parameters + ---------- + value : T_co + The widget's current value, or, in cases where the true widget value + could not be determined, an appropriate fallback value. + + This value should be returned by the widget call. + value_changed : bool + True if the widget's value is different from the value most recently + returned from the frontend. + + Implies an update to the frontend is needed. + incoming_serialized_value : str or None + The widget's stored serialized (wire) value as it entered this run, + captured before this run's serializer was applied. ``None`` for + non-string widgets or when no value is stored yet. Because it's the raw + wire form (not re-derived from the deserialized ``value``), callers can + reconcile a stored value against freshly computed state even when the + deserialized value is stale. + """ + + value: T_co + value_changed: bool + incoming_serialized_value: str | None = None + + @classmethod + def failure( + cls, deserializer: WidgetDeserializer[T_co] + ) -> RegisterWidgetResult[T_co]: + """The canonical way to construct a RegisterWidgetResult in cases + where the true widget value could not be determined. + """ + return cls(value=deserializer(None), value_changed=False) + + +def user_key_from_element_id(element_id: str) -> str | None: + """Return the user key portion of a element id, or None if the id does not + have a user key. + + TODO This will incorrectly indicate no user key if the user actually provides + "None" as a key, but we can't avoid this kind of problem while storing the + string representation of the no-user-key sentinel as part of the element id. + """ + user_key: str | None = element_id.split("-", maxsplit=2)[-1] + return None if user_key == "None" else user_key + + +def is_element_id(key: str) -> bool: + """True if the given session_state key has the structure of a element ID.""" + return key.startswith(GENERATED_ELEMENT_ID_PREFIX) + + +def is_keyed_element_id(key: str) -> bool: + """True if the given session_state key has the structure of a element ID + with a user_key. + """ + return is_element_id(key) and not key.endswith("-None") + + +def require_valid_user_key(key: str) -> None: + """Raise an Exception if the given user_key is invalid.""" + if key == "": + raise StreamlitAPIException("The `key` argument must be non-empty.") + if is_element_id(key): + raise StreamlitAPIException( + f"Keys beginning with {GENERATED_ELEMENT_ID_PREFIX} are reserved." + ) diff --git a/venv/Lib/site-packages/streamlit/runtime/state/presentation.py b/venv/Lib/site-packages/streamlit/runtime/state/presentation.py new file mode 100644 index 0000000000000000000000000000000000000000..069c1117dae8cc45a4b227348c6eb5e31e94f39e --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/state/presentation.py @@ -0,0 +1,85 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Final + +from streamlit.logger import get_logger + +_LOGGER: Final = get_logger(__name__) + +if TYPE_CHECKING: + from streamlit.runtime.state.session_state import SessionState + + +def apply_presenter( + session_state: SessionState, widget_id: str, base_value: Any +) -> Any: + """Return the user-visible value for a widget if it has a ``presenter``. + + If the widget's metadata defines a ``presenter`` callable, it is used to + transform the stored value into its presentation form. Any exception raised + while resolving metadata or invoking the presenter is swallowed and + ``base_value`` is returned, so presentation never interferes with core + behavior. + + Parameters + ---------- + session_state : SessionState + The current session state object that holds widget state and metadata. + widget_id : str + The identifier of the widget whose value is being presented. + base_value : Any + The raw value stored for the widget. + + Returns + ------- + Any + The value that should be shown to the user. + + Notes + ----- + Presentation is applied exclusively for user-facing access paths such as: + - `st.session_state[... ]` via `SessionState.__getitem__` + - `SessionState.filtered_state` + + Internal serialization paths (for example `WStates.as_widget_states()` and + `SessionState.get_widget_states()`) must operate on base (unpresented) + values to ensure stable and lossless serialization. Do not use + `apply_presenter` in serialization code paths. + """ + + try: + meta = session_state._get_widget_metadata(widget_id) + presenter = getattr(meta, "presenter", None) if meta is not None else None + if presenter is None: + return base_value + + # Ensure the presenter is callable to avoid silently failing on a + # TypeError when attempting to invoke a non-callable value. + if not callable(presenter): + _LOGGER.warning( + "Widget '%s' has a non-callable presenter (%r); returning base value.", + widget_id, + presenter, + ) + return base_value + try: + return presenter(base_value, session_state) + except Exception: + return base_value + except Exception: + # If metadata is unavailable or any other error occurs, degrade gracefully. + return base_value diff --git a/venv/Lib/site-packages/streamlit/runtime/state/query_params.py b/venv/Lib/site-packages/streamlit/runtime/state/query_params.py new file mode 100644 index 0000000000000000000000000000000000000000..f3b6fb107bc9ac4e377d5aa03242371184c8c5b5 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/state/query_params.py @@ -0,0 +1,930 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import math +from collections.abc import Iterable, Iterator, Mapping, MutableMapping +from dataclasses import dataclass, field +from datetime import date, datetime, time, timedelta, timezone +from typing import TYPE_CHECKING, Any, Final, cast +from urllib import parse + +from streamlit.errors import StreamlitAPIException, StreamlitQueryParamDictValueError +from streamlit.logger import get_logger +from streamlit.proto.ForwardMsg_pb2 import ForwardMsg +from streamlit.runtime.scriptrunner_utils.script_run_context import get_script_run_ctx + +if TYPE_CHECKING: + from _typeshed import SupportsKeysAndGetItem + +_LOGGER: Final = get_logger(__name__) + +QueryParamValue = str | Iterable[str] +QueryParamsInput = Mapping[str, QueryParamValue] | Iterable[tuple[str, QueryParamValue]] + + +EMBED_QUERY_PARAM: Final[str] = "embed" +EMBED_OPTIONS_QUERY_PARAM: Final[str] = "embed_options" +EMBED_QUERY_PARAMS_KEYS: Final[list[str]] = [ + EMBED_QUERY_PARAM, + EMBED_OPTIONS_QUERY_PARAM, +] + +# Protected parameters that cannot be bound to widgets +PROTECTED_QUERY_PARAMS: Final[frozenset[str]] = frozenset( + [EMBED_QUERY_PARAM, EMBED_OPTIONS_QUERY_PARAM] +) +_CLIENT_STATE_QUERY_STRING_MAX_LENGTH: Final[int] = 512 * 1024 # 512Ki characters +_CLIENT_STATE_QUERY_STRING_MAX_FIELDS: Final[int] = 1000 + + +def sanitize_query_string(query_string: str) -> str: + """Return an empty query string when client input exceeds safe limits.""" + if not query_string: + return "" + + if len(query_string) > _CLIENT_STATE_QUERY_STRING_MAX_LENGTH: + _LOGGER.warning( + "Ignoring query string with %d characters because it exceeds the " + "%d character limit.", + len(query_string), + _CLIENT_STATE_QUERY_STRING_MAX_LENGTH, + ) + return "" + + num_fields = query_string.count("&") + 1 + if num_fields > _CLIENT_STATE_QUERY_STRING_MAX_FIELDS: + _LOGGER.warning( + "Ignoring query string with %d parameters because it exceeds the " + "%d parameter limit.", + num_fields, + _CLIENT_STATE_QUERY_STRING_MAX_FIELDS, + ) + return "" + + return query_string + + +def _parse_query_string(query_string: str) -> dict[str, list[str]]: + """Parse a query string into a dict, ignoring input that exceeds safe limits.""" + query_string = sanitize_query_string(query_string) + if not query_string: + return {} + return parse.parse_qs(query_string, keep_blank_values=True) + + +@dataclass +class WidgetBinding: + """Represents a binding between a widget and a query parameter.""" + + widget_id: str + param_key: str + value_type: str # e.g., "bool_value", "string_value", etc. + script_hash: str # For MPA: identifies main vs page script + + +def _to_non_empty_list(value: str | list[str]) -> list[str]: + """Convert URL param value to list, filtering out empty strings. + + Empty strings are reserved to represent "cleared/empty" state, so they + are not valid as individual array elements. + """ + parts = list(value) if isinstance(value, list) else [value] + return [p for p in parts if p != ""] + + +def is_empty_url_value(value: str | list[str]) -> bool: + """Check if URL value represents an empty parameter (e.g., ?foo= with no value). + + Parameters + ---------- + value : str | list[str] + The URL parameter value(s). + + Returns + ------- + bool + True if all values are empty strings ("" or [""] or ["", ""], etc.). + Returns False for mixed values like ["a", ""] which contain valid data. + """ + if isinstance(value, list): + return len(value) > 0 and all(v == "" for v in value) + return value == "" + + +_UTC_EPOCH: Final = datetime(1970, 1, 1, tzinfo=timezone.utc) +_SECONDS_TO_MICROS: Final = 1000 * 1000 +_DAYS_TO_MICROS: Final = 24 * 60 * 60 * _SECONDS_TO_MICROS + +# Base date for time values must match slider.py's _time_to_datetime. +_TIME_BASE_DATE: Final = date(2000, 1, 1) + + +def _delta_to_micros(delta: timedelta) -> int: + # Uses component-based calculation instead of int(delta.total_seconds() * 1e6) + # to avoid floating-point precision loss on large timedeltas. + return ( + delta.microseconds + + delta.seconds * _SECONDS_TO_MICROS + + delta.days * _DAYS_TO_MICROS + ) + + +def _try_parse_iso_to_micros(s: str) -> float | None: + """Try to parse an ISO date/time/datetime string to microsecond timestamp. + + Supports the same ISO formats used by date/time slider URL parameters: + - DATE: ``YYYY-MM-DD`` + - TIME: ``HH:MM`` or ``HH:MM:SS`` + - DATETIME: ``YYYY-MM-DDTHH:MM`` or ``YYYY-MM-DDTHH:MM:SS`` + + Returns the microsecond float if parsing succeeds, or ``None`` if the + string doesn't match any recognized format. + """ + # Try datetime first (contains 'T' separator) + if "T" in s: + try: + dt = datetime.fromisoformat(s) + if dt.tzinfo is not None: + return None + return float(_delta_to_micros(dt.replace(tzinfo=timezone.utc) - _UTC_EPOCH)) + except ValueError: + return None + + # Try date (contains '-') + if "-" in s: + try: + d = date.fromisoformat(s) + dt = datetime.combine(d, time(), tzinfo=timezone.utc) + return float(_delta_to_micros(dt - _UTC_EPOCH)) + except ValueError: + return None + + # Try time (contains ':') + if ":" in s: + try: + t = time.fromisoformat(s) + if t.tzinfo is not None: + return None + dt = datetime.combine(_TIME_BASE_DATE, t, tzinfo=timezone.utc) + return float(_delta_to_micros(dt - _UTC_EPOCH)) + except ValueError: + return None + + return None + + +def parse_url_param(value: str | list[str], value_type: str) -> Any: + """Convert URL param to Python value based on WidgetState value type. + + Parameters + ---------- + value : str | list[str] + The URL parameter value(s). + value_type : str + The WidgetState value type (e.g., "bool_value", "string_value"). + + Returns + ------- + Any + The parsed Python value appropriate for the widget type. + For empty URL params (e.g., ?foo=): + - Array types return [] + - string_value returns "" (empty string is valid) + - Other types return None (signaling "cleared" state) + + Raises + ------ + ValueError + If the value cannot be parsed for the given type. + """ + # For single-value types, get the last value if it's a list + val = value[-1] if isinstance(value, list) else value + + # Handle empty string values (e.g., ?foo= in URL) + if is_empty_url_value(value): + match value_type: + case "string_array_value" | "int_array_value" | "double_array_value": + return [] # Empty array + case "string_value": + return "" # Empty string is a valid value for text inputs + case _: + # For other types (bool, int, double), empty signals "cleared" + return None + + match value_type: + case "bool_value": + lower_val = val.lower() + if lower_val == "true": + return True + if lower_val == "false": + return False + raise ValueError(f"Invalid boolean value: {val}") + case "int_value": + # Try to parse as int, but return string if it fails. + # This intentionally differs from double_value (which raises on failure) + # because int_value is used for selection widgets where URLs may contain + # human-readable option strings (e.g., ?fruit=apple instead of ?fruit=0). + # The deserializer will match the string against widget options. + try: + return int(val) + except ValueError: + return val + case "double_value": + return float(val) + case "string_value": + return val + case "string_array_value": + # Repeated params: ?foo=a&foo=b -> ["a", "b"] + # Note: Empty strings are filtered - "" is reserved for "cleared/empty" state + return _to_non_empty_list(value) + case "double_array_value": + # Repeated params: ?foo=1.5&foo=2.5 -> [1.5, 2.5] + # Strings kept for select_slider option matching; empty strings filtered + result_double: list[float | str] = [] + for part in _to_non_empty_list(value): + try: + result_double.append(float(part)) + except ValueError: # noqa: PERF203 + # Try ISO date/time/datetime parsing for date/time sliders. + # Converts human-readable ISO strings to microsecond floats. + micros = _try_parse_iso_to_micros(part) + if micros is not None: + result_double.append(micros) + else: + result_double.append(part) + return result_double + case "int_array_value": + # Repeated params: ?foo=1&foo=2 -> [1, 2] + # Strings kept for option matching (pills, etc.); empty strings filtered + result_int: list[int | str] = [] + for part in _to_non_empty_list(value): + try: + result_int.append(int(part)) + except ValueError: # noqa: PERF203 + result_int.append(part) + return result_int + case _: + # Unknown type, return as-is + return val + + +def _format_number_for_query_url(v: Any) -> str: + """Format a number for the query string (matches set_corrected_value rules). + + Examples: 5.0 -> "5", 5.5 -> "5.5", 5 -> "5". + NaN and Inf are returned via str() without int coercion. + """ + if isinstance(v, float) and math.isfinite(v) and v == int(v): + return str(int(v)) + return str(v) + + +def _coerce_value_for_query_url(value: Any, value_type: str) -> str | list[str]: + """Convert a widget/serializer value to the form stored in ``_query_params``.""" + if value_type in { + "string_array_value", + "int_array_value", + "double_array_value", + }: + if isinstance(value, (list, tuple)): + return [ + _format_number_for_query_url(v) + if value_type == "double_array_value" + else str(v) + for v in value + ] + return ( + _format_number_for_query_url(value) + if value_type == "double_array_value" + else str(value) + ) + if value_type == "bool_value" and isinstance(value, bool): + return str(value).lower() + return str(value) + + +@dataclass +class QueryParams(MutableMapping[str, str]): + """A lightweight wrapper of a dict that sends forwardMsgs when state changes. + It stores str keys with str and List[str] values. + + Also manages widget bindings to query parameters for the bind="query-params" feature. + """ + + _query_params: dict[str, list[str] | str] = field(default_factory=dict) + + # Widget binding registries + _bindings_by_param: dict[str, WidgetBinding] = field(default_factory=dict) + _bindings_by_widget: dict[str, WidgetBinding] = field(default_factory=dict) + + # Store initial query params from URL at page load for seeding session state + _initial_query_params: dict[str, list[str]] = field(default_factory=dict) + + def __iter__(self) -> Iterator[str]: + return iter( + key + for key in self._query_params + if key.lower() not in EMBED_QUERY_PARAMS_KEYS + ) + + def __getitem__(self, key: str) -> str: + """Retrieves a value for a given key in query parameters. + Returns the last item in a list or an empty string if empty. + If the key is not present, raise KeyError. + """ + if key.lower() in EMBED_QUERY_PARAMS_KEYS: + raise KeyError(missing_key_error_message(key)) + + try: + value = self._query_params[key] + if isinstance(value, list): + if len(value) == 0: + return "" + # Return the last value when multiple values exist + return value[-1] + return value + except KeyError: + raise KeyError(missing_key_error_message(key)) + + def __setitem__(self, key: str, value: str | Iterable[str]) -> None: + # Prevent direct manipulation of bound query params + if self.is_bound(key): + raise StreamlitAPIException( + f"Cannot directly set query parameter '{key}' - " + f"it is bound to a widget. Modify the widget value instead." + ) + self._set_item_internal(key, value) + self._send_query_param_msg() + + def _set_item_internal(self, key: str, value: str | Iterable[str]) -> None: + _set_item_in_dict(self._query_params, key, value) + + def __delitem__(self, key: str) -> None: + if key.lower() in EMBED_QUERY_PARAMS_KEYS: + raise KeyError(missing_key_error_message(key)) + # Prevent direct deletion of bound query params + if self.is_bound(key): + raise StreamlitAPIException( + f"Cannot directly delete query parameter '{key}' - " + f"it is bound to a widget. Modify the widget value instead." + ) + try: + del self._query_params[key] + self._send_query_param_msg() + except KeyError: + raise KeyError(missing_key_error_message(key)) + + def update( + self, + other: Iterable[tuple[str, str | Iterable[str]]] + | SupportsKeysAndGetItem[str, str | Iterable[str]] = (), + /, + **kwds: str, + ) -> None: + # This overrides the `update` provided by MutableMapping + # to ensure only one one ForwardMsg is sent. + + # Consume dict-like objects into a list upfront to avoid iterating twice + # (once for keys, once for values). This prevents potential issues if + # `other` is modified during iteration. + other_as_list: list[tuple[str, str | Iterable[str]]] + if hasattr(other, "keys") and hasattr(other, "__getitem__"): + other_dict = cast("SupportsKeysAndGetItem[str, str | Iterable[str]]", other) + keys = list(other_dict.keys()) + other_as_list = [(k, other_dict[k]) for k in keys] + else: + # other is an iterable of tuples - consume into list + other_as_list = list(other) + + # Collect all keys to check for bound params before making any changes + keys_to_update = [key for key, _ in other_as_list] + keys_to_update.extend(kwds.keys()) + + # Check for bound params + for key in keys_to_update: + if self.is_bound(key): + raise StreamlitAPIException( + f"Cannot directly set query parameter '{key}' - " + f"it is bound to a widget. Modify the widget value instead." + ) + + # Now apply the updates + for key, value in other_as_list: + self._set_item_internal(key, value) + for key, value in kwds.items(): + self._set_item_internal(key, value) + self._send_query_param_msg() + + def get_all(self, key: str) -> list[str]: + if key not in self._query_params or key.lower() in EMBED_QUERY_PARAMS_KEYS: + return [] + value = self._query_params[key] + return value if isinstance(value, list) else [value] + + def __len__(self) -> int: + return len( + { + key + for key in self._query_params + if key.lower() not in EMBED_QUERY_PARAMS_KEYS + } + ) + + def __str__(self) -> str: + return str(self._query_params) + + def _send_query_param_msg(self) -> None: + ctx = get_script_run_ctx() + if ctx is None: + return + + msg = ForwardMsg() + msg.page_info_changed.query_string = parse.urlencode( + self._query_params, doseq=True + ) + ctx.query_string = msg.page_info_changed.query_string + ctx.enqueue(msg) + + def clear(self) -> None: + # Check if any bound params exist + bound_params = [key for key in self._query_params if self.is_bound(key)] + if bound_params: + raise StreamlitAPIException( + f"Cannot clear query parameters - the following are bound to widgets: " + f"{', '.join(repr(k) for k in bound_params)}. " + f"Modify the widget values instead, or remove the bind parameter." + ) + self.clear_with_no_forward_msg(preserve_embed=True) + self._send_query_param_msg() + + def to_dict(self) -> dict[str, str]: + # return the last query param if multiple values are set + return { + key: self[key] + for key in self._query_params + if key.lower() not in EMBED_QUERY_PARAMS_KEYS + } + + def from_dict( + self, + _dict: Iterable[tuple[str, str | Iterable[str]]] + | SupportsKeysAndGetItem[str, str | Iterable[str]], + ) -> None: + old_value = self._query_params.copy() + self.clear_with_no_forward_msg(preserve_embed=True) + try: + self.update(_dict) + except StreamlitAPIException: + # restore the original from before we made any changes. + self._query_params = old_value + raise + + def set_with_no_forward_msg(self, key: str, val: list[str] | str) -> None: + self._query_params[key] = val + + def clear_with_no_forward_msg(self, preserve_embed: bool = False) -> None: + self._query_params = { + key: value + for key, value in self._query_params.items() + if key.lower() in EMBED_QUERY_PARAMS_KEYS and preserve_embed + } + + def bind_widget( + self, + param_key: str, + widget_id: str, + value_type: str, + script_hash: str, + ) -> None: + """Register a widget binding to a query parameter. + + If another widget was previously bound to this param_key, its binding + is replaced. The old widget's entry in _bindings_by_widget is cleaned up + to prevent orphaned references. + + Parameters + ---------- + param_key : str + The query parameter key (same as the widget's user key). + widget_id : str + The unique widget ID. + value_type : str + The WidgetState value type (e.g., "bool_value", "string_value"). + script_hash : str + The script hash for MPA support. + + Raises + ------ + StreamlitAPIException + If the parameter is protected (embed, embed_options). + """ + if param_key.lower() in PROTECTED_QUERY_PARAMS: + raise StreamlitAPIException( + f"Cannot bind to reserved query parameter '{param_key}'. " + f"'{EMBED_QUERY_PARAM}' and '{EMBED_OPTIONS_QUERY_PARAM}' are " + f"used internally for Streamlit's embed functionality." + ) + + # Clean up old binding if a different widget was bound to this param + old_binding = self._bindings_by_param.get(param_key) + if old_binding and old_binding.widget_id != widget_id: + self._bindings_by_widget.pop(old_binding.widget_id, None) + + binding = WidgetBinding( + widget_id=widget_id, + param_key=param_key, + value_type=value_type, + script_hash=script_hash, + ) + self._bindings_by_param[param_key] = binding + self._bindings_by_widget[widget_id] = binding + + def unbind_widget(self, widget_id: str) -> None: + """Remove a widget binding. + + Parameters + ---------- + widget_id : str + The unique widget ID. + """ + binding = self._bindings_by_widget.pop(widget_id, None) + if binding: + self._bindings_by_param.pop(binding.param_key, None) + + def unbind_and_clear_param(self, widget_id: str) -> None: + """Remove a widget binding and its associated query param from the URL. + + Unlike ``unbind_widget`` which only removes the internal tracking, this + method also deletes the query parameter value and sends a forward + message so the frontend URL is updated. It is a no-op when no binding + exists for *widget_id*. + + Parameters + ---------- + widget_id : str + The unique widget ID. + """ + binding = self._bindings_by_widget.get(widget_id) + if binding is None: + return + + param_key = binding.param_key + self.unbind_widget(widget_id) + if param_key in self._query_params: + del self._query_params[param_key] + self._send_query_param_msg() + + def is_bound(self, param_key: str) -> bool: + """Check if a query parameter is bound to a widget. + + Note: This check is case-sensitive, meaning "Foo" and "foo" are treated + as different parameters. This is intentional because Python keys are + case-sensitive and users explicitly choose their parameter names via + the widget's `key` argument. This differs from embed parameter checks + which are case-insensitive for URL compatibility. + + Parameters + ---------- + param_key : str + The query parameter key (case-sensitive). + + Returns + ------- + bool + True if the parameter is bound to a widget. + """ + return param_key in self._bindings_by_param + + def get_binding_for_param(self, param_key: str) -> WidgetBinding | None: + """Get the binding for a query parameter. + + Parameters + ---------- + param_key : str + The query parameter key. + + Returns + ------- + WidgetBinding | None + The binding if found, None otherwise. + """ + return self._bindings_by_param.get(param_key) + + def get_binding_for_widget(self, widget_id: str) -> WidgetBinding | None: + """Get the binding for a widget. + + Parameters + ---------- + widget_id : str + The unique widget ID. + + Returns + ------- + WidgetBinding | None + The binding if found, None otherwise. + """ + return self._bindings_by_widget.get(widget_id) + + def has_param(self, param_key: str) -> bool: + """Return whether a query parameter currently exists.""" + return param_key in self._query_params + + def remove_param(self, param_key: str) -> bool: + """Remove a query parameter without protection checks. + + This is an internal method for use by SessionState when clearing + invalid URL-seeded values. It bypasses the bound param protection + since the binding system itself needs to clear these values. + + Parameters + ---------- + param_key : str + The query parameter key to remove. + + Returns + ------- + bool + True if the param was removed, False if it didn't exist. + """ + if param_key in self._query_params: + del self._query_params[param_key] + self._send_query_param_msg() + return True + return False + + def discard_param_no_forward_msg(self, param_key: str) -> bool: + """Remove a query parameter without sending a forward message. + + This is used for backend-only cache cleanup when the frontend URL has + already removed the parameter (for example, default-value collapse on a + same-page rerun). + """ + if param_key in self._query_params: + del self._query_params[param_key] + return True + return False + + def set_initial_query_params(self, query_string: str) -> None: + """Store the initial query params from the URL for session state seeding. + + Parameters + ---------- + query_string : str + The URL query string (without the leading '?'). + """ + parsed = _parse_query_string(query_string) + self._initial_query_params = parsed + + def set_initial_query_params_from_current(self) -> None: + """Set _initial_query_params from the current filtered _query_params. + + This is called after MPA page transitions where populate_from_query_string() + has filtered out params bound to widgets on other pages. Using this ensures + widget seeding only uses params that are valid for the current page, preventing + stale values from previous pages from leaking through. + """ + # Convert _query_params to the list format used by _initial_query_params + # (parse_qs returns dict[str, list[str]]) + self._initial_query_params = { + k: v if isinstance(v, list) else [v] for k, v in self._query_params.items() + } + + def get_initial_value(self, param_key: str) -> str | list[str] | None: + """Get the initial URL value for a query parameter. + + This is used for seeding session state on initial page load. + + Parameters + ---------- + param_key : str + The query parameter key. + + Returns + ------- + str | list[str] | None + The initial value(s) if present, None otherwise. + """ + values = self._initial_query_params.get(param_key) + if values is None: + return None + if len(values) == 1: + return values[0] + return values + + def stored_param_matches_corrected_value( + self, param_key: str, value: Any, value_type: str + ) -> bool: + """Return True if the stored URL param equals ``set_corrected_value`` output. + + Used to skip redundant ``page_info_changed`` messages when programmatic + session state already matches the backend query-param snapshot. + """ + if param_key not in self._query_params: + return False + coerced = _coerce_value_for_query_url(value, value_type) + return coerced == self._query_params[param_key] + + def set_corrected_value(self, param_key: str, value: Any, value_type: str) -> None: + """Set a corrected value for a query parameter. + + This is called when URL auto-correction is needed (e.g., after clamping + a value to min/max bounds). It updates both the internal query params + and sends a forward message to update the frontend URL. + + Parameters + ---------- + param_key : str + The query parameter key. + value : Any + The corrected value to set. + value_type : str + The WidgetState value type (e.g., "double_value", "int_value"). + """ + self._query_params[param_key] = _coerce_value_for_query_url(value, value_type) + self._send_query_param_msg() + + # Keep alias for compatibility with existing internal call sites/tests. + def _set_corrected_value(self, param_key: str, value: Any, value_type: str) -> None: + self.set_corrected_value(param_key, value, value_type) + + def populate_from_query_string( + self, + query_string: str, + valid_script_hashes: set[str] | None = None, + ) -> None: + """Populate query params from a URL query string. + + Clears current params and repopulates from the URL. When valid_script_hashes + is provided (for MPA page transitions), filters out params bound to other pages. + + Parameters + ---------- + query_string : str + The raw query string from the URL (e.g., "foo=bar&baz=qux"). + valid_script_hashes : set[str] | None + If provided, only keep params that are: + - Unbound (no widget binding) + - Bound to a widget with script_hash in this set + Params bound to other pages are filtered out. + If None, all params are kept (no filtering). + """ + parsed_query_params = _parse_query_string(query_string) + + self.clear_with_no_forward_msg() + stale_widget_ids: list[str] = [] + + for key, val in parsed_query_params.items(): + binding = self._bindings_by_param.get(key) + should_keep = True + + # If filtering is enabled, check if this param should be filtered out + if ( + valid_script_hashes is not None + and binding is not None + and binding.script_hash not in valid_script_hashes + ): + # Binding from a different page - filter it out + stale_widget_ids.append(binding.widget_id) + should_keep = False + + if should_keep: + if len(val) == 0: + self.set_with_no_forward_msg(key, val="") + elif len(val) == 1: + self.set_with_no_forward_msg(key, val=val[-1]) + else: + self.set_with_no_forward_msg(key, val) + + # Clean up bindings for widgets from other pages + for widget_id in stale_widget_ids: + self.unbind_widget(widget_id) + + # Update frontend URL if we filtered out any params + if stale_widget_ids: + self._send_query_param_msg() + + def remove_stale_bindings( + self, + active_widget_ids: frozenset[str], + fragment_ids_this_run: list[str] | None = None, + widget_metadata: dict[str, Any] | None = None, + ) -> None: + """Remove bindings and URL params for widgets that are no longer active. + + This cleans up query params for conditional widgets that have been unmounted. + For fragment runs, widgets outside the running fragment(s) are preserved. + + Note: Page-based cleanup for MPA navigation is handled separately via + populate_from_query_string() which is called before the script runs. + + Parameters + ---------- + active_widget_ids : frozenset[str] + Set of widget IDs that are currently active/rendered. + fragment_ids_this_run : list[str] | None + List of fragment IDs being run, or None for full script runs. + widget_metadata : dict[str, Any] | None + Widget metadata dict to check fragment IDs. + """ + stale_widget_ids = [] + for widget_id in self._bindings_by_widget: + if widget_id in active_widget_ids: + # Widget is active in this run - keep it + continue + + # For fragment runs, preserve widgets that aren't part of the running fragments + if fragment_ids_this_run and widget_metadata: + metadata = widget_metadata.get(widget_id) + if metadata and metadata.fragment_id not in fragment_ids_this_run: + # Widget belongs to a different fragment or main script - keep it + continue + + stale_widget_ids.append(widget_id) + + params_removed = False + for widget_id in stale_widget_ids: + binding = self._bindings_by_widget.get(widget_id) + if binding: + param_key = binding.param_key + # Remove the query param from the URL + if param_key in self._query_params: + del self._query_params[param_key] + params_removed = True + self.unbind_widget(widget_id) + + # Send forward message to update frontend URL if we removed any params + if params_removed: + self._send_query_param_msg() + + +def missing_key_error_message(key: str) -> str: + return f'st.query_params has no key "{key}".' + + +def _set_item_in_dict( + target_dict: dict[str, list[str] | str], key: str, value: str | Iterable[str] +) -> None: + """Set an item in a dictionary.""" + if isinstance(value, dict): + raise StreamlitQueryParamDictValueError(key) + + if key.lower() in EMBED_QUERY_PARAMS_KEYS: + raise StreamlitAPIException( + "Query param embed and embed_options (case-insensitive) cannot be set programmatically." + ) + # Type checking users should handle the string serialization themselves + # We will accept any type for the list and serialize to str just in case + if isinstance(value, Iterable) and not isinstance(value, str): + target_dict[key] = [str(item) for item in value] + else: + target_dict[key] = str(value) + + +def process_query_params( + query_params: Iterable[tuple[str, str | Iterable[str]]] + | SupportsKeysAndGetItem[str, str | Iterable[str]], +) -> str: + """Convert query params into a URL-encoded query string.""" + processed_params: dict[str, list[str] | str] = {} + + if hasattr(query_params, "keys") and hasattr(query_params, "__getitem__"): + query_params = cast( + "SupportsKeysAndGetItem[str, str | Iterable[str]]", query_params + ) + for key in query_params.keys(): # noqa: SIM118 + value = query_params[key] + _set_item_in_dict(processed_params, key, value) + else: + for key, value in query_params: + if key in processed_params: + # If the key already exists, we need to accumulate the values. + if isinstance(value, dict): + raise StreamlitQueryParamDictValueError(key) + + current_val = processed_params[key] + if not isinstance(current_val, list): + current_val = [current_val] + + if isinstance(value, Iterable) and not isinstance(value, str): + current_val.extend([str(item) for item in value]) + else: + current_val.append(str(value)) + + processed_params[key] = current_val + else: + _set_item_in_dict(processed_params, key, value) + + return parse.urlencode(processed_params, doseq=True) diff --git a/venv/Lib/site-packages/streamlit/runtime/state/query_params_proxy.py b/venv/Lib/site-packages/streamlit/runtime/state/query_params_proxy.py new file mode 100644 index 0000000000000000000000000000000000000000..53929629c6da351470a70236e19a29ae9a578a88 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/state/query_params_proxy.py @@ -0,0 +1,216 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +from collections.abc import Iterable, Iterator, MutableMapping +from typing import TYPE_CHECKING, Any, overload + +from streamlit.runtime.metrics_util import gather_metrics +from streamlit.runtime.state.session_state_proxy import get_session_state + +if TYPE_CHECKING: + from _typeshed import SupportsKeysAndGetItem + + +class QueryParamsProxy(MutableMapping[str, str]): + """ + A stateless singleton that proxies ``st.query_params`` interactions + to the current script thread's QueryParams instance. + """ + + def __iter__(self) -> Iterator[str]: + with get_session_state().query_params() as qp: + return iter(qp) + + def __len__(self) -> int: + with get_session_state().query_params() as qp: + return len(qp) + + def __str__(self) -> str: + with get_session_state().query_params() as qp: + return str(qp) + + @gather_metrics("query_params.get_item") + def __getitem__(self, key: str) -> str: + with get_session_state().query_params() as qp: + try: + return qp[key] + except KeyError: + raise KeyError(self.missing_key_error_message(key)) + + def __delitem__(self, key: str) -> None: + with get_session_state().query_params() as qp: + del qp[key] + + @gather_metrics("query_params.set_item") + def __setitem__(self, key: str, value: Any) -> None: + with get_session_state().query_params() as qp: + qp[key] = value + + @gather_metrics("query_params.get_attr") + def __getattr__(self, key: str) -> str: + with get_session_state().query_params() as qp: + try: + return qp[key] + except KeyError: + raise AttributeError(self.missing_attr_error_message(key)) + + def __delattr__(self, key: str) -> None: + with get_session_state().query_params() as qp: + try: + del qp[key] + except KeyError: + raise AttributeError(self.missing_key_error_message(key)) + + @overload + def update( + self, params: SupportsKeysAndGetItem[str, str | Iterable[str]], /, **kwds: str + ) -> None: ... + + @overload + def update( + self, params: Iterable[tuple[str, str | Iterable[str]]], /, **kwds: str + ) -> None: ... + + @overload + def update(self, /, **kwds: str | Iterable[str]) -> None: ... + + def update(self, params=(), /, **kwds) -> None: # type: ignore + """ + Update one or more values in query_params at once from a dictionary or + dictionary-like object. + + See `Mapping.update()` from Python's `collections` library. + + Parameters + ---------- + other: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]] + A dictionary or mapping of strings to strings. + **kwds: str + Additional key/value pairs to update passed as keyword arguments. + """ + with get_session_state().query_params() as qp: + qp.update(params, **kwds) + + @gather_metrics("query_params.set_attr") + def __setattr__(self, key: str, value: Any) -> None: + with get_session_state().query_params() as qp: + qp[key] = value + + @gather_metrics("query_params.get_all") + def get_all(self, key: str) -> list[str]: + """ + Get a list of all query parameter values associated to a given key. + + When a key is repeated as a query parameter within the URL, this method + allows all values to be obtained. In contrast, dict-like methods only + retrieve the last value when a key is repeated in the URL. + + Parameters + ---------- + key: str + The label of the query parameter in the URL. + + Returns + ------- + List[str] + A list of values associated to the given key. May return zero, one, + or multiple values. + """ + with get_session_state().query_params() as qp: + return qp.get_all(key) + + @gather_metrics("query_params.clear") + def clear(self) -> None: + """Clear all query parameters from the URL of the app.""" + with get_session_state().query_params() as qp: + qp.clear() + + @gather_metrics("query_params.to_dict") + def to_dict(self) -> dict[str, str]: + """ + Get all query parameters as a dictionary. + + This method primarily exists for internal use and is not needed for + most cases. ``st.query_params`` returns an object that inherits from + ``dict`` by default. + + When a key is repeated as a query parameter within the URL, this method + will return only the last value of each unique key. + + Returns + ------- + Dict[str,str] + A dictionary of the current query parameters in the app's URL. + """ + with get_session_state().query_params() as qp: + return qp.to_dict() + + @overload + def from_dict(self, params: Iterable[tuple[str, str | Iterable[str]]]) -> None: ... + + @overload + def from_dict( + self, params: SupportsKeysAndGetItem[str, str | Iterable[str]] + ) -> None: ... + + @gather_metrics("query_params.from_dict") + def from_dict( + self, + params: SupportsKeysAndGetItem[str, str | Iterable[str]] + | Iterable[tuple[str, str | Iterable[str]]], + ) -> None: + """ + Set all of the query parameters from a dictionary or dictionary-like object. + + This method primarily exists for advanced users who want to control + multiple query parameters in a single update. To set individual query + parameters, use key or attribute notation instead. + + This method inherits limitations from ``st.query_params`` and can't be + used to set embedding options as described in `Embed your app \ + `_. + + To handle repeated keys, the value in a key-value pair should be a list. + + .. note:: + ``.from_dict()`` is not a direct inverse of ``.to_dict()`` if + you are working with repeated keys. A true inverse operation is + ``{key: st.query_params.get_all(key) for key in st.query_params}``. + + Parameters + ---------- + params: dict + A dictionary used to replace the current query parameters. + + Examples + -------- + >>> import streamlit as st + >>> + >>> st.query_params.from_dict({"foo": "bar", "baz": [1, "two"]}) + + """ + with get_session_state().query_params() as qp: + return qp.from_dict(params) + + @staticmethod + def missing_key_error_message(key: str) -> str: + """Returns a formatted error message for missing keys.""" + return f'st.query_params has no key "{key}".' + + @staticmethod + def missing_attr_error_message(key: str) -> str: + """Returns a formatted error message for missing attributes.""" + return f'st.query_params has no attribute "{key}".' diff --git a/venv/Lib/site-packages/streamlit/runtime/state/safe_session_state.py b/venv/Lib/site-packages/streamlit/runtime/state/safe_session_state.py new file mode 100644 index 0000000000000000000000000000000000000000..3b0d83360f357757daca35a90417b0d00b7ba128 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/state/safe_session_state.py @@ -0,0 +1,146 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import threading +from contextlib import contextmanager +from typing import TYPE_CHECKING, Any + +if TYPE_CHECKING: + from collections.abc import Callable, Iterator + + from streamlit.proto.WidgetStates_pb2 import WidgetState as WidgetStateProto + from streamlit.proto.WidgetStates_pb2 import WidgetStates as WidgetStatesProto + from streamlit.runtime.state.common import RegisterWidgetResult, T, WidgetMetadata + from streamlit.runtime.state.query_params import QueryParams + from streamlit.runtime.state.session_state import SessionState + + +class SafeSessionState: + """Thread-safe wrapper around SessionState. + + When AppSession gets a re-run request, it can interrupt its existing + ScriptRunner and spin up a new ScriptRunner to handle the request. + When this happens, the existing ScriptRunner will continue executing + its script until it reaches a yield point - but during this time, it + must not mutate its SessionState. + """ + + _state: SessionState + _lock: threading.RLock + _yield_callback: Callable[[], None] + + def __init__(self, state: SessionState, yield_callback: Callable[[], None]) -> None: + # Fields must be set using the object's setattr method to avoid + # infinite recursion from trying to look up the fields we're setting. + object.__setattr__(self, "_state", state) + # TODO: we'd prefer this be a threading.Lock instead of RLock - + # but `call_callbacks` first needs to be rewritten. + object.__setattr__(self, "_lock", threading.RLock()) + object.__setattr__(self, "_yield_callback", yield_callback) + + def register_widget( + self, metadata: WidgetMetadata[T], user_key: str | None + ) -> RegisterWidgetResult[T]: + self._yield_callback() + with self._lock: + return self._state.register_widget(metadata, user_key) + + def on_script_will_rerun(self, latest_widget_states: WidgetStatesProto) -> None: + self._yield_callback() + with self._lock: + # TODO: rewrite this to copy the callbacks list into a local + # variable so that we don't need to hold our lock for the + # duration. (This will also allow us to downgrade our RLock + # to a Lock.) + self._state.on_script_will_rerun(latest_widget_states) + + def on_script_finished(self, widget_ids_this_run: frozenset[str]) -> None: + with self._lock: + self._state.on_script_finished(widget_ids_this_run) + + def maybe_check_serializable(self) -> None: + with self._lock: + self._state.maybe_check_serializable() + + def get_widget_states(self) -> list[WidgetStateProto]: + """Return a list of serialized widget values for each widget with a value.""" + with self._lock: + return self._state.get_widget_states() + + def is_new_state_value(self, user_key: str) -> bool: + with self._lock: + return self._state.is_new_state_value(user_key) + + def reset_state_value(self, user_key: str, value: Any | None) -> None: + """Reset a new session state value to a given value + without triggering the "state value cannot be modified" error. + """ + self._yield_callback() + with self._lock: + self._state.reset_state_value(user_key, value) + + @property + def filtered_state(self) -> dict[str, Any]: + """The combined session and widget state, excluding keyless widgets.""" + with self._lock: + return self._state.filtered_state + + def __getitem__(self, key: str) -> Any: + self._yield_callback() + with self._lock: + return self._state[key] + + def __setitem__(self, key: str, value: Any) -> None: + self._yield_callback() + with self._lock: + self._state[key] = value + + def __delitem__(self, key: str) -> None: + self._yield_callback() + with self._lock: + del self._state[key] + + def __contains__(self, key: str) -> bool: + self._yield_callback() + with self._lock: + return key in self._state + + def __getattr__(self, key: str) -> Any: + try: + return self[key] + except KeyError: + raise AttributeError(f"{key} not found in session_state.") + + def __setattr__(self, key: str, value: Any) -> None: + self[key] = value + + def __delattr__(self, key: str) -> None: + try: + del self[key] + except KeyError: + raise AttributeError(f"{key} not found in session_state.") + + def __repr__(self) -> str: + """Presents itself as a simple dict of the underlying SessionState instance.""" + kv = ((k, self._state[k]) for k in self._state._keys()) + s = ", ".join(f"{k}: {v!r}" for k, v in kv) + return f"{{{s}}}" + + @contextmanager + def query_params(self) -> Iterator[QueryParams]: + self._yield_callback() + with self._lock: + yield self._state.query_params diff --git a/venv/Lib/site-packages/streamlit/runtime/state/session_state.py b/venv/Lib/site-packages/streamlit/runtime/state/session_state.py new file mode 100644 index 0000000000000000000000000000000000000000..585ea281428f41293473b1d95891047407e708ef --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/state/session_state.py @@ -0,0 +1,1684 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import json +import pickle # noqa: S403 +from collections.abc import ( + Callable, + Iterator, + KeysView, + Mapping, + MutableMapping, + Sequence, +) +from copy import deepcopy +from dataclasses import dataclass, field, replace +from typing import ( + TYPE_CHECKING, + Any, + Final, + Literal, + TypeAlias, + cast, +) + +from streamlit import config, util +from streamlit.delta_generator_singletons import get_dg_singleton_instance +from streamlit.errors import StreamlitAPIException, UnserializableSessionStateError +from streamlit.logger import get_logger +from streamlit.proto.WidgetStates_pb2 import WidgetState as WidgetStateProto +from streamlit.proto.WidgetStates_pb2 import WidgetStates as WidgetStatesProto +from streamlit.runtime.runtime_util import ( + WidgetStateSizeError, + get_max_widget_state_size_bytes, +) +from streamlit.runtime.scriptrunner_utils.script_run_context import ( + ThreadState, + get_script_run_ctx, +) +from streamlit.runtime.state.common import ( + RegisterWidgetResult, + T, + ValueFieldName, + WidgetArgs, + WidgetCallback, + WidgetMetadata, + is_array_value_field_name, + is_element_id, + is_keyed_element_id, +) +from streamlit.runtime.state.presentation import apply_presenter +from streamlit.runtime.state.query_params import ( + QueryParams, + is_empty_url_value, + parse_url_param, +) +from streamlit.runtime.stats import ( + CACHE_MEMORY_FAMILY, + CacheStat, + StatsProvider, + group_cache_stats, +) + +_LOGGER: Final = get_logger(__name__) + +if TYPE_CHECKING: + from streamlit.runtime.session_manager import SessionManager + + +STREAMLIT_INTERNAL_KEY_PREFIX: Final = "$$STREAMLIT_INTERNAL_KEY" +SCRIPT_RUN_WITHOUT_ERRORS_KEY: Final = ( + f"{STREAMLIT_INTERNAL_KEY_PREFIX}_SCRIPT_RUN_WITHOUT_ERRORS" +) + + +def _sanitize_url_array( + parsed: list[str], + *, + valid_options: list[str] | None, + max_length: int | None, + allow_duplicates: bool = False, +) -> list[str] | None: + """Sanitize a URL-parsed string array by filtering invalid values, + optionally removing duplicates, and enforcing a maximum length. + + Returns the sanitized list if any changes were made, or None if the + input required no sanitization. + """ + result = parsed + + # Remove values not in the valid options list. + if valid_options is not None: + result = [v for v in result if v in valid_options] + + # Deduplicate while preserving order. Skipped when allow_duplicates is + # True (e.g., select_slider range mode where ?color=red&color=red is a + # valid zero-width range). + if not allow_duplicates: + seen: set[str] = set() + deduped: list[str] = [] + for v in result: + if v not in seen: + seen.add(v) + deduped.append(v) + if len(deduped) < len(result): + result = deduped + + # Truncate to max_length (e.g. multiselect max_selections). + if max_length is not None and max_length > 0 and len(result) > max_length: + result = result[:max_length] + + return result if result != parsed else None + + +@dataclass(frozen=True, slots=True) +class Serialized: + """A widget value that's serialized to a protobuf. Immutable.""" + + value: WidgetStateProto + + +@dataclass(frozen=True, slots=True) +class Value: + """A widget value that's not serialized. Immutable.""" + + value: Any + + +WState: TypeAlias = Value | Serialized + + +@dataclass(slots=True) +class WStates(MutableMapping[str, Any]): + """A mapping of widget IDs to values. Widget values can be stored in + serialized or deserialized form, but when values are retrieved from the + mapping, they'll always be deserialized. + """ + + states: dict[str, WState] = field(default_factory=dict) + widget_metadata: dict[str, WidgetMetadata[Any]] = field(default_factory=dict) + + def __repr__(self) -> str: + return util.repr_(self) + + def __getitem__(self, k: str) -> Any: + """Return the value of the widget with the given key. + If the widget's value is currently stored in serialized form, it + will be deserialized first. + """ + wstate = self.states.get(k) + if wstate is None: + raise KeyError(k) + + if isinstance(wstate, Value): + # The widget's value is already deserialized - return it directly. + return wstate.value + + # The widget's value is serialized. We deserialize it, and return + # the deserialized value. + + metadata = self.widget_metadata.get(k) + if metadata is None: + # No deserializer, which should only happen if state is + # gotten from a reconnecting browser and the script is + # trying to access it. Pretend it doesn't exist. + raise KeyError(k) + value_field_name = cast( + "ValueFieldName", + wstate.value.WhichOneof("value"), + ) + value = ( + wstate.value.__getattribute__(value_field_name) + if value_field_name # Field name is None if the widget value was cleared + else None + ) + + if is_array_value_field_name(value_field_name): + # Array types are messages with data in a `data` field + value = cast("Any", value).data + elif value_field_name == "json_value": + value = json.loads(cast("str", value)) + elif value_field_name == "string_trigger_value": + # StringTriggerValue is a message with data in a `data` field + value = cast("Any", value).data + + deserialized = metadata.deserializer(value) + + # Update metadata to reflect information from WidgetState proto + self.set_widget_metadata( + replace( + metadata, + value_type=value_field_name, + ) + ) + + self.states[k] = Value(deserialized) + return deserialized + + def __setitem__(self, k: str, v: WState) -> None: + self.states[k] = v + + def __delitem__(self, k: str) -> None: + del self.states[k] + + def __len__(self) -> int: + return len(self.states) + + def __iter__(self) -> Iterator[str]: + # For this and many other methods, we can't simply delegate to the + # states field, because we need to invoke `__getitem__` for any + # values, to handle deserialization and unwrapping of values. + yield from self.states + + def keys(self) -> KeysView[str]: + return KeysView(self.states) + + def items(self) -> set[tuple[str, Any]]: # type: ignore[override] # ty: ignore[invalid-method-override] + return {(k, self[k]) for k in self} + + def values(self) -> set[Any]: # type: ignore[override] # ty: ignore[invalid-method-override] + return {self[wid] for wid in self} + + def update(self, other: WStates) -> None: # type: ignore[override] # ty: ignore[invalid-method-override] + """Copy all widget values and metadata from 'other' into this mapping, + overwriting any data in this mapping that's also present in 'other'. + """ + self.states.update(other.states) + self.widget_metadata.update(other.widget_metadata) + + def set_widget_from_proto(self, widget_state: WidgetStateProto) -> None: + """Set a widget's serialized value, overwriting any existing value it has.""" + self[widget_state.id] = Serialized(widget_state) + + def set_from_value(self, k: str, v: Any) -> None: + """Set a widget's deserialized value, overwriting any existing value it has.""" + self[k] = Value(v) + + def set_widget_metadata(self, widget_meta: WidgetMetadata[Any]) -> None: + """Set a widget's metadata, overwriting any existing metadata it has.""" + self.widget_metadata[widget_meta.id] = widget_meta + + def remove_stale_widgets( + self, + active_widget_ids: frozenset[str], + fragment_ids_this_run: list[str] | None, + ) -> None: + """Remove widget state for stale widgets.""" + self.states = { + k: v + for k, v in self.states.items() + if not _is_stale_widget( + self.widget_metadata.get(k), + active_widget_ids, + fragment_ids_this_run, + ) + } + + def get_serialized(self, k: str) -> WidgetStateProto | None: + """Get the serialized value of the widget with the given id. + + If the widget doesn't exist, return None. If the widget exists but + is not in serialized form, it will be serialized first. + """ + + item = self.states.get(k) + if item is None: + # No such widget: return None. + return None + + if isinstance(item, Serialized): + # Widget value is serialized: return it directly. + return item.value + + # Widget value is not serialized: serialize it first! + metadata = self.widget_metadata.get(k) + if metadata is None: + # We're missing the widget's metadata. (Can this happen?) + return None + + widget = WidgetStateProto() + widget.id = k + + field = metadata.value_type + serialized = metadata.serializer(item.value) + + if is_array_value_field_name(field): + arr = getattr(widget, field) + arr.data.extend(serialized) + elif field in {"json_value", "json_trigger_value"}: + setattr(widget, field, json.dumps(serialized)) + elif field == "file_uploader_state_value": + widget.file_uploader_state_value.CopyFrom(serialized) + elif field == "string_trigger_value": + widget.string_trigger_value.CopyFrom(serialized) + elif field == "chat_input_value": + widget.chat_input_value.CopyFrom(serialized) + elif field is not None and serialized is not None: + # If the field is None, the widget value was cleared + # by the user and therefore is None. But we cannot + # set it to None here, since the proto properties are + # not nullable. So we just don't set it. + setattr(widget, field, serialized) + + return widget + + def as_widget_states(self) -> list[WidgetStateProto]: + """Return a list of serialized widget values for each widget with a value.""" + return [ + s + for widget_id in self.states + if (s := self.get_serialized(widget_id)) is not None + ] + + def call_callback(self, widget_id: str) -> None: + """Call the given widget's callback and return the callback's + return value. If the widget has no callback, return None. + + If the widget doesn't exist, raise an Exception. + """ + metadata = self.widget_metadata.get(widget_id) + + if metadata is None: + raise RuntimeError(f"Widget {widget_id} not found.") + + callback = metadata.callback + if callback is None: + return + + args = metadata.callback_args or () + kwargs = metadata.callback_kwargs or {} + + ctx = get_script_run_ctx() + if ctx and metadata.fragment_id is not None: + with ThreadState.scoped(in_fragment_callback=True): + callback(*args, **kwargs) + else: + callback(*args, **kwargs) + + +def _missing_key_error_message(key: str) -> str: + return ( + f'st.session_state has no key "{key}". Did you forget to initialize it? ' + f"More info: https://docs.streamlit.io/develop/concepts/architecture/session-state#initialization" + ) + + +@dataclass(slots=True) +class KeyIdMapper: + """A mapping of user-provided keys to element IDs. + It also maps element IDs to user-provided keys so that this reverse mapping + does not have to be computed ad-hoc. + All built-in dict-operations such as setting and deleting expect the key as the + argument, not the element ID. + """ + + _key_id_mapping: dict[str, str] = field(default_factory=dict) + _id_key_mapping: dict[str, str] = field(default_factory=dict) + + def __contains__(self, key: str) -> bool: + return key in self._key_id_mapping + + def __setitem__(self, key: str, widget_id: Any) -> None: + self._key_id_mapping[key] = widget_id + self._id_key_mapping[widget_id] = key + + def __delitem__(self, key: str) -> None: + self.delete(key) + + @property + def id_key_mapping(self) -> dict[str, str]: + return self._id_key_mapping + + def set_key_id_mapping(self, key_id_mapping: dict[str, str]) -> None: + self._key_id_mapping = key_id_mapping + self._id_key_mapping = {v: k for k, v in key_id_mapping.items()} + + def get_id_from_key(self, key: str, default: str | None = None) -> str | None: + return self._key_id_mapping.get(key, default) + + def get_key_from_id(self, widget_id: str) -> str: + return self._id_key_mapping[widget_id] + + def update(self, other: KeyIdMapper) -> None: + self._key_id_mapping.update(other._key_id_mapping) + self._id_key_mapping.update(other._id_key_mapping) + + def clear(self) -> None: + self._key_id_mapping.clear() + self._id_key_mapping.clear() + + def delete(self, key: str) -> None: + widget_id = self._key_id_mapping[key] + del self._key_id_mapping[key] + del self._id_key_mapping[widget_id] + + +@dataclass(slots=True) +class PersistedWidgetTracker: + """Tracks persist_state bookkeeping for keyed widgets. + + "session" scope always preserves a widget's value when it stops rendering. + "page" scope preserves it only while the user stays on the widget's page, and + drops it on a page switch — including telling a remounted widget to ignore a + value the frontend may resend for the reused id. + + The tracker only records policy; SessionState performs the actual value + mutations. bind="query-params" takes precedence over "page" scope: the + tracker is unaware of it, and the caller passes ``is_bound`` so bound widgets + skip the drops. + """ + + # Widget id -> scope it registered with. A durable snapshot that survives the + # rerun sequencing of a page transition. + _scopes: dict[str, Literal["page", "session"]] = field(default_factory=dict) + # "page" widget id -> page hash where it last registered. + _widget_pages: dict[str, str] = field(default_factory=dict) + # "page" user key -> origin page hash of a value preserved while unmounted. + _value_pages: dict[str, str] = field(default_factory=dict) + # "page" widget ids whose value was dropped on a page switch; the next + # registration must discard a frontend-resent value and reset to the default. + _pending_resets: set[str] = field(default_factory=set) + + def clear(self) -> None: + self._scopes.clear() + self._widget_pages.clear() + self._value_pages.clear() + self._pending_resets.clear() + + # --- Reads (also used by white-box tests) ------------------------------ + + def scope_of(self, widget_id: str) -> Literal["page", "session"] | None: + return self._scopes.get(widget_id) + + def page_of(self, widget_id: str) -> str | None: + return self._widget_pages.get(widget_id) + + def value_page_of(self, user_key: str) -> str | None: + return self._value_pages.get(user_key) + + def has_pending_reset(self, widget_id: str) -> bool: + return widget_id in self._pending_resets + + def should_preserve(self, widget_id: str, current_page: str) -> bool: + """True if a stale keyed widget's value should be carried forward.""" + scope = self._scopes.get(widget_id) + if scope == "session": + return True + if scope == "page": + return self._widget_pages.get(widget_id) == current_page + return False + + # --- Stale-cleanup hooks ----------------------------------------------- + + def note_preserved_value( + self, widget_id: str, user_key: str, current_page: str + ) -> None: + """Record (or clear) the origin page for a value carried forward while + its widget is unmounted, so a later registration on a different page can + drop it instead of adopting it. + """ + if self._scopes.get(widget_id) == "page": + self._value_pages[user_key] = self._widget_pages.get( + widget_id, current_page + ) + else: + self._value_pages.pop(user_key, None) + + def mark_page_switch_drops( + self, + current_page: str, + user_key_for: Mapping[str, str], + is_exempt: Callable[[str], bool], + is_stale: Callable[[str], bool], + ) -> list[str]: + """Flag "page"-scoped widgets being dropped on this page switch and + return the user keys whose preserved value the caller should drop. + + A widget qualifies when its owning page differs from the current one and + it is stale this run. Flagging it makes its next registration discard a + value the frontend may resend for the reused id. ``is_exempt`` skips + widgets that must survive the switch (bound widgets, which take + precedence over "page" scope); ``is_stale`` reports whether a widget is + absent from the current run. + """ + dropped_user_keys: list[str] = [] + for wid, scope in self._scopes.items(): + if scope != "page" or self._widget_pages.get(wid) == current_page: + continue + if is_exempt(wid) or not is_stale(wid): + continue + self._pending_resets.add(wid) + user_key = user_key_for.get(wid) + if user_key is not None: + dropped_user_keys.append(user_key) + return dropped_user_keys + + def prune( + self, live_widget_ids: KeysView[str], live_value_keys: Mapping[str, Any] + ) -> None: + """Drop tracking for widgets/keys no longer present, preventing unbounded + growth across long sessions. + """ + self._scopes = {w: s for w, s in self._scopes.items() if w in live_widget_ids} + self._widget_pages = { + w: p for w, p in self._widget_pages.items() if w in live_widget_ids + } + # Origin-page records are kept only while their value is still preserved + # under the user key in old state. + self._value_pages = { + k: p for k, p in self._value_pages.items() if k in live_value_keys + } + self._pending_resets.intersection_update(live_widget_ids) + + # --- Registration ------------------------------------------------------ + + def register( + self, + widget_id: str, + user_key: str, + scope: Literal["page", "session"], + current_page: str, + ) -> None: + """Record a persist_state registration: the widget's scope and, for + "page" scope, the page it is mounting on. This is the durable snapshot + that later runs read; "session" scope needs no page, so any stale + page-tracking for the widget is cleared. + """ + self._scopes[widget_id] = scope + if scope == "page": + self._widget_pages[widget_id] = current_page + else: + self._widget_pages.pop(widget_id, None) + self._value_pages.pop(user_key, None) + self._pending_resets.discard(widget_id) + + def take_pending_drop( + self, widget_id: str, user_key: str, current_page: str, is_bound: bool + ) -> bool: + """Resolve whether a just-registered widget's stored value must be + dropped, consuming the one-shot flags behind the decision. Call after + register(). + + Returns True when a "page"-scoped value must not survive: it belongs to a + different page than the one the widget is mounting on, or it was flagged + for reset after a page switch. Bound widgets are exempt (bind takes + precedence over "page" scope) but still clear the flags so they don't + linger. "session" scope never drops. + """ + if self._scopes.get(widget_id) != "page": + return False + + should_drop = False + # A preserved "page" value carries its origin page; drop it if the widget + # now mounts on a different page so it cannot leak across pages. + origin_page = self._value_pages.pop(user_key, None) + if not is_bound and origin_page is not None and origin_page != current_page: + should_drop = True + # The value was dropped on a page switch while this page skipped the + # widget: discard whatever the frontend resends so it falls back to the + # default, even back on the origin page. + if widget_id in self._pending_resets: + self._pending_resets.discard(widget_id) + if not is_bound: + should_drop = True + return should_drop + + def untrack(self, widget_id: str, user_key: str) -> None: + """Forget all tracking for a widget that stopped persisting.""" + self._scopes.pop(widget_id, None) + self._widget_pages.pop(widget_id, None) + self._value_pages.pop(user_key, None) + self._pending_resets.discard(widget_id) + + +@dataclass(slots=True) +class SessionState: + """SessionState allows users to store values that persist between app + reruns. + + Example + ------- + >>> if "num_script_runs" not in st.session_state: + ... st.session_state.num_script_runs = 0 + >>> st.session_state.num_script_runs += 1 + >>> st.write(st.session_state.num_script_runs) # writes 1 + + The next time your script runs, the value of + st.session_state.num_script_runs will be preserved. + >>> st.session_state.num_script_runs += 1 + >>> st.write(st.session_state.num_script_runs) # writes 2 + """ + + # All the values from previous script runs, squished together to save memory + _old_state: dict[str, Any] = field(default_factory=dict) + + # Values set in session state during the current script run, possibly for + # setting a widget's value. Keyed by a user provided string. + _new_session_state: dict[str, Any] = field(default_factory=dict) + + # Widget values from the frontend, usually one changing prompted the script rerun + _new_widget_state: WStates = field(default_factory=WStates) + + # Keys used for widgets will be eagerly converted to the matching element id + _key_id_mapper: KeyIdMapper = field(default_factory=KeyIdMapper) + + # query params are stored in session state because query params will be tied with + # widget state at one point. + query_params: QueryParams = field(default_factory=QueryParams) + + # Widget IDs that have registered with bind="query-params". This is a + # durable bound-intent snapshot that survives MPA page-transition + # sequencing where bindings and current-run metadata may already be gone by + # stale-widget cleanup time. + _query_param_bound_widget_ids: set[str] = field(default_factory=set) + + # All persist_state bookkeeping (both scopes) lives here. Like + # _query_param_bound_widget_ids, it is a durable snapshot that survives the + # rerun sequencing of a page transition. + _persist_tracker: PersistedWidgetTracker = field( + default_factory=PersistedWidgetTracker + ) + + def __repr__(self) -> str: + return util.repr_(self) + + # is it possible for a value to get through this without being deserialized? + def _compact_state(self) -> None: + """Copy all current session_state and widget_state values into our + _old_state dict, and then clear our current session_state and + widget_state. + """ + for key_or_wid in self: + try: + self._old_state[key_or_wid] = self[key_or_wid] + except KeyError: # noqa: PERF203 + # handle key errors from widget state not having metadata gracefully + # https://github.com/streamlit/streamlit/issues/7206 + pass + self._new_session_state.clear() + self._new_widget_state.clear() + + def clear(self) -> None: + """Reset self completely, clearing all current and old values.""" + self._old_state.clear() + self._new_session_state.clear() + self._new_widget_state.clear() + self._key_id_mapper.clear() + self._query_param_bound_widget_ids.clear() + self._persist_tracker.clear() + + @property + def filtered_state(self) -> dict[str, Any]: + """The combined session and widget state, excluding keyless widgets and internal widgets.""" + + wid_key_map = self._key_id_mapper.id_key_mapping + + state: dict[str, Any] = {} + + # We can't write `for k, v in self.items()` here because doing so will + # run into a `KeyError` if widget metadata has been cleared (which + # happens when the streamlit server restarted or the cache was cleared), + # then we receive a widget's state from a browser. + for k in self._keys(): + if not is_element_id(k) and not _is_internal_key(k): + state[k] = self[k] + elif is_keyed_element_id(k) and not _is_internal_key(k): + try: + key = wid_key_map[k] + # Value returned by __getitem__ is already presented. + state[key] = self[k] + except KeyError: + # Widget id no longer maps to a key, it is a not yet + # cleared value in old state for a reset widget + pass + + return state + + def _keys(self) -> set[str]: + """All keys active in Session State, with widget keys converted + to widget ids when one is known. (This includes autogenerated keys + for widgets that don't have user_keys defined, and which aren't + exposed to user code). + """ + old_keys = {self._get_widget_id(k) for k in self._old_state} + new_widget_keys = set(self._new_widget_state.keys()) + new_session_state_keys = { + self._get_widget_id(k) for k in self._new_session_state + } + return old_keys | new_widget_keys | new_session_state_keys + + def is_new_state_value(self, user_key: str) -> bool: + """True if a value with the given key is in the current session state.""" + return user_key in self._new_session_state + + def reset_state_value(self, user_key: str, value: Any | None) -> None: + """Reset a new session state value to a given value + without triggering the "state value cannot be modified" error. + """ + self._new_session_state[user_key] = value + + def __iter__(self) -> Iterator[Any]: + """Return an iterator over the keys of the SessionState. + This is a shortcut for `iter(self.keys())`. + """ + return iter(self._keys()) + + def __len__(self) -> int: + """Return the number of items in SessionState.""" + return len(self._keys()) + + def __getitem__(self, key: str) -> Any: + wid_key_map = self._key_id_mapper.id_key_mapping + widget_id = self._get_widget_id(key) + + if widget_id in wid_key_map and widget_id == key: + # the "key" is a raw widget id, so get its associated user key for lookup + key = wid_key_map[widget_id] + try: + base_value = self._getitem(widget_id, key) + return ( + apply_presenter(self, widget_id, base_value) + if widget_id is not None + else base_value + ) + except KeyError: + raise KeyError(_missing_key_error_message(key)) + + def _getitem(self, widget_id: str | None, user_key: str | None) -> Any: + """Get the value of an entry in Session State, using either the + user-provided key or a widget id as appropriate for the internal dict + being accessed. + + At least one of the arguments must have a value. + """ + if user_key is None and widget_id is None: # pragma: no cover - defensive + raise ValueError( + "user_key and widget_id cannot both be None. This should never happen." + ) + + if user_key is not None: + try: + return self._new_session_state[user_key] + except KeyError: + pass + + if widget_id is not None: + try: + return self._new_widget_state[widget_id] + except KeyError: + pass + + # Typically, there won't be both a widget id and an associated state key in + # old state at the same time, so the order we check is arbitrary. + # The exception is if session state is set and then a later run has + # a widget created, so the widget id entry should be newer. + # The opposite case shouldn't happen, because setting the value of a widget + # through session state will result in the next widget state reflecting that + # value. + if widget_id is not None: + try: + return self._old_state[widget_id] + except KeyError: + pass + + if user_key is not None: + try: + return self._old_state[user_key] + except KeyError: + pass + + # We'll never get here + raise KeyError + + def __setitem__(self, user_key: str, value: Any) -> None: + """Set the value of the session_state entry with the given user_key. + + If the key corresponds to a widget or form that's been instantiated + during the current script run, raise a StreamlitAPIException instead. + """ + ctx = get_script_run_ctx() + + if ctx is not None: + widget_id = self._key_id_mapper.get_id_from_key(user_key, None) + widget_ids = ctx.shared.widget_ids_this_run + form_ids = ctx.shared.form_ids_this_run + + if widget_id in widget_ids or user_key in form_ids: + raise StreamlitAPIException( + f"`st.session_state.{user_key}` cannot be modified after the widget" + f" with key `{user_key}` is instantiated." + ) + + self._new_session_state[user_key] = value + + def __delitem__(self, key: str) -> None: + widget_id = self._get_widget_id(key) + + if not (key in self or widget_id in self): + raise KeyError(_missing_key_error_message(key)) + + if key in self._new_session_state: + del self._new_session_state[key] + + if key in self._old_state: + del self._old_state[key] + + if key in self._key_id_mapper: + self._key_id_mapper.delete(key) + + if widget_id in self._new_widget_state: + del self._new_widget_state[widget_id] + + if widget_id in self._old_state: + del self._old_state[widget_id] + + def set_widgets_from_proto(self, widget_states: WidgetStatesProto) -> None: + """Set the value of all widgets represented in the given WidgetStatesProto.""" + widget_states_size = widget_states.ByteSize() + if widget_states_size > get_max_widget_state_size_bytes(): + raise WidgetStateSizeError(widget_states_size) + + for state in widget_states.widgets: + self._new_widget_state.set_widget_from_proto(state) + + def on_script_will_rerun(self, latest_widget_states: WidgetStatesProto) -> None: + """Called by ScriptRunner before its script re-runs. + + Update widget data and call callbacks on widgets whose value changed + between the previous and current script runs. + """ + # Clear any triggers that weren't reset because the script was disconnected + self._reset_triggers() + self._compact_state() + self.set_widgets_from_proto(latest_widget_states) + self._call_callbacks() + + def _call_callbacks(self) -> None: + """Call callbacks for widgets whose value changed or whose trigger fired.""" + from streamlit.runtime.scriptrunner import RerunException + + # Path 1: single callback. + changed_widget_ids_for_single_callback = [ + wid + for wid in self._new_widget_state + if self._widget_changed(wid) + and (metadata := self._new_widget_state.widget_metadata.get(wid)) + is not None + and metadata.callback is not None + ] + + for wid in changed_widget_ids_for_single_callback: + try: + self._new_widget_state.call_callback(wid) + except RerunException: # noqa: PERF203 + get_dg_singleton_instance().main_dg.warning( + "Calling st.rerun() within a callback is a no-op." + ) + + # Path 2: multiple callbacks. + widget_ids_to_process = list(self._new_widget_state.states.keys()) + + for wid in widget_ids_to_process: + metadata = self._new_widget_state.widget_metadata.get(wid) + if not metadata or metadata.callbacks is None: + continue + + args = metadata.callback_args or () + kwargs = metadata.callback_kwargs or {} + + # 1) Trigger dispatch: bool + JSON trigger aggregator + self._dispatch_trigger_callbacks(wid, metadata, args, kwargs) + + # 2) JSON value change dispatch + if metadata.value_type == "json_value": + self._dispatch_json_change_callbacks(wid, metadata, args, kwargs) + + def _execute_widget_callback( + self, + callback_fn: WidgetCallback, + cb_metadata: WidgetMetadata[Any], + cb_args: WidgetArgs, + cb_kwargs: dict[str, Any], + ) -> None: + """Execute a widget callback with fragment-aware context. + + If the widget belongs to a fragment, temporarily marks the current + script context as being inside a fragment callback to adapt rerun + semantics. Attempts to call ``st.rerun()`` inside a widget callback are + converted to a user-visible warning and treated as a no-op. + + Parameters + ---------- + callback_fn : WidgetCallback + The user-provided callback to execute. + cb_metadata : WidgetMetadata[Any] + Metadata of the widget associated with the callback. + cb_args : WidgetArgs + Positional arguments passed to the callback. + cb_kwargs : dict[str, Any] + Keyword arguments passed to the callback. + """ + from streamlit.runtime.scriptrunner import RerunException + + ctx = get_script_run_ctx() + if ctx and cb_metadata.fragment_id is not None: + with ThreadState.scoped(in_fragment_callback=True): + try: + callback_fn(*cb_args, **cb_kwargs) + except RerunException: + get_dg_singleton_instance().main_dg.warning( + "Calling st.rerun() within a callback is a no-op." + ) + else: + try: + callback_fn(*cb_args, **cb_kwargs) + except RerunException: + get_dg_singleton_instance().main_dg.warning( + "Calling st.rerun() within a callback is a no-op." + ) + + def _dispatch_trigger_callbacks( + self, + wid: str, + metadata: WidgetMetadata[Any], + args: WidgetArgs, + kwargs: dict[str, Any], + ) -> None: + """Dispatch trigger-style callbacks for a widget. + + Handles the JSON trigger aggregator. The JSON payload may be a single + event dict or a list of event dicts; each event must contain an + ``"event"`` field that maps to the corresponding callback name in + ``metadata.callbacks``. + + Parameters + ---------- + wid : str + The widget ID. + metadata : WidgetMetadata[Any] + Metadata for the widget, including registered callbacks. + args : WidgetArgs + Positional arguments forwarded to the callback. + kwargs : dict[str, Any] + Keyword arguments forwarded to the callback. + + Examples + -------- + A component with a "submit" callback: + + >>> metadata.callbacks = {"submit": on_submit} + + The frontend can send a single event payload: + + >>> {"event": "submit", "value": "payload"} + + Or a list of event payloads to be processed in order: + + >>> [{"event": "edit", ...}, {"event": "submit", ...}] + """ + widget_proto_state = self._new_widget_state.get_serialized(wid) + if not widget_proto_state: + return + + # JSON trigger aggregator: value is deserialized by metadata.deserializer + if widget_proto_state.json_trigger_value: + try: + deserialized = self._new_widget_state[wid] + except KeyError: + deserialized = None + + payloads: list[object] + if isinstance(deserialized, list): + payloads = deserialized + else: + payloads = [deserialized] + + for payload in payloads: + if isinstance(payload, dict): + event_name = cast("Mapping[str, object]", payload).get("event") + if isinstance(event_name, str) and metadata.callbacks: + cb = metadata.callbacks.get(event_name) + if cb is not None: + self._execute_widget_callback(cb, metadata, args, kwargs) + + def _dispatch_json_change_callbacks( + self, + wid: str, + metadata: WidgetMetadata[Any], + args: WidgetArgs, + kwargs: dict[str, Any], + ) -> None: + """Dispatch change callbacks for JSON-valued widgets. + + Computes a shallow diff between the new and old JSON maps and invokes + callbacks for keys that changed or were added/removed. + + Parameters + ---------- + wid : str + The widget ID. + metadata : WidgetMetadata[Any] + Metadata for the widget, including registered callbacks. + args : WidgetArgs + Positional arguments forwarded to the callback. + kwargs : dict[str, Any] + Keyword arguments forwarded to the callback. + """ + if not metadata.callbacks: + return + + try: + new_val = self._new_widget_state.get(wid) + except KeyError: + new_val = None + old_val = self._old_state.get(wid) + + def unwrap(obj: object) -> dict[str, object]: + if not isinstance(obj, dict): + return {} + + obj = cast("dict[str, Any]", obj) + if set(obj.keys()) == {"value"}: + value = obj.get("value") + if isinstance(value, dict): + return dict(value) # shallow copy + + return dict(obj) + + new_map = unwrap(new_val) + old_map = unwrap(old_val) + + if new_map or old_map: + all_keys = new_map.keys() | old_map.keys() + changed_keys = {k for k in all_keys if old_map.get(k) != new_map.get(k)} + + for key in changed_keys: + cb = metadata.callbacks.get(key) + if cb is not None: + self._execute_widget_callback(cb, metadata, args, kwargs) + + def _widget_changed(self, widget_id: str) -> bool: + """True if the given widget's value changed between the previous + script run and the current script run. + """ + new_value = self._new_widget_state.get(widget_id) + old_value = self._old_state.get(widget_id) + changed: bool = new_value != old_value + return changed + + def on_script_finished(self, widget_ids_this_run: frozenset[str]) -> None: + """Called by ScriptRunner after its script finishes running. + Updates widgets to prepare for the next script run. + + Parameters + ---------- + widget_ids_this_run: frozenset[str] + The IDs of the widgets that were accessed during the script + run. Any widget state whose ID does *not* appear in this set + is considered "stale" and will be removed. + """ + self._reset_triggers() + self._remove_stale_widgets(widget_ids_this_run) + + def _reset_triggers(self) -> None: + """Set all trigger values in our state dictionary to False.""" + for state_id in self._new_widget_state: + metadata = self._new_widget_state.widget_metadata.get(state_id) + if metadata is not None: + if metadata.value_type == "trigger_value": + self._new_widget_state[state_id] = Value(False) + elif metadata.value_type in { + "string_trigger_value", + "chat_input_value", + "json_trigger_value", + }: + self._new_widget_state[state_id] = Value(None) + + for state_id in self._old_state: + metadata = self._new_widget_state.widget_metadata.get(state_id) + if metadata is not None: + if metadata.value_type == "trigger_value": + self._old_state[state_id] = False + elif metadata.value_type in { + "string_trigger_value", + "chat_input_value", + "json_trigger_value", + }: + self._old_state[state_id] = None + + def _remove_stale_widgets(self, active_widget_ids: frozenset[str]) -> None: + """Remove widget state for widgets whose ids aren't in `active_widget_ids`.""" + ctx = get_script_run_ctx() + if ctx is None: + return + + # Before any cleanup, capture the current value for bound stale widgets. + # The most recent value may live in _new_widget_state (e.g. from + # set_widgets_from_proto after a user interaction) rather than _old_state + # (which holds the value from the previous compaction). We must read it + # through the full lookup chain before _new_widget_state is cleaned. + wid_key_map = self._key_id_mapper.id_key_mapping + + def _should_preserve(widget_id: str) -> bool: + """True if a stale keyed widget's value should be carried forward.""" + return ( + widget_id in self._query_param_bound_widget_ids + or self._persist_tracker.should_preserve( + widget_id, ctx.page_script_hash + ) + ) + + preserved_by_key: dict[str, Any] = {} + for key in self._old_state: + if ( + is_element_id(key) + and _should_preserve(key) + and key in wid_key_map + and _is_stale_widget( + self._new_widget_state.widget_metadata.get(key), + active_widget_ids, + ctx.fragment_ids_this_run, + ) + ): + user_key = wid_key_map[key] + try: + preserved_by_key[user_key] = self._getitem(key, user_key) + except KeyError: + preserved_by_key[user_key] = self._old_state[key] + self._persist_tracker.note_preserved_value( + key, user_key, ctx.page_script_hash + ) + + # A "page"-scoped value must not outlive a page switch. The widget may + # never re-register on the new page (that page might not render it), so + # we can't rely on the registration-time reset — drop any value left + # under its user key now, or it stays readable via st.session_state. + # (A set made this run lives in _new_session_state and is left untouched.) + for user_key in self._persist_tracker.mark_page_switch_drops( + ctx.page_script_hash, + wid_key_map, + is_exempt=lambda wid: wid in self._query_param_bound_widget_ids, + is_stale=lambda wid: _is_stale_widget( + self._new_widget_state.widget_metadata.get(wid), + active_widget_ids, + ctx.fragment_ids_this_run, + ), + ): + self._old_state.pop(user_key, None) + + self._new_widget_state.remove_stale_widgets( + active_widget_ids, + ctx.fragment_ids_this_run, + ) + + # Remove entries from _old_state corresponding to stale widgets. + self._old_state = { + k: v + for k, v in self._old_state.items() + if ( + not is_element_id(k) + or not _is_stale_widget( + self._new_widget_state.widget_metadata.get(k), + active_widget_ids, + ctx.fragment_ids_this_run, + ) + ) + } + + # Re-add the preserved values under their user keys. + self._old_state.update(preserved_by_key) + + # A keyed widget can remount under a new element id this run (e.g. after + # a page switch) while its user key stays the same. The value was just + # preserved under the user key, so copy it onto the new element id — + # otherwise the default written for that id at registration shadows it, + # since a value stored by element id outranks one stored by user key. + for user_key, value in preserved_by_key.items(): + active_id = self._key_id_mapper.get_id_from_key(user_key, None) + if active_id is not None and active_id in active_widget_ids: + self._new_widget_state.set_from_value(active_id, value) + + # Remove query param bindings and URL params for stale widgets. + # For fragment runs, preserve widgets outside the running fragment(s). + # Note: For MPA page transitions, query param filtering is performed + # via populate_from_query_string() in script_runner.py before this cleanup, + # so bindings for non-active pages are already filtered by script hash. + self.query_params.remove_stale_bindings( + active_widget_ids, + ctx.fragment_ids_this_run, + self._new_widget_state.widget_metadata, + ) + + # Keep only bound-intent entries that still have a key mapping. + # This prevents unbounded growth across long sessions with many stale + # widget IDs while preserving currently mapped keyed widgets. + self._query_param_bound_widget_ids.intersection_update(wid_key_map.keys()) + self._persist_tracker.prune(wid_key_map.keys(), self._old_state) + + def _get_widget_metadata(self, widget_id: str) -> WidgetMetadata[Any] | None: + """Return the metadata for a widget id from the current widget state.""" + return self._new_widget_state.widget_metadata.get(widget_id) + + def _set_widget_metadata(self, widget_metadata: WidgetMetadata[Any]) -> None: + """Set a widget's metadata.""" + widget_id = widget_metadata.id + self._new_widget_state.widget_metadata[widget_id] = widget_metadata + + def get_widget_states(self) -> list[WidgetStateProto]: + """Return a list of serialized widget values for each widget with a value.""" + return self._new_widget_state.as_widget_states() + + def _get_widget_id(self, k: str) -> str: + """Turns a value that might be a widget id or a user provided key into + an appropriate widget id. + """ + # It's guaranteed that the key is a string since the default is string, + # so we can cast it to str here: + return cast("str", self._key_id_mapper.get_id_from_key(k, k)) + + def _set_key_widget_mapping(self, widget_id: str, user_key: str) -> None: + self._key_id_mapper[user_key] = widget_id + + def _drop_widget_value(self, widget_id: str, user_key: str) -> bool: + """Forget any stored value for a widget, both by id and by user key. + + Returns True if a value was removed. Values set during the current run + via ``_new_session_state`` represent the current run's intent and are + left untouched. + """ + removed = self._new_widget_state.states.pop(widget_id, None) is not None + removed = self._old_state.pop(widget_id, None) is not None or removed + removed = self._old_state.pop(user_key, None) is not None or removed + return removed + + def register_widget( + self, metadata: WidgetMetadata[T], user_key: str | None + ) -> RegisterWidgetResult[T]: + """Register a widget with the SessionState. + + Returns + ------- + RegisterWidgetResult[T] + Contains the widget's current value, and a bool that will be True + if the frontend needs to be updated with the current value. + """ + widget_id = metadata.id + ctx = get_script_run_ctx() + + # Capture the stored wire value *before* swapping in this run's + # serializer, so it reflects the value as it was actually stored (using + # the serializer it was stored with). For string widgets we expose this + # so callers can reconcile a stored value against freshly computed state + # without re-deriving it from the deserialized value. + incoming_serialized_value: str | None = None + if metadata.value_type == "string_value": + stored_proto = self._new_widget_state.get_serialized(widget_id) + if ( + stored_proto is not None + and stored_proto.WhichOneof("value") == "string_value" + ): + incoming_serialized_value = stored_proto.string_value + + self._set_widget_metadata(metadata) + if user_key is not None: + # If the widget has a user_key, update its user_key:widget_id mapping + self._set_key_widget_mapping(widget_id, user_key) + + # Handle query param binding + url_value_seeded = False + if metadata.bind == "query-params" and user_key is not None: + self._query_param_bound_widget_ids.add(widget_id) + url_value_seeded = self._handle_query_param_binding( + metadata, user_key, widget_id + ) + elif metadata.bind is None and user_key is not None: + # Widget stopped using bind — clean up any stale binding + self._query_param_bound_widget_ids.discard(widget_id) + self.query_params.unbind_and_clear_param(widget_id) + + # Keep persist_state tracking in sync (server-side only, no URL) and drop + # the stored value if the tracker says it's no longer valid for this page. + dropped_page_scoped_value = False + if metadata.persist_state is not None and user_key is not None: + current_page_hash = ctx.page_script_hash if ctx is not None else "" + self._persist_tracker.register( + widget_id, user_key, metadata.persist_state, current_page_hash + ) + should_drop = self._persist_tracker.take_pending_drop( + widget_id, + user_key, + current_page_hash, + is_bound=metadata.bind == "query-params", + ) + if should_drop: + dropped_page_scoped_value = self._drop_widget_value(widget_id, user_key) + elif metadata.persist_state is None and user_key is not None: + # Widget stopped persisting — drop any stale tracking. + self._persist_tracker.untrack(widget_id, user_key) + + if ( + widget_id not in self + and (user_key is None or user_key not in self) + and not url_value_seeded + ): + # This is the first time the widget is registered, so we save its + # value in widget state (unless we already seeded from URL). + deserializer = metadata.deserializer + initial_widget_value = deepcopy(deserializer(None)) + self._new_widget_state.set_from_value(widget_id, initial_widget_value) + + # Get the current value of the widget for use as its return value. + # We return a copy, so that reference types can't be accidentally + # mutated by user code. + widget_value = cast("T", self[widget_id]) + widget_value = deepcopy(widget_value) + + # Sync bound widget value ↔ URL after value resolution. + # + # Non-default restore: write param when it was lost (page nav / remount). + # The user_key-in-_old_state guard ensures this only fires for values + # that were explicitly preserved under a user key by _remove_stale_widgets. + # Compacted programmatic sets (st.session_state["k"] = v) are stored + # under widget IDs only, so the guard correctly excludes them. + # + # Programmatic set (user_key in _new_session_state): sync URL when the + # resolved value differs from the backend query snapshot, so reloads + # stay consistent (see issue #14670). + # + # Default collapsing: remove stale params the frontend already cleared. + # The backend's _query_params is not refreshed on same-page reruns, so + # it can hold entries the frontend already deleted. Cleaning them here + # prevents _send_query_param_msg from re-broadcasting stale params. + # Programmatic reset to default uses remove_param so the browser URL + # is updated when the frontend still shows the old query string. + restored_bound_value = False + if metadata.bind == "query-params" and user_key is not None: + default_value = metadata.deserializer(None) + if widget_value != default_value: + if ( + user_key in self._old_state + and not self.query_params.has_param(user_key) + and user_key not in self._new_session_state + ): + serialized = metadata.serializer(widget_value) + self.query_params.set_corrected_value( + user_key, serialized, metadata.value_type + ) + restored_bound_value = True + elif ( + user_key in self._new_session_state + and not url_value_seeded + and (widget_id in self._old_state or user_key in self._old_state) + ): + serialized = metadata.serializer(widget_value) + if not self.query_params.stored_param_matches_corrected_value( + user_key, serialized, metadata.value_type + ): + self.query_params.set_corrected_value( + user_key, serialized, metadata.value_type + ) + elif ( + user_key in self._new_session_state + and not url_value_seeded + and self.query_params.has_param(user_key) + and (widget_id in self._old_state or user_key in self._old_state) + ): + self.query_params.remove_param(user_key) + else: + self.query_params.discard_param_no_forward_msg(user_key) + + # A persist_state widget resolving to a non-default value from a previous + # run (preserved while unmounted, or a compacted programmatic set) must + # tell the frontend to adopt the backend value on (re)mount. Otherwise it + # renders at its default and the next rerun overwrites the preserved value. + # For a bind + persist_state widget this can overlap with + # restored_bound_value; that is harmless since both only feed the OR below. + restored_persisted_value = False + if ( + metadata.persist_state is not None + and user_key is not None + and not self.is_new_state_value(user_key) + and widget_id not in self._new_widget_state + and (widget_id in self._old_state or user_key in self._old_state) + ): + default_value = metadata.deserializer(None) + if widget_value != default_value: + restored_persisted_value = True + + # widget_value_changed indicates to the caller that the widget's current + # value is different from what is in the frontend. True when: + # - the value changed this run; + # - a bound value was restored to the URL — the frontend renders the + # widget for the first time on this page and must use the backend's + # resolved value instead of the widget's default; + # - a persisted value was restored from session state on (re)mount, for + # the same reason; + # - a "page"-scoped value was dropped on a page switch, so the frontend + # must fall back to the default for the reused widget id. + widget_value_changed = ( + (user_key is not None and self.is_new_state_value(user_key)) + or restored_bound_value + or restored_persisted_value + or dropped_page_scoped_value + ) + + return RegisterWidgetResult( + widget_value, + widget_value_changed, + incoming_serialized_value=incoming_serialized_value, + ) + + def _handle_query_param_binding( + self, metadata: WidgetMetadata[T], user_key: str, widget_id: str + ) -> bool: + """Handle query param binding for a widget. + + Registers the binding, then attempts to seed the widget's value from URL + based on priority rules: + + - On initial load, URL wins (enables shareable URLs) + - On subsequent reruns, session_state values win + - User interaction (frontend value) always wins + + Returns True if the widget's value was seeded from URL, False otherwise. + """ + # Register the widget binding + ctx = get_script_run_ctx() + script_hash = ThreadState.get().active_script_hash if ctx is not None else "" + self.query_params.bind_widget( + param_key=user_key, + widget_id=widget_id, + value_type=metadata.value_type, + script_hash=script_hash, + ) + + # Check priority rules - skip seeding if user/code has already set a value + if widget_id in self._new_widget_state: # User interacted with widget + return False + is_initial_load = widget_id not in self._old_state + if not is_initial_load and user_key in self._new_session_state: + return False # Code set value after first run + + url_value = self.query_params.get_initial_value(user_key) + if url_value is None: + return False + + return self._seed_widget_from_url(metadata, user_key, widget_id, url_value) + + def _seed_widget_from_url( + self, + metadata: WidgetMetadata[T], + user_key: str, + widget_id: str, + url_value: str | list[str], + ) -> bool: + """Parse URL value, seed widget state, and auto-correct URL if needed. + + This method: + 1. Checks if the URL value is empty and handles based on clearable + 2. Parses the raw URL string using the widget's value_type + 3. Deserializes to the widget's native value format + 4. Handles invalid values (clears URL param, returns False) + 5. Stores valid values in both widget state and session state + 6. Auto-corrects the URL if the value was clamped/filtered + + Returns True if seeding succeeded, False if the URL value was invalid. + """ + # Check if URL value is empty (e.g., ?foo= with no value) + if is_empty_url_value(url_value) and not metadata.clearable: + # Widget doesn't allow empty state - clear the invalid param + self._clear_url_param(user_key) + return False + + try: + parsed_value = parse_url_param(url_value, metadata.value_type) + deserialized_value = metadata.deserializer(parsed_value) + default_value = metadata.deserializer(None) + + # If the deserialized value equals the default, clear the param. + # Default values should not be kept in the URL — this matches the + # frontend's shouldClearUrlParam behavior. This handles: + # 1. Valid input that equals the default (e.g., ?dark_mode=FALSE) + # 2. Invalid input that the deserializer rejected and fell back to default + # 3. Valid input that normalized to match the default (e.g., "000000" -> "#000000") + if deserialized_value == default_value: + self._clear_url_param(user_key) + return False + + # Handle case where all URL values were invalid (filtered to empty list). + # For array types, parsed_value is always a list. If it had values that + # were all filtered by the deserializer (e.g., invalid options), clear URL. + if ( + isinstance(deserialized_value, list) + and len(deserialized_value) == 0 + and parsed_value # Non-empty list means URL had values + ): + self._clear_url_param(user_key) + return False + + # For string_value selection widgets (radio, selectbox), validate + # that the parsed URL value is a known option. The deserializer + # passes unknown options through as-is (needed for dynamic option + # changes and accept_new_options), so we check here instead. + # Widgets opt in by passing formatted_options to register_widget. + if ( + metadata.formatted_options is not None + and metadata.value_type == "string_value" + and isinstance(parsed_value, str) + and parsed_value not in metadata.formatted_options + ): + self._clear_url_param(user_key) + return False + + # For string_array_value widgets (e.g. multiselect, select_slider), + # sanitize the parsed URL values: filter invalid options, optionally + # deduplicate, and enforce max length. + if metadata.value_type == "string_array_value" and isinstance( + parsed_value, list + ): + sanitized = _sanitize_url_array( + parsed_value, + valid_options=metadata.formatted_options, + max_length=metadata.max_array_length, + allow_duplicates=metadata.allow_url_duplicates, + ) + if sanitized is not None: + if not sanitized: + self._clear_url_param(user_key) + return False + deserialized_value = metadata.deserializer(sanitized) + if deserialized_value == default_value: + self._clear_url_param(user_key) + return False + + # Store the value in widget and session state + self._new_widget_state.set_from_value(widget_id, deserialized_value) + self._new_session_state[user_key] = deserialized_value + + # Auto-correct URL if value was clamped/filtered + self._auto_correct_url_if_needed( + metadata, user_key, parsed_value, deserialized_value + ) + return True + + except (ValueError, TypeError, IndexError) as e: + _LOGGER.debug( + "Invalid URL value for bound widget '%s', clearing param: %s", + user_key, + e, + ) + self._clear_url_param(user_key) + return False + + def _clear_url_param(self, user_key: str) -> None: + """Clear an invalid URL parameter and notify frontend.""" + self.query_params.remove_param(user_key) + + def _auto_correct_url_if_needed( + self, + metadata: WidgetMetadata[T], + user_key: str, + parsed_value: Any, + deserialized_value: Any, + ) -> None: + """Auto-correct URL if the value was clamped or filtered.""" + serialized_value = metadata.serializer(deserialized_value) + if serialized_value == parsed_value: + return # No correction needed + + self.query_params.set_corrected_value( + user_key, serialized_value, metadata.value_type + ) + + def __contains__(self, key: str) -> bool: + try: + self[key] + except KeyError: + return False + else: + return True + + def get_stats( + self, _family_names: Sequence[str] | None = None + ) -> dict[str, list[CacheStat]]: + if config.get_option("server.enableExpensiveMemoryStats"): + from streamlit.runtime.stats import safe_sizeof + + byte_length = safe_sizeof(self) + else: + # Use a cheap item-count proxy instead of traversing the session + # state values, which can be very expensive. + byte_length = len(self) + + stat = CacheStat("st_session_state", "", byte_length) + # In general, get_stats methods need to be able to return only requested stat + # families, but this method only returns a single family, and we're guaranteed + # that it was one of those requested if we make it here. + return {CACHE_MEMORY_FAMILY: [stat]} + + def _check_serializable(self) -> None: + """Verify that everything added to session state can be serialized. + We use pickleability as the metric for serializability, and test for + pickleability by just trying it. + """ + for k in self: + try: + pickle.dumps(self[k]) + except Exception as e: # noqa: PERF203 + err_msg = ( + f"Cannot serialize the value (of type `{type(self[k])}`) of '{k}' in " + "st.session_state. Streamlit has been configured to use " + "[pickle](https://docs.python.org/3/library/pickle.html) to " + "serialize session_state values. Please convert the value to a " + "pickle-serializable type. To learn more about this behavior, " + "see [our docs](https://docs.streamlit.io/knowledge-base/using-streamlit/serializable-session-state)." + ) + raise UnserializableSessionStateError(err_msg) from e + + def maybe_check_serializable(self) -> None: + """Verify that session state can be serialized, if the relevant config + option is set. + + See `_check_serializable` for details. + """ + if config.get_option("runner.enforceSerializableSessionState"): + self._check_serializable() + + +def _is_internal_key(key: str) -> bool: + return key.startswith(STREAMLIT_INTERNAL_KEY_PREFIX) + + +def _is_stale_widget( + metadata: WidgetMetadata[Any] | None, + active_widget_ids: frozenset[str], + fragment_ids_this_run: list[str] | None, +) -> bool: + if not metadata: + return True + + # If we're running 1 or more fragments, but this widget is unrelated to any of the + # fragments that we're running, then it should not be marked as stale as its value + # may still be needed for a future fragment run or full script run. + return not ( + metadata.id in active_widget_ids + or (fragment_ids_this_run and metadata.fragment_id not in fragment_ids_this_run) + ) + + +@dataclass +class SessionStateStatProvider(StatsProvider): + _session_mgr: SessionManager + + @property + def stats_families(self) -> Sequence[str]: + return (CACHE_MEMORY_FAMILY,) + + def get_stats( + self, _family_names: Sequence[str] | None = None + ) -> dict[str, list[CacheStat]]: + stats: list[CacheStat] = [] + for session_info in self._session_mgr.list_active_sessions(): + session_state = session_info.session.session_state + session_stats = session_state.get_stats() + for family_stats in session_stats.values(): + stats.extend(family_stats) + if not stats: + return {} + # In general, get_stats methods need to be able to return only requested stat + # families, but this method only returns a single family, and we're guaranteed + # that it was one of those requested if we make it here. + return {CACHE_MEMORY_FAMILY: group_cache_stats(stats)} diff --git a/venv/Lib/site-packages/streamlit/runtime/state/session_state_proxy.py b/venv/Lib/site-packages/streamlit/runtime/state/session_state_proxy.py new file mode 100644 index 0000000000000000000000000000000000000000..acc6301977f70a713922ce3855d33095b5508867 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/state/session_state_proxy.py @@ -0,0 +1,153 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +from collections.abc import Iterator, MutableMapping +from typing import Any, Final + +from streamlit import logger as _logger +from streamlit import runtime +from streamlit.elements.lib.utils import Key +from streamlit.runtime.metrics_util import gather_metrics +from streamlit.runtime.state.common import require_valid_user_key +from streamlit.runtime.state.safe_session_state import SafeSessionState +from streamlit.runtime.state.session_state import SessionState + +_LOGGER: Final = _logger.get_logger(__name__) + + +_state_use_warning_already_displayed: bool = False +# The mock session state is used as a fallback if the script is run without `streamlit run` +_mock_session_state: SafeSessionState | None = None + + +def get_session_state() -> SafeSessionState: + """Get the SessionState object for the current session. + + Note that in streamlit scripts, this function should not be called + directly. Instead, SessionState objects should be accessed via + st.session_state. + """ + global _state_use_warning_already_displayed # noqa: PLW0603 + from streamlit.runtime.scriptrunner_utils.script_run_context import ( + get_script_run_ctx, + ) + + ctx = get_script_run_ctx() + + # If there is no script run context because the script is run bare, we + # use a global mock session state version to allow bare script execution (via python script.py) + if ctx is None: + if not _state_use_warning_already_displayed: + _state_use_warning_already_displayed = True + if not runtime.exists(): + _LOGGER.warning( + "Session state does not function when running a script without `streamlit run`" + ) + + global _mock_session_state # noqa: PLW0603 + + if _mock_session_state is None: + # Lazy initialize the mock session state + _mock_session_state = SafeSessionState(SessionState(), lambda: None) + return _mock_session_state + return ctx.session_state + + +class SessionStateProxy(MutableMapping[Key, Any]): + """A stateless singleton that proxies `st.session_state` interactions + to the current script thread's SessionState instance. + + The proxy API differs slightly from SessionState: it does not allow + callers to get, set, or iterate over "keyless" widgets (that is, widgets + that were created without a user_key, and have autogenerated keys). + """ + + def __iter__(self) -> Iterator[Any]: + """Iterator over user state and keyed widget values.""" + # TODO: this is unsafe if fastReruns is true! Let's deprecate/remove. + return iter(get_session_state().filtered_state) + + def __len__(self) -> int: + """Number of user state and keyed widget values in session_state.""" + return len(get_session_state().filtered_state) + + def __str__(self) -> str: + """String representation of user state and keyed widget values.""" + return str(get_session_state().filtered_state) + + def __getitem__(self, key: Key) -> Any: + """Return the state or widget value with the given key. + + Raises + ------ + StreamlitAPIException + If the key is not a valid SessionState user key. + """ + key = str(key) + require_valid_user_key(key) + return get_session_state()[key] + + @gather_metrics("session_state.set_item") + def __setitem__(self, key: Key, value: Any) -> None: + """Set the value of the given key. + + Raises + ------ + StreamlitAPIException + If the key is not a valid SessionState user key. + """ + key = str(key) + require_valid_user_key(key) + get_session_state()[key] = value + + def __delitem__(self, key: Key) -> None: + """Delete the value with the given key. + + Raises + ------ + StreamlitAPIException + If the key is not a valid SessionState user key. + """ + key = str(key) + require_valid_user_key(key) + del get_session_state()[key] + + def __getattr__(self, key: str) -> Any: + try: + return self[key] + except KeyError: + raise AttributeError(_missing_attr_error_message(key)) + + @gather_metrics("session_state.set_attr") + def __setattr__(self, key: str, value: Any) -> None: + self[key] = value + + def __delattr__(self, key: str) -> None: + try: + del self[key] + except KeyError: + raise AttributeError(_missing_attr_error_message(key)) + + def to_dict(self) -> dict[str, Any]: + """Return a dict containing all session_state and keyed widget values.""" + return get_session_state().filtered_state + + +def _missing_attr_error_message(attr_name: str) -> str: + return ( + f'st.session_state has no attribute "{attr_name}". Did you forget to initialize it? ' + f"More info: https://docs.streamlit.io/develop/concepts/architecture/session-state#initialization" + ) diff --git a/venv/Lib/site-packages/streamlit/runtime/state/widgets.py b/venv/Lib/site-packages/streamlit/runtime/state/widgets.py new file mode 100644 index 0000000000000000000000000000000000000000..3025055d250075dc24db470bd22952731b4ce62b --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/state/widgets.py @@ -0,0 +1,229 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +from typing import TYPE_CHECKING + +from streamlit.errors import ( + StreamlitAPIException, + StreamlitInvalidBindValueError, + StreamlitInvalidPersistStateError, +) +from streamlit.runtime.scriptrunner_utils.script_run_context import ( + ThreadState, +) +from streamlit.runtime.state.common import ( + BindOption, + PersistStateOption, + RegisterWidgetResult, + T, + ValueFieldName, + WidgetArgs, + WidgetCallback, + WidgetDeserializer, + WidgetKwargs, + WidgetMetadata, + WidgetSerializer, + WidgetValuePresenter, + user_key_from_element_id, +) + +if TYPE_CHECKING: + from streamlit.runtime.scriptrunner import ScriptRunContext + + +def register_widget( + element_id: str, + *, + deserializer: WidgetDeserializer[T], + serializer: WidgetSerializer[T], + ctx: ScriptRunContext | None, + callbacks: dict[str, WidgetCallback] | None = None, + on_change_handler: WidgetCallback | None = None, + args: WidgetArgs | None = None, + kwargs: WidgetKwargs | None = None, + value_type: ValueFieldName, + presenter: WidgetValuePresenter | None = None, + bind: BindOption = None, + persist_state: PersistStateOption = None, + # For selection widgets with bind="query-params": the valid option strings + # used to validate and filter URL values during seeding. + formatted_options: list[str] | None = None, + clearable: bool | None = None, + max_array_length: int | None = None, + allow_url_duplicates: bool = False, +) -> RegisterWidgetResult[T]: + """Register a widget with Streamlit, and return its current value. + NOTE: This function should be called after the proto has been filled. + + Parameters + ---------- + element_id : str + The id of the element. Must be unique. + deserializer : WidgetDeserializer[T] + Called to convert a widget's protobuf value to the value returned by + its st. function. + serializer : WidgetSerializer[T] + Called to convert a widget's value to its protobuf representation. + ctx : ScriptRunContext or None + Used to ensure uniqueness of widget IDs, and to look up widget values. + callbacks : dict[str, WidgetCallback] or None + A dictionary of callbacks for multi-callback support. + on_change_handler : WidgetCallback or None + An optional callback invoked when the widget's value changes. + args : WidgetArgs or None + Positional arguments to pass to the `on_change_handler` or `callbacks`. + kwargs : WidgetKwargs or None + Keyword arguments to pass to the `on_change_handler` or `callbacks`. + value_type: ValueFieldName + The value_type the widget is going to use. + We use this information to start with a best-effort guess for the value_type + of each widget. Once we actually receive a proto for a widget from the + frontend, the guess is updated to be the correct type. Unfortunately, we're + not able to always rely on the proto as the type may be needed earlier. + Thankfully, in these cases (when value_type == "trigger_value"), the static + table here being slightly inaccurate should never pose a problem. + presenter : WidgetValuePresenter or None + An optional hook that allows a widget to customize how its value should be + presented. + bind : BindOption + Optional binding for the widget's value to external state. + Currently only "query-params" is supported, which binds the widget + value to a URL query parameter. Requires a user-provided key. + persist_state : "page", "session", or None + How long to preserve the widget's value when it isn't rendered. If + "page", the value is preserved only while the user stays on the page + where the widget is defined (for example, while it is conditionally + hidden); it is discarded on a page switch and not restored on return. + If "session", it is preserved for the whole session, including across + page switches, so it returns when the user navigates back. If None, it + is not preserved. Requires a user-provided key. If bind="query-params" + is also set, the binding takes precedence: the value is stored in the + URL and therefore persists across page switches regardless of the + persist_state scope. + formatted_options : list[str] or None + **Temporary** - will be removed once all selection widgets use string-based + wire formats. Currently used for index-based widgets (pills, segmented_control, + select_slider) to convert indices back to human-readable option strings + in URLs when auto-correcting filtered values. + clearable : bool or None + Whether the widget can be cleared to an empty state (reflects widget's UI + behavior). When True, an empty URL param (e.g., ?foo=) will seed the widget + with an empty value. When False, an empty URL param will be ignored. + **Required when bind='query-params'**, otherwise defaults to False. + + Returns + ------- + register_widget_result : RegisterWidgetResult[T] + Provides information on which value to return to the widget caller, + and whether the UI needs updating. + + - Unhappy path: + - Our ScriptRunContext doesn't exist (meaning that we're running + as a "bare script" outside streamlit). + - We are disconnected from the SessionState instance. + In both cases we'll return a fallback RegisterWidgetResult[T]. + - Happy path: + - The widget has already been registered on a previous run but the + user hasn't interacted with it on the client. The widget will have + the default value it was first created with. We then return a + RegisterWidgetResult[T], containing this value. + - The widget has already been registered and the user *has* + interacted with it. The widget will have that most recent + user-specified value. We then return a RegisterWidgetResult[T], + containing this value. + + For both paths a widget return value is provided, allowing the widgets + to be used in a non-streamlit setting. + """ + if on_change_handler is not None and callbacks is not None: + raise StreamlitAPIException( + "Cannot provide both `on_change` and `callbacks` to a widget." + ) + + # Validate bind parameter value + if bind is not None and bind != "query-params": + raise StreamlitInvalidBindValueError(bind) + + # Validate that widget with bind="query-params" has a provided key + if bind == "query-params": + user_key = user_key_from_element_id(element_id) + if user_key is None: + raise StreamlitAPIException( + "When using bind='query-params', the widget must have a unique 'key' " + "parameter specified. This 'key' will be used as the name of the " + "query parameter." + ) + # Internal API check: clearable must be set for query param binding + if clearable is None: + raise ValueError( + "clearable must be explicitly set when bind='query-params'. " + "This is required for correct empty value handling." + ) + + # Validate persist_state value and key requirement. + if persist_state is not None: + if persist_state not in {"page", "session"}: + raise StreamlitInvalidPersistStateError(persist_state) + if user_key_from_element_id(element_id) is None: + raise StreamlitAPIException( + "When using persist_state, the widget must have a unique 'key' " + "parameter specified so its value can be preserved across reruns " + "and page switches." + ) + + # Create the widget's updated metadata, and register it with session_state. + metadata = WidgetMetadata( + element_id, + deserializer, + serializer, + value_type=value_type, + callback=on_change_handler, + callbacks=callbacks, + callback_args=args, + callback_kwargs=kwargs, + fragment_id=ThreadState.get().fragment_id if ctx else None, + presenter=presenter, + bind=bind, + persist_state=persist_state, + formatted_options=formatted_options, + clearable=clearable if clearable is not None else False, + max_array_length=max_array_length, + allow_url_duplicates=allow_url_duplicates, + ) + return register_widget_from_metadata(metadata, ctx) + + +def register_widget_from_metadata( + metadata: WidgetMetadata[T], + ctx: ScriptRunContext | None, +) -> RegisterWidgetResult[T]: + """Register a widget and return its value, using an already constructed + `WidgetMetadata`. + + This is split out from `register_widget` to allow caching code to replay + widgets by saving and reusing the completed metadata. + + See `register_widget` for details on what this returns. + """ + if ctx is None: + # Early-out if we don't have a script run context (which probably means + # we're running as a "bare" Python script, and not via `streamlit run`). + return RegisterWidgetResult.failure(deserializer=metadata.deserializer) + + widget_id = metadata.id + user_key = user_key_from_element_id(widget_id) + + return ctx.session_state.register_widget(metadata, user_key) diff --git a/venv/Lib/site-packages/streamlit/runtime/stats.py b/venv/Lib/site-packages/streamlit/runtime/stats.py new file mode 100644 index 0000000000000000000000000000000000000000..2cd6643179b420c41c85bd70ef976c3fd1846a4e --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/stats.py @@ -0,0 +1,406 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import itertools +from typing import TYPE_CHECKING, Any, Final, NamedTuple, Protocol, runtime_checkable + +from streamlit.logger import get_logger + +_LOGGER: Final = get_logger(__name__) + +CACHE_MEMORY_FAMILY: Final = "cache_memory_bytes" +SESSION_EVENTS_FAMILY: Final = "session_events" +SESSION_DURATION_FAMILY: Final = "session_duration_seconds" +ACTIVE_SESSIONS_FAMILY: Final = "active_sessions" +USER_SESSION_EVENTS_FAMILY: Final = "user_session_events" + + +def _escape_label_value(value: str) -> str: + """Escape a label value for the OpenMetrics text exposition format. + + Backslashes, double quotes, and newlines must be escaped per the + OpenMetrics spec. This matters for labels carrying user-controlled values + (e.g. user_session_events identity labels), which could otherwise emit + malformed output and break a scraper's parse of the whole payload. + """ + return value.replace("\\", "\\\\").replace('"', '\\"').replace("\n", "\\n") + + +def _labels_to_str(labels: dict[str, str]) -> str: + """Render sorted, escaped ``key="value"`` label pairs for the text format.""" + return ",".join( + f'{name}="{_escape_label_value(value)}"' + for name, value in sorted(labels.items()) + ) + + +def safe_sizeof(obj: Any) -> int: + """Return the memory size of an object in bytes, or 0 if sizing fails. + + Some objects (e.g., SQLAlchemy connections) contain internal references that + cannot be sized by pympler.asizeof (e.g., objects that don't support weak + references). This function catches those exceptions and returns 0 instead + of propagating the error. + """ + # Import inside function for lazy loading (reduces startup time). + # Python's import system caches modules, so repeated calls have minimal overhead. + from streamlit.vendor.pympler.asizeof import asizeof + + try: + return asizeof(obj) + except (TypeError, ReferenceError): + # TypeError: objects that don't support weak references (e.g., SQLAlchemy's + # _EmptyListener). ReferenceError: weak references that have been garbage + # collected during traversal. + _LOGGER.debug( + "Failed to calculate size for object of type %s", + type(obj).__name__, + exc_info=True, + ) + return 0 + + +if TYPE_CHECKING: + from collections.abc import Mapping, Sequence + + from streamlit.proto.openmetrics_data_model_pb2 import ( + Metric as MetricProto, + ) + from streamlit.proto.openmetrics_data_model_pb2 import ( + MetricType, + ) + + +@runtime_checkable +class Stat(Protocol): + """Protocol for a stat that can be serialized to OpenMetrics format. + + All stats must have these fields to identify the metric family they belong to + and provide metadata for OpenMetrics serialization. + """ + + @property + def family_name(self) -> str: + """The name of the metric family (e.g. 'cache_memory_bytes').""" + + @property + def type(self) -> str: + """The OpenMetrics type (e.g. 'gauge', 'counter').""" + + @property + def unit(self) -> str: + """The unit of the metric (e.g. 'bytes').""" + + @property + def help(self) -> str: + """A description of the metric.""" + + def to_metric_str(self) -> str: + """Convert this stat to an OpenMetrics-formatted string.""" + + def marshall_metric_proto(self, metric: MetricProto) -> None: + """Fill an OpenMetrics `Metric` protobuf object.""" + + +# TODO(vdonato): Could we use GaugeStat below and get rid of this class? +# We'd have to make some minor changes to use the other class, but overall the +# changes should be relatively minor. +class CacheStat(NamedTuple): + """Describes a single cache entry. + + Properties + ---------- + category_name : str + A human-readable name for the cache "category" that the entry belongs + to - e.g. "st.memo", "session_state", etc. + cache_name : str + A human-readable name for cache instance that the entry belongs to. + For "st.memo" and other function decorator caches, this might be the + name of the cached function. If the cache category doesn't have + multiple separate cache instances, this can just be the empty string. + byte_length : int + The entry's memory footprint in bytes. + """ + + category_name: str + cache_name: str + byte_length: int + + # Stat Protocol fields with default values for cache metrics + @property + def family_name(self) -> str: + return CACHE_MEMORY_FAMILY + + @property + def type(self) -> str: + return "gauge" + + @property + def unit(self) -> str: + return "bytes" + + @property + def help(self) -> str: + return "Total memory consumed by a cache." + + def to_metric_str(self) -> str: + return f'{self.family_name}{{cache_type="{self.category_name}",cache="{self.cache_name}"}} {self.byte_length}' + + def marshall_metric_proto(self, metric: MetricProto) -> None: + """Fill an OpenMetrics `Metric` protobuf object.""" + label = metric.labels.add() + label.name = "cache_type" + label.value = self.category_name + + label = metric.labels.add() + label.name = "cache" + label.value = self.cache_name + + metric_point = metric.metric_points.add() + metric_point.gauge_value.int_value = self.byte_length + + +def group_cache_stats(stats: list[CacheStat]) -> list[CacheStat]: + """Group a list of CacheStats by category_name and cache_name and sum byte_length.""" + + def key_function(individual_stat: CacheStat) -> tuple[str, str]: + return individual_stat.category_name, individual_stat.cache_name + + result: list[CacheStat] = [] + + sorted_stats = sorted(stats, key=key_function) + grouped_stats = itertools.groupby(sorted_stats, key=key_function) + + for (category_name, cache_name), single_group_stats in grouped_stats: + result.append( + CacheStat( + category_name=category_name, + cache_name=cache_name, + byte_length=sum(item.byte_length for item in single_group_stats), + ) + ) + return result + + +class CounterStat(NamedTuple): + """A counter stat. + + Properties + ---------- + family_name : str + The name of the metric family (e.g. 'session_events'). + value : int + The current count value. + labels : dict[str, str] | None + Labels to identify this specific counter (e.g. {"type": "connection"}). + unit : str + The unit of the metric (e.g. '' for unitless). + help : str + A description of the metric. + """ + + family_name: str + value: int + labels: dict[str, str] | None = None + unit: str = "" + help: str = "" + + @property + def type(self) -> str: + return "counter" + + def to_metric_str(self) -> str: + metric_name = f"{self.family_name}_total" + if self.labels: + return f"{metric_name}{{{_labels_to_str(self.labels)}}} {self.value}" + return f"{metric_name} {self.value}" + + def marshall_metric_proto(self, metric: MetricProto) -> None: + """Fill an OpenMetrics `Metric` protobuf object.""" + if self.labels: + for name, value in sorted(self.labels.items()): + label = metric.labels.add() + label.name = name + label.value = value + + metric_point = metric.metric_points.add() + metric_point.counter_value.int_value = self.value + + +class GaugeStat(NamedTuple): + """A gauge stat. + + Properties + ---------- + family_name : str + The name of the metric family (e.g. 'active_sessions'). + value : int + The current gauge value. + labels : dict[str, str] | None + Optional labels to identify this specific gauge. + unit : str + The unit of the metric (e.g. '' for unitless). + help : str + A description of the metric. + """ + + family_name: str + value: int + labels: dict[str, str] | None = None + unit: str = "" + help: str = "" + + @property + def type(self) -> str: + return "gauge" + + def to_metric_str(self) -> str: + if self.labels: + return f"{self.family_name}{{{_labels_to_str(self.labels)}}} {self.value}" + return f"{self.family_name} {self.value}" + + def marshall_metric_proto(self, metric: MetricProto) -> None: + """Fill an OpenMetrics `Metric` protobuf object.""" + if self.labels: + for name, value in sorted(self.labels.items()): + label = metric.labels.add() + label.name = name + label.value = value + + metric_point = metric.metric_points.add() + metric_point.gauge_value.int_value = self.value + + +def metric_type_string_to_proto(type_string: str) -> MetricType.ValueType: + """Convert a metric type string to its corresponding proto enum value.""" + from streamlit.proto.openmetrics_data_model_pb2 import ( + COUNTER, + GAUGE, + GAUGE_HISTOGRAM, + HISTOGRAM, + INFO, + STATE_SET, + SUMMARY, + UNKNOWN, + ) + + type_map = { + "gauge": GAUGE, + "counter": COUNTER, + "state_set": STATE_SET, + "info": INFO, + "histogram": HISTOGRAM, + "gauge_histogram": GAUGE_HISTOGRAM, + "summary": SUMMARY, + } + return type_map.get(type_string, UNKNOWN) + + +@runtime_checkable +class StatsProvider(Protocol): + @property + def stats_families(self) -> Sequence[str]: + """The metric family names that this provider supports. + + The StatsManager uses this property to determine which providers to call + when specific metric families are requested. + """ + + def get_stats( + self, family_names: Sequence[str] | None = None + ) -> Mapping[str, Sequence[Stat]]: + """Return stats for the specified metric families. + + Parameters + ---------- + family_names : Sequence[str] | None + If provided, only stats for these metric families should be computed + and returned. If None, stats for all families this provider supports + should be returned. Providers should check this parameter and skip + computing expensive stats for families that aren't requested. + + Returns + ------- + Mapping[str, Sequence[Stat]] + A mapping from metric family names to sequences of Stat objects. + """ + raise NotImplementedError + + +class StatsManager: + def __init__(self) -> None: + self._providers_by_family: dict[str, list[StatsProvider]] = {} + + def register_provider(self, provider: StatsProvider) -> None: + """Register a StatsProvider with the manager. + + This function is not thread-safe. Call it immediately after creation. + + Parameters + ---------- + provider : StatsProvider + The stats provider to register. The provider's `stats_families` + property determines which metric families it will be called for. + """ + for family in provider.stats_families: + if family not in self._providers_by_family: + self._providers_by_family[family] = [] + self._providers_by_family[family].append(provider) + + def get_stats( + self, family_names: Sequence[str] | None = None + ) -> Mapping[str, Sequence[Stat]]: + """Return registered stats grouped by metric family name. + + Parameters + ---------- + family_names : Sequence[str] | None + If provided, only stats for these metric families will be returned. + If None, stats for all registered families are returned. + + Returns + ------- + Mapping[str, Sequence[Stat]] + A mapping from metric family names to sequences of Stat objects + from all providers. + """ + result: dict[str, Sequence[Stat]] = {} + + families_to_query = family_names or list(self._providers_by_family.keys()) + + # Track which providers we've already queried to avoid duplicates. + # The same provider may be registered for multiple families, and we call + # `provider.get_stats(family_names)` below to fetch all stat families for + # a given stats provider at once. + queried_providers: set[int] = set() + + for family in families_to_query: + for provider in self._providers_by_family.get(family, []): + provider_id = id(provider) + if provider_id in queried_providers: + continue + queried_providers.add(provider_id) + + provider_stats = provider.get_stats(family_names) + for fname, stats in provider_stats.items(): + if fname not in result: + result[fname] = [] + # Use list() to convert Sequence to list for concatenation. + # This is needed for type covariance: providers return + # Mapping[str, Sequence[Stat]] but we build a dict of lists. + result[fname] = list(result[fname]) + list(stats) + + return result diff --git a/venv/Lib/site-packages/streamlit/runtime/theme_util.py b/venv/Lib/site-packages/streamlit/runtime/theme_util.py new file mode 100644 index 0000000000000000000000000000000000000000..09f01ae7e320d98f3455582e8822991962c514e1 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/theme_util.py @@ -0,0 +1,148 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + + +from __future__ import annotations + +from typing import TYPE_CHECKING + +from streamlit.errors import StreamlitAPIException +from streamlit.url_util import is_url + +if TYPE_CHECKING: + from streamlit.proto.NewSession_pb2 import CustomThemeConfig + + +def _parse_font_config( + font_config: str | None, + property_name: str, +) -> tuple[str, str | None]: + """Parse a single font configuration string. + + Args: + font_config: The font configuration string (e.g., "Inter" or "Inter:https://...") + property_name: The property name for error messages ("font", "codeFont", "headingFont") + + Returns + ------- + A tuple of (font_name, source_url). source_url is None if not provided or not valid. + """ + if not font_config: + return "", None + + # Strip leading/trailing whitespace from the config + font_config = font_config.strip() + + if ":" not in font_config: + # No colon found, treat the entire string as the font name + return font_config, None + + # Note: it is possible there are multiple colons in the string, so we need to split on the first colon. + font_name, source_url = font_config.split(":", 1) + # Strip whitespace from both font name and source + font_name = font_name.strip() + source_url = source_url.strip() + + # Check that the href does not contain multiple fonts, so we confirm that "family=" + # only shows up once in the source string (structure applies to Google Fonts only) + family_occurrences = source_url.count("family=") + if family_occurrences > 1: + raise StreamlitAPIException( + f"The source URL specified in the {property_name} property of config.toml contains multiple fonts. " + "Please specify only one font in the source URL." + ) + + is_valid_url = is_url(source_url) + + # If the source is a valid URL (http/https) but no font name is provided, throw an exception + if is_valid_url and not font_name: + raise StreamlitAPIException( + f"A font family name is required when specifying a source URL " + f"for the {property_name} property in config.toml." + ) + + if is_valid_url: + return font_name, source_url + + return font_name, None + + +def _get_font_source_config_name(property_name: str, section: str) -> str: + """Get the config name for font sources based on property and section. This is used on the FE + as the id for the font source link in the html head. + """ + if section == "theme": + return property_name + return f"{property_name}-sidebar" + + +def parse_fonts_with_source( + msg: CustomThemeConfig, + body_font_config: str | None, + code_font_config: str | None, + heading_font_config: str | None, + section: str, +) -> CustomThemeConfig: + """Populate the CustomThemeConfig message with the font, codeFont, and headingFont fields set, + as well as the font_sources field to be added to the html head. + + Args: + msg: CustomThemeConfig message to be populated. + body_font_config: A string with just the font name (e.g., "Inter") or in the format + ":". + code_font_config: A string with just the font name (e.g., "Roboto Mono") or in the format + ":". + heading_font_config: A string with just the font name (e.g., "Inter Bold") or in the format + ":". + section: The section of the config.toml file to parse the fonts from. + + Returns + ------- + Updated CustomThemeConfig message with the font, codeFont, and headingFont fields set. + Also sets sources in font_sources field to be added to the html (only when source URLs are provided). + + Examples + -------- + body_font_config: "Inter" (just font name) + code_font_config: "Tagesschrift:https://fonts.googleapis.com/css2?family=Tagesschrift&display=swap" (with source) + heading_font_config: "playwrite-cc-za:https://use.typekit.net/xxs7euo.css" + """ + + # Parse body font config + body_font_name, body_font_source = _parse_font_config(body_font_config, "font") + if body_font_name: + msg.body_font = body_font_name + if body_font_source: + config_name = _get_font_source_config_name("font", section) + msg.font_sources.add(config_name=config_name, source_url=body_font_source) + + # Parse code font config + code_font_name, code_font_source = _parse_font_config(code_font_config, "codeFont") + if code_font_name: + msg.code_font = code_font_name + if code_font_source: + config_name = _get_font_source_config_name("codeFont", section) + msg.font_sources.add(config_name=config_name, source_url=code_font_source) + + # Parse heading font config + heading_font_name, heading_font_source = _parse_font_config( + heading_font_config, "headingFont" + ) + if heading_font_name: + msg.heading_font = heading_font_name + if heading_font_source: + config_name = _get_font_source_config_name("headingFont", section) + msg.font_sources.add(config_name=config_name, source_url=heading_font_source) + + return msg diff --git a/venv/Lib/site-packages/streamlit/runtime/uploaded_file_manager.py b/venv/Lib/site-packages/streamlit/runtime/uploaded_file_manager.py new file mode 100644 index 0000000000000000000000000000000000000000..cf5f3274b279bb6bb1265360a1124769a8a20577 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/uploaded_file_manager.py @@ -0,0 +1,152 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import io +from abc import abstractmethod +from typing import TYPE_CHECKING, NamedTuple, Protocol + +from streamlit import util +from streamlit.runtime.stats import StatsProvider + +if TYPE_CHECKING: + from collections.abc import Sequence + + from streamlit.proto.Common_pb2 import FileURLs as FileURLsProto + + +class UploadedFileRec(NamedTuple): + """Metadata and raw bytes for an uploaded file. Immutable.""" + + file_id: str + name: str + type: str + data: bytes + + +class UploadFileUrlInfo(NamedTuple): + """Information we provide for single file in get_upload_urls.""" + + file_id: str + upload_url: str + delete_url: str + + +class DeletedFile(NamedTuple): + """Represents a deleted file in deserialized values for st.file_uploader and + st.camera_input. + + Return this from st.file_uploader and st.camera_input deserialize (so they can + be used in session_state), when widget value contains file record that is missing + from the storage. + DeleteFile instances filtered out before return final value to the user in script, + or before sending to frontend. + """ + + file_id: str + + +class UploadedFile(io.BytesIO): + """A mutable uploaded file. + + This class extends BytesIO, which has copy-on-write semantics when + initialized with `bytes`. + """ + + def __init__(self, record: UploadedFileRec, file_urls: FileURLsProto) -> None: + # BytesIO's copy-on-write semantics doesn't seem to be mentioned in + # the Python docs - possibly because it's a CPython-only optimization + # and not guaranteed to be in other Python runtimes. But it's detailed + # here: https://hg.python.org/cpython/rev/79a5fbe2c78f + super().__init__(record.data) + self.file_id = record.file_id + self.name = record.name + self.type = record.type + self.size = len(record.data) + self._file_urls = file_urls + + def __eq__(self, other: object) -> bool: + if not isinstance(other, UploadedFile): + return NotImplemented + return self.file_id == other.file_id + + def __hash__(self) -> int: + return hash(self.file_id) + + def __repr__(self) -> str: + return util.repr_(self) + + +class UploadedFileManager(StatsProvider, Protocol): + """UploadedFileManager protocol, that should be implemented by the concrete + uploaded file managers. + + It is responsible for: + - retrieving files by session_id and file_id for st.file_uploader and + st.camera_input + - cleaning up uploaded files associated with session on session end + + It should be created during Runtime initialization. + + Optionally UploadedFileManager could be responsible for issuing URLs which will be + used by frontend to upload files to. + """ + + @abstractmethod + def get_files( + self, session_id: str, file_ids: Sequence[str] + ) -> list[UploadedFileRec]: + """Return a list of UploadedFileRec for a given sequence of file_ids. + + Parameters + ---------- + session_id + The ID of the session that owns the files. + file_ids + The sequence of ids associated with files to retrieve. + + Returns + ------- + List[UploadedFileRec] + A list of URL UploadedFileRec instances, each instance contains information + about uploaded file. + """ + raise NotImplementedError # pragma: no cover - abstract + + @abstractmethod + def remove_session_files(self, session_id: str) -> None: + """Remove all files associated with a given session.""" + raise NotImplementedError # pragma: no cover - abstract + + def get_upload_urls( + self, session_id: str, file_names: Sequence[str] + ) -> list[UploadFileUrlInfo]: + """Return a list of UploadFileUrlInfo for a given sequence of file_names. + Optional to implement, issuing of URLs could be done by other service. + + Parameters + ---------- + session_id + The ID of the session that request URLs. + file_names + The sequence of file names for which URLs are requested + + Returns + ------- + List[UploadFileUrlInfo] + A list of UploadFileUrlInfo instances, each instance contains information + about uploaded file URLs. + """ + raise NotImplementedError # pragma: no cover - optional default diff --git a/venv/Lib/site-packages/streamlit/runtime/websocket_session_manager.py b/venv/Lib/site-packages/streamlit/runtime/websocket_session_manager.py new file mode 100644 index 0000000000000000000000000000000000000000..0b30ef9eb97075e3e1c4d9a1fb88b0c8c96bb34d --- /dev/null +++ b/venv/Lib/site-packages/streamlit/runtime/websocket_session_manager.py @@ -0,0 +1,428 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import threading +import time +from collections import defaultdict +from typing import TYPE_CHECKING, Final, cast + +from streamlit import config +from streamlit.logger import get_logger +from streamlit.runtime.app_session import AppSession +from streamlit.runtime.session_manager import ( + ActiveSessionInfo, + SessionClient, + SessionInfo, + SessionManager, + SessionStorage, +) +from streamlit.runtime.stats import ( + ACTIVE_SESSIONS_FAMILY, + SESSION_DURATION_FAMILY, + SESSION_EVENTS_FAMILY, + USER_SESSION_EVENTS_FAMILY, + CounterStat, + GaugeStat, + Stat, + StatsProvider, +) + +if TYPE_CHECKING: + from collections.abc import Callable, Mapping, Sequence + + from streamlit.runtime.script_data import ScriptData + from streamlit.runtime.scriptrunner.script_cache import ScriptCache + from streamlit.runtime.scriptrunner_utils.script_run_context import ( + OnScriptErrorHandler, + UserInfoType, + ) + from streamlit.runtime.uploaded_file_manager import UploadedFileManager + +_LOGGER: Final = get_logger(__name__) + + +_EVENT_TYPE_CONNECT: Final = "connect" +_EVENT_TYPE_RECONNECT: Final = "reconnect" +_EVENT_TYPE_DISCONNECT: Final = "disconnect" +_EVENT_TYPE_CLOSE: Final = "close" + + +class WebsocketSessionManager(SessionManager, StatsProvider): + """A SessionManager used to manage sessions with lifecycles tied to those of a + browser tab's websocket connection. + + WebsocketSessionManagers differentiate between "active" and "inactive" sessions. + Active sessions are those with a currently active websocket connection. Inactive + sessions are sessions without. Eventual cleanup of inactive sessions is a detail left + to the specific SessionStorage that a WebsocketSessionManager is instantiated with. + """ + + @property + def stats_families(self) -> Sequence[str]: + # USER_SESSION_EVENTS_FAMILY is advertised unconditionally so that the + # StatsManager (which snapshots this property once at registration time) + # always routes ?families=user_session_events requests to this provider. + # Emission is gated separately in get_stats so the endpoint output is + # unchanged while the feature is disabled. + return ( + SESSION_EVENTS_FAMILY, + SESSION_DURATION_FAMILY, + ACTIVE_SESSIONS_FAMILY, + USER_SESSION_EVENTS_FAMILY, + ) + + def __init__( + self, + session_storage: SessionStorage, + uploaded_file_manager: UploadedFileManager, + script_cache: ScriptCache, + message_enqueued_callback: Callable[[], None] | None, + on_script_error: OnScriptErrorHandler | None = None, + ) -> None: + self._session_storage = session_storage + self._uploaded_file_mgr = uploaded_file_manager + self._script_cache = script_cache + self._message_enqueued_callback = message_enqueued_callback + self._on_script_error = on_script_error + + # Mapping of AppSession.id -> ActiveSessionInfo. + self._active_session_info_by_id: dict[str, ActiveSessionInfo] = {} + + # Session event counters for metrics + self._stats_lock = threading.Lock() + self._connect_count: int = 0 + self._reconnect_count: int = 0 + self._disconnect_count: int = 0 + + # Session duration tracking + self._session_connect_times: dict[str, float] = {} + self._total_session_duration_seconds: float = 0 + + # Per-user session-event counters, keyed by a canonical tuple of + # (attr_name, attr_value) label pairs -> {event_type: count}. Only + # populated when server.unsafeMetricsUserAttributes is non-empty. Never + # pruned (bounded by the number of distinct users seen by the process). + self._user_event_counts: defaultdict[ + tuple[tuple[str, str], ...], defaultdict[str, int] + ] = defaultdict(lambda: defaultdict(int)) + # Identity cached per session id while a session is connected, so the + # terminal disconnect/close event can be attributed to the connect-time + # user. The entry is dropped on the first disconnect/close (and + # refreshed on reconnect), so the cache stays bounded by the set of + # currently-connected sessions and cannot leak when a disconnected + # session is later evicted from storage without an explicit close. + self._session_user_labels: dict[str, tuple[tuple[str, str], ...]] = {} + + def connect_session( + self, + client: SessionClient, + script_data: ScriptData, + user_info: UserInfoType, + existing_session_id: str | None = None, + session_id_override: str | None = None, + ) -> str: + if existing_session_id and session_id_override: # pragma: no cover - defensive + raise RuntimeError( + "Only one of existing_session_id and session_id_override should be truthy. " + "This should never happen." + ) + + if existing_session_id in self._active_session_info_by_id: + _LOGGER.warning( + "Session with id %s is already connected! Connecting to a new session.", + existing_session_id, + ) + + session_info = ( + existing_session_id + and existing_session_id not in self._active_session_info_by_id + and self._session_storage.get(existing_session_id) + ) + + if isinstance(session_info, SessionInfo): + existing_session = session_info.session + existing_session.register_file_watchers() + + self._active_session_info_by_id[existing_session.id] = ActiveSessionInfo( + client, + existing_session, + session_info.script_run_count, + ) + self._session_storage.delete(existing_session.id) + + with self._stats_lock: + self._reconnect_count += 1 + self._session_connect_times[existing_session.id] = time.monotonic() + self._record_user_event( + existing_session.id, _EVENT_TYPE_RECONNECT, user_info + ) + return existing_session.id + + session = AppSession( + script_data=script_data, + uploaded_file_manager=self._uploaded_file_mgr, + script_cache=self._script_cache, + message_enqueued_callback=self._message_enqueued_callback, + user_info=user_info, + session_id_override=session_id_override, + on_script_error=self._on_script_error, + ) + + _LOGGER.debug( + "Created new session for client %s. Session ID: %s", id(client), session.id + ) + + if ( + session.id in self._active_session_info_by_id + ): # pragma: no cover - defensive + raise RuntimeError( + f"session.id '{session.id}' registered multiple times. " + "This should never happen." + ) + + self._active_session_info_by_id[session.id] = ActiveSessionInfo(client, session) + with self._stats_lock: + self._connect_count += 1 + self._session_connect_times[session.id] = time.monotonic() + self._record_user_event(session.id, _EVENT_TYPE_CONNECT, user_info) + return session.id + + def disconnect_session(self, session_id: str) -> None: + if session_id in self._active_session_info_by_id: + active_session_info = self._active_session_info_by_id[session_id] + session = active_session_info.session + + session.request_script_stop() + session.disconnect_file_watchers() + session.clear_session_caches() + + self._session_storage.save( + SessionInfo( + client=None, + session=session, + script_run_count=active_session_info.script_run_count, + ) + ) + del self._active_session_info_by_id[session_id] + with self._stats_lock: + self._disconnect_count += 1 + self._accumulate_session_duration(session_id) + self._record_cached_user_event(session_id, _EVENT_TYPE_DISCONNECT) + + if not self._active_session_info_by_id: + # Avoid stale cached scripts when all file watchers and sessions are disconnected + self._script_cache.clear() + + def get_active_session_info(self, session_id: str) -> ActiveSessionInfo | None: + return self._active_session_info_by_id.get(session_id) + + def is_active_session(self, session_id: str) -> bool: + return session_id in self._active_session_info_by_id + + def list_active_sessions(self) -> list[ActiveSessionInfo]: + return list(self._active_session_info_by_id.values()) + + def close_session(self, session_id: str) -> None: + if session_id in self._active_session_info_by_id: + active_session_info = self._active_session_info_by_id[session_id] + del self._active_session_info_by_id[session_id] + active_session_info.session.shutdown() + # Count disconnect for active sessions being closed directly + with self._stats_lock: + self._disconnect_count += 1 + self._accumulate_session_duration(session_id) + self._record_cached_user_event(session_id, _EVENT_TYPE_CLOSE) + + if not self._active_session_info_by_id: + # Avoid stale cached scripts when all file watchers and sessions are disconnected + self._script_cache.clear() + return + + # For sessions in storage, the disconnect was already counted when + # disconnect_session was called earlier. + session_info = self._session_storage.get(session_id) + if session_info: + self._session_storage.delete(session_id) + session_info.session.shutdown() + with self._stats_lock: + self._accumulate_session_duration(session_id) + self._record_cached_user_event(session_id, _EVENT_TYPE_CLOSE) + + def _accumulate_session_duration(self, session_id: str) -> None: + """Accumulate the session duration for a closed session. + + This method must be called while holding self._stats_lock. + """ + connect_time = self._session_connect_times.pop(session_id, None) + if connect_time is not None: + duration = time.monotonic() - connect_time + self._total_session_duration_seconds += duration + + def _user_labels( + self, user_info: UserInfoType + ) -> tuple[tuple[str, str], ...] | None: + """Resolve canonical (name, value) label pairs from user_info. + + Returns None when the feature is disabled (the option is empty). + Missing/None attributes become "" (but other falsy values such as + ``False`` are preserved). + + This method must be called while holding self._stats_lock. + """ + attrs = config.get_option("server.unsafeMetricsUserAttributes") + if not attrs: + return None + return tuple( + sorted( + (name, "" if (value := user_info.get(name)) is None else str(value)) + for name in attrs + ) + ) + + def _record_user_event( + self, session_id: str, event_type: str, user_info: UserInfoType + ) -> None: + """Record a per-user connect/reconnect event and cache the identity. + + Best-effort: a telemetry failure must never break the session lifecycle. + This method must be called while holding self._stats_lock. + """ + try: + labels = self._user_labels(user_info) + if labels is not None: + self._user_event_counts[labels][event_type] += 1 + self._session_user_labels[session_id] = labels + except Exception: + _LOGGER.debug( + "Failed to record per-user %s event", event_type, exc_info=True + ) + + def _record_cached_user_event(self, session_id: str, event_type: str) -> None: + """Record a per-user disconnect/close event using the cached identity. + + The cached identity is always removed (even when the feature is + disabled), so the cache stays bounded by the currently-connected + sessions and cannot leak when a disconnected session is later evicted + from storage without an explicit close. The option is re-checked so a + runtime-disable stops emitting new events. Best-effort: a telemetry + failure must never break the session lifecycle. Must be called while + holding self._stats_lock. + """ + try: + labels = self._session_user_labels.pop(session_id, None) + if labels is not None and config.get_option( + "server.unsafeMetricsUserAttributes" + ): + self._user_event_counts[labels][event_type] += 1 + except Exception: + _LOGGER.debug( + "Failed to record per-user %s event", event_type, exc_info=True + ) + + def get_session_info(self, session_id: str) -> SessionInfo | None: + session_info = self.get_active_session_info(session_id) + if session_info: + return cast("SessionInfo", session_info) + return self._session_storage.get(session_id) + + def list_sessions(self) -> list[SessionInfo]: + return ( + cast("list[SessionInfo]", self.list_active_sessions()) + + self._session_storage.list() + ) + + def get_stats( + self, family_names: Sequence[str] | None = None + ) -> Mapping[str, Sequence[Stat]]: + """Return session-related metrics. + + Returns session event counters (connections, reconnections, disconnections) + and the current count of active sessions. + """ + result: dict[str, list[Stat]] = {} + + if family_names is None or SESSION_EVENTS_FAMILY in family_names: + with self._stats_lock: + connect_count = self._connect_count + reconnect_count = self._reconnect_count + disconnect_count = self._disconnect_count + + result[SESSION_EVENTS_FAMILY] = [ + CounterStat( + family_name=SESSION_EVENTS_FAMILY, + value=connect_count, + labels={"type": _EVENT_TYPE_CONNECT}, + help="Total count of session events by type.", + ), + CounterStat( + family_name=SESSION_EVENTS_FAMILY, + value=reconnect_count, + labels={"type": _EVENT_TYPE_RECONNECT}, + help="Total count of session events by type.", + ), + CounterStat( + family_name=SESSION_EVENTS_FAMILY, + value=disconnect_count, + labels={"type": _EVENT_TYPE_DISCONNECT}, + help="Total count of session events by type.", + ), + ] + + if family_names is None or SESSION_DURATION_FAMILY in family_names: + with self._stats_lock: + total_duration = int(self._total_session_duration_seconds) + + result[SESSION_DURATION_FAMILY] = [ + CounterStat( + family_name=SESSION_DURATION_FAMILY, + value=total_duration, + unit="seconds", + help="Total time spent in active sessions, in seconds.", + ), + ] + + if family_names is None or ACTIVE_SESSIONS_FAMILY in family_names: + result[ACTIVE_SESSIONS_FAMILY] = [ + GaugeStat( + family_name=ACTIVE_SESSIONS_FAMILY, + value=len(self._active_session_info_by_id), + help="Current number of active sessions.", + ), + ] + + if config.get_option("server.unsafeMetricsUserAttributes") and ( + family_names is None or USER_SESSION_EVENTS_FAMILY in family_names + ): + with self._stats_lock: + snapshot = { + labels: dict(events) + for labels, events in self._user_event_counts.items() + } + + result[USER_SESSION_EVENTS_FAMILY] = [ + CounterStat( + family_name=USER_SESSION_EVENTS_FAMILY, + value=count, + # `type` must win over any user attribute; unpack user + # labels first so the discriminator is never shadowed. + labels={**dict(labels), "type": event_type}, + help="Total count of session events by type and user.", + ) + for labels, events in snapshot.items() + for event_type, count in events.items() + ] + + return result diff --git a/venv/Lib/site-packages/streamlit/source_util.py b/venv/Lib/site-packages/streamlit/source_util.py new file mode 100644 index 0000000000000000000000000000000000000000..e6889df5dbed2fd74f99bac75f2e8b5d39b0ab10 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/source_util.py @@ -0,0 +1,97 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +from __future__ import annotations + +import re +from typing import TYPE_CHECKING, TextIO, TypeAlias, TypedDict + +from typing_extensions import NotRequired + +from streamlit.string_util import extract_leading_emoji + +if TYPE_CHECKING: + from pathlib import Path + +PageHash: TypeAlias = str +PageName: TypeAlias = str +ScriptPath: TypeAlias = str +Icon: TypeAlias = str + + +class PageInfo(TypedDict): + script_path: ScriptPath + page_script_hash: PageHash + icon: NotRequired[Icon] + page_name: NotRequired[PageName] + url_pathname: NotRequired[str] + + +def open_python_file(filename: str) -> TextIO: + """Open a read-only Python file taking proper care of its encoding. + + In Python 3, we would like all files to be opened with utf-8 encoding. + However, some author like to specify PEP263 headers in their source files + with their own encodings. In that case, we should respect the author's + encoding. + """ + import tokenize + + if hasattr(tokenize, "open"): # Added in Python 3.2 + # Open file respecting PEP263 encoding. If no encoding header is + # found, opens as utf-8. + return tokenize.open(filename) + return open(filename, encoding="utf-8") + + +PAGE_FILENAME_REGEX = re.compile(r"([0-9]*)[_ -]*(.*)\.py") + + +def page_sort_key(script_path: Path) -> tuple[float, str]: + matches = re.findall(PAGE_FILENAME_REGEX, script_path.name) + + # Failing this should only be possible if script_path isn't a Python + # file, which should never happen. + if len(matches) == 0: # pragma: no cover - defensive + raise ValueError( + f"{script_path} is not a Python file. This should never happen." + ) + + [(number, label)] = matches + label = label.lower() + + if number == "": + return (float("inf"), label) + + return (float(number), label) + + +def page_icon_and_name(script_path: Path) -> tuple[str, str]: + """Compute the icon and name of a page from its script path. + + This is *almost* the page name displayed in the nav UI, but it has + underscores instead of spaces. The reason we do this is because having + spaces in URLs both looks bad and is hard to deal with due to the need to + URL-encode them. To solve this, we only swap the underscores for spaces + right before we render page names. + """ + extraction: re.Match[str] | None = re.search(PAGE_FILENAME_REGEX, script_path.name) + if extraction is None: + return "", "" + + icon_and_name = re.sub( + r"[_ ]+", "_", extraction.group(2) + ).strip() or extraction.group(1) + + return extract_leading_emoji(icon_and_name) diff --git a/venv/Lib/site-packages/streamlit/starlette.py b/venv/Lib/site-packages/streamlit/starlette.py new file mode 100644 index 0000000000000000000000000000000000000000..9b4f0d5996d5b73454217e6e61b7d6cafb13bace --- /dev/null +++ b/venv/Lib/site-packages/streamlit/starlette.py @@ -0,0 +1,34 @@ +# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026) +# +# 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. + +"""Starlette integration for Streamlit. + +This module provides the ASGI-compatible App class for running Streamlit +applications with any ASGI server (uvicorn, hypercorn, etc.). + +Example +------- +>>> from streamlit.starlette import App +>>> app = App("main.py") + +Run with uvicorn: + +.. code-block:: bash + + uvicorn myapp:app --host 0.0.0.0 --port 8501 +""" + +from streamlit.web.server.starlette.starlette_app import App + +__all__ = ["App"] diff --git a/venv/Lib/site-packages/streamlit/static/favicon.png b/venv/Lib/site-packages/streamlit/static/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..dbb5a6aa267be2d87369634e479bbba03a87836e --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/favicon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89fe5c560c3b6b3c4a3af5791691a2c606bb24b9f6deb7e71dccb509d588d7e1 +size 1019 diff --git a/venv/Lib/site-packages/streamlit/static/index.html b/venv/Lib/site-packages/streamlit/static/index.html new file mode 100644 index 0000000000000000000000000000000000000000..cf5535a4ccc52bfd40d6c9bda9850131b77b5fc7 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/index.html @@ -0,0 +1,151 @@ + + + + + + + + + + + Streamlit + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/venv/Lib/site-packages/streamlit/static/manifest.json b/venv/Lib/site-packages/streamlit/static/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..ca3666d3094b3c78a48ef9a9ff93936d3c4f09ee --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/manifest.json @@ -0,0 +1,4994 @@ +{ + "../lib/src/assets/img/balloons/balloon-0.png": { + "file": "static/media/balloon-0.Czj7AKwE.png", + "src": "../lib/src/assets/img/balloons/balloon-0.png" + }, + "../lib/src/assets/img/balloons/balloon-1.png": { + "file": "static/media/balloon-1.CNvFFrND.png", + "src": "../lib/src/assets/img/balloons/balloon-1.png" + }, + "../lib/src/assets/img/balloons/balloon-2.png": { + "file": "static/media/balloon-2.DTvC6B1t.png", + "src": "../lib/src/assets/img/balloons/balloon-2.png" + }, + "../lib/src/assets/img/balloons/balloon-3.png": { + "file": "static/media/balloon-3.CgSk4tbL.png", + "src": "../lib/src/assets/img/balloons/balloon-3.png" + }, + "../lib/src/assets/img/balloons/balloon-4.png": { + "file": "static/media/balloon-4.mbtFrzxf.png", + "src": "../lib/src/assets/img/balloons/balloon-4.png" + }, + "../lib/src/assets/img/balloons/balloon-5.png": { + "file": "static/media/balloon-5.CSwkUfRA.png", + "src": "../lib/src/assets/img/balloons/balloon-5.png" + }, + "../lib/src/assets/img/snow/flake-0.png": { + "file": "static/media/flake-0.DgWaVvm5.png", + "src": "../lib/src/assets/img/snow/flake-0.png" + }, + "../lib/src/assets/img/snow/flake-1.png": { + "file": "static/media/flake-1.B2r5AHMK.png", + "src": "../lib/src/assets/img/snow/flake-1.png" + }, + "../lib/src/assets/img/snow/flake-2.png": { + "file": "static/media/flake-2.BnWSExPC.png", + "src": "../lib/src/assets/img/snow/flake-2.png" + }, + "../lib/src/components/elements/ArrowVegaLiteChart/ArrowVegaLiteChart.tsx": { + "file": "static/js/ArrowVegaLiteChart.C5lWLbxa.js", + "name": "ArrowVegaLiteChart", + "src": "../lib/src/components/elements/ArrowVegaLiteChart/ArrowVegaLiteChart.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_utils.94RcZhG4.js", + "_emotion-react.browser.esm.B06RJmME.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_uri.UNMuXGg5.js", + "_pandasStylerUtils.CpHtlemx.js", + "_isEqual.CgNOpGTC.js", + "_getColors.DtAxY2Hd.js", + "_utils.BrY_0PXX.js", + "_useEmotionTheme.D29Ufy6b.js", + "_ErrorElement.BWmlOcKX.js", + "_FormClearHelper.D0Yt6KG5.js", + "_useCalculatedDimensions.BnLCBgVi.js", + "_index.esm.DCRlH4DP.js", + "_DataFrame.Wny8mRut.js", + "_Check.esm.B4TBPV6z.js", + "_ContentCopy.esm.Dq-fIx3A.js", + "_FileDownload.esm.BM_tuzhj.js", + "_Toolbar.BynU-Hbw.js", + "_TableChart.esm.Bm7WHa8s.js", + "_useCopyToClipboard.31Hpj0n3.js", + "_useRequiredContext.F4hG38Ff.js", + "_withFullScreenWrapper.DjqP6oFO.js", + "_styled-components.CuxloOeN.js" + ] + }, + "../lib/src/components/elements/Audio/Audio.tsx": { + "file": "static/js/Audio.Bh9DVwbW.js", + "name": "Audio", + "src": "../lib/src/components/elements/Audio/Audio.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_useCrossOriginAttribute.DBi7mGp8.js" + ] + }, + "../lib/src/components/elements/Balloons/Balloons.tsx": { + "file": "static/js/Balloons.BQJiZ9SK.js", + "name": "Balloons", + "src": "../lib/src/components/elements/Balloons/Balloons.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_emotion-react.browser.esm.B06RJmME.js", + "_UriUtil.olyUCSHN.js", + "_Particles.CD7975JF.js" + ], + "assets": [ + "static/media/balloon-0.Czj7AKwE.png", + "static/media/balloon-1.CNvFFrND.png", + "static/media/balloon-2.DTvC6B1t.png", + "static/media/balloon-3.CgSk4tbL.png", + "static/media/balloon-4.mbtFrzxf.png", + "static/media/balloon-5.CSwkUfRA.png" + ] + }, + "../lib/src/components/elements/CodeBlock/StreamlitSyntaxHighlighter.tsx": { + "file": "static/js/StreamlitSyntaxHighlighter.BW47pBZj.js", + "name": "StreamlitSyntaxHighlighter", + "src": "../lib/src/components/elements/CodeBlock/StreamlitSyntaxHighlighter.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_ErrorElement.BWmlOcKX.js", + "_CodeBlockCopyToolbar.D57Zh6DT.js", + "_hastscript.BGKGo9FQ.js" + ] + }, + "../lib/src/components/elements/DeckGlJsonChart/DeckGlJsonChart.tsx": { + "file": "static/js/DeckGlJsonChart.Cl5CHFIi.js", + "name": "DeckGlJsonChart", + "src": "../lib/src/components/elements/DeckGlJsonChart/DeckGlJsonChart.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_isEqual.CgNOpGTC.js", + "_getColors.DtAxY2Hd.js", + "_utils.BrY_0PXX.js", + "_UriUtil.olyUCSHN.js", + "_useEmotionTheme.D29Ufy6b.js", + "_preload-helper.HclGiUj8.js", + "_useExecuteWhenChanged.CJi0fna4.js", + "_objectWithoutPropertiesLoose.DkqnLJVA.js", + "_index.esm.DCRlH4DP.js", + "_toConsumableArray.BxvvZSIl.js", + "_Toolbar.BynU-Hbw.js", + "_useRequiredContext.F4hG38Ff.js", + "_recordbatch.BmKVw6jF.js", + "_ResizeObserver.es.CdkJ1I5V.js", + "_slicedToArray.624-tfZX.js", + "_possibleConstructorReturn.DlxXudXd.js", + "_assertThisInitialized.Cpir0pD1.js", + "_withFullScreenWrapper.DjqP6oFO.js", + "_dist.CETvsizV.js", + "_linear.CR3348bP.js", + "_threshold.BuzS4kmB.js", + "_webgl-device.7mKl-kgB.js", + "_useBasicWidgetState.CpWukz_T.js" + ], + "dynamicImports": [ + "_webgl-device.7mKl-kgB.js" + ], + "css": [ + "static/css/DeckGlJsonChart.s6LXjV0D.css" + ] + }, + "../lib/src/components/elements/GraphVizChart/GraphVizChart.tsx": { + "file": "static/js/GraphVizChart.tdvLWnZL.js", + "name": "GraphVizChart", + "src": "../lib/src/components/elements/GraphVizChart/GraphVizChart.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_utils.BrY_0PXX.js", + "_UriUtil.olyUCSHN.js", + "_ErrorElement.BWmlOcKX.js", + "_useCalculatedDimensions.BnLCBgVi.js", + "_Toolbar.BynU-Hbw.js", + "_useRequiredContext.F4hG38Ff.js", + "_withFullScreenWrapper.DjqP6oFO.js", + "_defaultLocale.DAnyU4o_.js", + "_path.C6YKSwkP.js", + "_value.D6n4OHqi.js", + "_timer.BMV81txb.js", + "_src.CE7XIH0z.js" + ] + }, + "../lib/src/components/elements/Html/Html.tsx": { + "file": "static/js/Html.BpiXuX9J.js", + "name": "Html", + "src": "../lib/src/components/elements/Html/Html.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_purify.es.sLXpNpJ5.js" + ] + }, + "../lib/src/components/elements/IFrame/IFrame.tsx": { + "file": "static/js/IFrame.WjlxKKes.js", + "name": "IFrame", + "src": "../lib/src/components/elements/IFrame/IFrame.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_types.cZoyy9Y-.js", + "_IFrameUtil.PlC_b34Z.js" + ] + }, + "../lib/src/components/elements/ImageList/ImageList.tsx": { + "file": "static/js/ImageList.OTFtPVR9.js", + "name": "ImageList", + "src": "../lib/src/components/elements/ImageList/ImageList.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_UriUtil.olyUCSHN.js", + "_useCrossOriginAttribute.DBi7mGp8.js", + "_ErrorElement.BWmlOcKX.js", + "_Toolbar.BynU-Hbw.js", + "_useRequiredContext.F4hG38Ff.js", + "_withFullScreenWrapper.DjqP6oFO.js" + ] + }, + "../lib/src/components/elements/Json/Json.tsx": { + "file": "static/js/Json.CAbht5mc.js", + "name": "Json", + "src": "../lib/src/components/elements/Json/Json.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_getColors.DtAxY2Hd.js", + "_DynamicIcon.44zobID_.js", + "_useEmotionTheme.D29Ufy6b.js", + "_ErrorElement.BWmlOcKX.js", + "_useFloatingOverlay.DlcdWSVH.js", + "_useCopyToClipboard.31Hpj0n3.js", + "_ErrorHandling.H5STbbYb.js", + "_dist.CETvsizV.js", + "_reactJsonViewCompat.nQHHQTSK.js" + ] + }, + "../lib/src/components/elements/LinkButton/LinkButton.tsx": { + "file": "static/js/LinkButton.DF3DvSdk.js", + "name": "LinkButton", + "src": "../lib/src/components/elements/LinkButton/LinkButton.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_getColors.DtAxY2Hd.js", + "_UriUtil.olyUCSHN.js", + "_Tooltip.PNC8NIZa.js", + "_styled-components.B5oT30oI.js", + "_BaseButtonTooltip.DyFZqtoX.js", + "_DynamicButtonLabel.UT8nPWDL.js", + "_iconPosition.CHJpUZea.js" + ] + }, + "../lib/src/components/elements/Metric/Metric.tsx": { + "file": "static/js/Metric.CmkuJai4.js", + "name": "Metric", + "src": "../lib/src/components/elements/Metric/Metric.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_emotion-react.browser.esm.B06RJmME.js", + "_protobuf.DC2L68b9.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_getColors.DtAxY2Hd.js", + "_Icon.RiOK8SDN.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_useCalculatedDimensions.BnLCBgVi.js", + "_index.esm.DCRlH4DP.js", + "_styled-components.jxsKpeRi.js", + "_WidgetLabelHelpIconInline.DB6cihzP.js", + "_src.ChOBTULJ.js", + "_formatNumber.D1UJmEyL.js", + "_styled-components.CuxloOeN.js" + ] + }, + "../lib/src/components/elements/PageLink/PageLink.tsx": { + "file": "static/js/PageLink.B6pSdxAx.js", + "name": "PageLink", + "src": "../lib/src/components/elements/PageLink/PageLink.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_DynamicIcon.44zobID_.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_BaseButtonTooltip.DyFZqtoX.js", + "_NavigationContext.CaL318Cx.js", + "_iconPosition.CHJpUZea.js" + ] + }, + "../lib/src/components/elements/PlotlyChart/PlotlyChart.tsx": { + "file": "static/js/PlotlyChart.CylVV9WQ.js", + "name": "PlotlyChart", + "src": "../lib/src/components/elements/PlotlyChart/PlotlyChart.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_merge.CkO-ckia.js", + "_getColors.DtAxY2Hd.js", + "_useEmotionTheme.D29Ufy6b.js", + "_FormClearHelper.D0Yt6KG5.js", + "_useTimeout.CUauXJkz.js", + "_useCalculatedDimensions.BnLCBgVi.js", + "_useRequiredContext.F4hG38Ff.js", + "_ErrorHandling.H5STbbYb.js", + "_withFullScreenWrapper.DjqP6oFO.js", + "_resolveDefaultExport.DJbX7TqQ.js" + ] + }, + "../lib/src/components/elements/Progress/Progress.tsx": { + "file": "static/js/Progress.Blozw2Qh.js", + "name": "Progress", + "src": "../lib/src/components/elements/Progress/Progress.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_ProgressBar.C0SD2GrQ.js" + ] + }, + "../lib/src/components/elements/Snow/Snow.tsx": { + "file": "static/js/Snow.19L0RPh7.js", + "name": "Snow", + "src": "../lib/src/components/elements/Snow/Snow.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_emotion-react.browser.esm.B06RJmME.js", + "_UriUtil.olyUCSHN.js", + "_Particles.CD7975JF.js" + ], + "assets": [ + "static/media/flake-0.DgWaVvm5.png", + "static/media/flake-1.B2r5AHMK.png", + "static/media/flake-2.BnWSExPC.png" + ] + }, + "../lib/src/components/elements/Spinner/Spinner.tsx": { + "file": "static/js/Spinner.D2VvIf19.js", + "name": "Spinner", + "src": "../lib/src/components/elements/Spinner/Spinner.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_classnames.B69Vzagp.js", + "_DynamicIcon.44zobID_.js" + ] + }, + "../lib/src/components/elements/Table/Table.tsx": { + "file": "static/js/Table.BiIqBR1C.js", + "name": "Table", + "src": "../lib/src/components/elements/Table/Table.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_pandasStylerUtils.CpHtlemx.js", + "_range.DL19EGGd.js" + ] + }, + "../lib/src/components/elements/Toast/Toast.tsx": { + "file": "static/js/Toast.Cdl1bFlD.js", + "name": "Toast", + "src": "../lib/src/components/elements/Toast/Toast.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_useEmotionTheme.D29Ufy6b.js", + "_toastQueue.CEO36h9N.js", + "_ErrorElement.BWmlOcKX.js", + "_AlertElement.BAyMiYwt.js" + ] + }, + "../lib/src/components/elements/Video/Video.tsx": { + "file": "static/js/Video.BopQK3O9.js", + "name": "Video", + "src": "../lib/src/components/elements/Video/Video.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_protobuf.DC2L68b9.js", + "_useCrossOriginAttribute.DBi7mGp8.js" + ] + }, + "../lib/src/components/shared/StreamlitMarkdown/MermaidChart.tsx": { + "file": "static/js/MermaidChart.C6B8_xWl.js", + "name": "MermaidChart", + "src": "../lib/src/components/shared/StreamlitMarkdown/MermaidChart.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_utils.94RcZhG4.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_getColors.DtAxY2Hd.js", + "_useEmotionTheme.D29Ufy6b.js", + "_ErrorElement.BWmlOcKX.js", + "_preload-helper.HclGiUj8.js", + "_Check.esm.B4TBPV6z.js", + "_ContentCopy.esm.Dq-fIx3A.js", + "_FileDownload.esm.BM_tuzhj.js", + "_Toolbar.BynU-Hbw.js", + "_useCopyToClipboard.31Hpj0n3.js", + "_useRequiredContext.F4hG38Ff.js", + "_withFullScreenWrapper.DjqP6oFO.js" + ], + "dynamicImports": [ + "../node_modules/mermaid/dist/mermaid.core.mjs" + ] + }, + "../lib/src/components/widgets/AudioInput/AudioInput.tsx": { + "file": "static/js/AudioInput.Bj4ItJDj.js", + "name": "AudioInput", + "src": "../lib/src/components/widgets/AudioInput/AudioInput.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_zip.DLtjLZjW.js", + "_Icon.RiOK8SDN.js", + "_DynamicIcon.44zobID_.js", + "_UriUtil.olyUCSHN.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_styled-components.B5oT30oI.js", + "_BaseButton.DzUQ5vsa.js", + "_FormClearHelper.D0Yt6KG5.js", + "_useWidgetManagerElementState.CbF0sesb.js", + "_index.esm.DCRlH4DP.js", + "_Delete.esm.CDosXh7J.js", + "_FileDownload.esm.BM_tuzhj.js", + "_Toolbar.BynU-Hbw.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIcon.BmvkC-YW.js", + "_ErrorHandling.H5STbbYb.js", + "_createDownloadLinkElement.CV8DGZx1.js", + "_useWaveformController.By203ydw.js", + "_urls.B0fCYwet.js" + ] + }, + "../lib/src/components/widgets/BidiComponent/BidiComponent.tsx": { + "file": "static/js/BidiComponent.B_vvnuke.js", + "name": "BidiComponent", + "src": "../lib/src/components/widgets/BidiComponent/BidiComponent.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_toString.tRXNBxtF.js", + "__arrayReduce.CiwPAjrV.js", + "_getColors.DtAxY2Hd.js", + "_useCrossOriginAttribute.DBi7mGp8.js", + "_useEmotionTheme.D29Ufy6b.js", + "_ErrorElement.BWmlOcKX.js", + "_preload-helper.HclGiUj8.js", + "_useRequiredContext.F4hG38Ff.js", + "_serialization.yxLiAHgz.js", + "_v4.DDdyfk2q.js", + "_ErrorHandling.H5STbbYb.js" + ] + }, + "../lib/src/components/widgets/Button/Button.tsx": { + "file": "static/js/Button.CGPLwGvS.js", + "name": "Button", + "src": "../lib/src/components/widgets/Button/Button.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_Tooltip.PNC8NIZa.js", + "_styled-components.B5oT30oI.js", + "_BaseButton.DzUQ5vsa.js", + "_BaseButtonTooltip.DyFZqtoX.js", + "_DynamicButtonLabel.UT8nPWDL.js", + "_iconPosition.CHJpUZea.js" + ] + }, + "../lib/src/components/widgets/ButtonGroup/ButtonGroup.tsx": { + "file": "static/js/ButtonGroup.DO6jL9SN.js", + "name": "ButtonGroup", + "src": "../lib/src/components/widgets/ButtonGroup/ButtonGroup.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_utils.BrY_0PXX.js", + "_Tooltip.PNC8NIZa.js", + "_styled-components.B5oT30oI.js", + "_DynamicButtonLabel.UT8nPWDL.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIconInline.DB6cihzP.js", + "_useBasicWidgetState.CpWukz_T.js" + ] + }, + "../lib/src/components/widgets/CameraInput/CameraInput.tsx": { + "file": "static/js/CameraInput.BGpQNOjY.js", + "name": "CameraInput", + "src": "../lib/src/components/widgets/CameraInput/CameraInput.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_react-dom.DZwq-Xzd.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_isEqual.CgNOpGTC.js", + "_Icon.RiOK8SDN.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_styled-components.B5oT30oI.js", + "_BaseButton.DzUQ5vsa.js", + "_FormClearHelper.D0Yt6KG5.js", + "_useTimeout.CUauXJkz.js", + "_useCalculatedDimensions.BnLCBgVi.js", + "_index.esm.DCRlH4DP.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIcon.BmvkC-YW.js", + "_isMobile.ZOwND-6T.js", + "_ProgressBar.C0SD2GrQ.js", + "_urls.B0fCYwet.js", + "_UploadFileInfo.WAP1L8Dh.js" + ] + }, + "../lib/src/components/widgets/ChatInput/ChatInput.tsx": { + "file": "static/js/ChatInput.DJI0M0Iq.js", + "name": "ChatInput", + "src": "../lib/src/components/widgets/ChatInput/ChatInput.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_zip.DLtjLZjW.js", + "_getColors.DtAxY2Hd.js", + "_Close.esm.DiV9yyug.js", + "_Icon.RiOK8SDN.js", + "_DynamicIcon.44zobID_.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_useWidgetManagerElementState.CbF0sesb.js", + "_useCalculatedDimensions.BnLCBgVi.js", + "_index.esm.DCRlH4DP.js", + "_utils.Ca1sxtey.js", + "_useWindowDimensionsContext.HIxtcWyF.js", + "_src.ChOBTULJ.js", + "_useWaveformController.By203ydw.js", + "_UploadFileInfo.WAP1L8Dh.js", + "_InputInstructions.D7oNXsUt.js", + "_useTextInputAutoExpand.By9qSO8B.js", + "_inputUtils.CD44xxT-.js" + ] + }, + "../lib/src/components/widgets/Checkbox/Checkbox.tsx": { + "file": "static/js/Checkbox.CrcA6N0j.js", + "name": "Checkbox", + "src": "../lib/src/components/widgets/Checkbox/Checkbox.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_Tooltip.PNC8NIZa.js", + "_styled-components.BwagcMZe.js", + "_WidgetLabelHelpIconInline.DB6cihzP.js", + "_useBasicWidgetState.CpWukz_T.js" + ] + }, + "../lib/src/components/widgets/ColorPicker/ColorPicker.tsx": { + "file": "static/js/ColorPicker.C_qg1qMx.js", + "name": "ColorPicker", + "src": "../lib/src/components/widgets/ColorPicker/ColorPicker.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "__isIterateeCall.BUStsXAd.js", + "_isArrayLike.Crw2F5li.js", + "_merge.CkO-ckia.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_now.BzMxC3T_.js", + "_isUndefined.Dk8JX1dj.js", + "_map.CsK82nE3.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_useFloatingOverlay.DlcdWSVH.js", + "_useExecuteWhenChanged.CJi0fna4.js", + "__hasPath.BAJp1Wyr.js", + "__baseAssignValue.D38XrOT1.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIconInline.DB6cihzP.js", + "_useBasicWidgetState.CpWukz_T.js" + ] + }, + "../lib/src/components/widgets/CustomComponent/ComponentInstance.tsx": { + "file": "static/js/ComponentInstance.DhPDHW9t.js", + "name": "ComponentInstance", + "src": "../lib/src/components/widgets/CustomComponent/ComponentInstance.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_react-dom.DZwq-Xzd.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_useEmotionTheme.D29Ufy6b.js", + "_ErrorElement.BWmlOcKX.js", + "_useTimeout.CUauXJkz.js", + "_AlertElement.BAyMiYwt.js", + "_ErrorHandling.H5STbbYb.js", + "_query-string.aaJx2e0Y.js", + "_IFrameUtil.PlC_b34Z.js", + "_urls.B0fCYwet.js", + "_withCalculatedWidth.DClbrdOz.js" + ] + }, + "../lib/src/components/widgets/DateInput/DateInput.tsx": { + "file": "static/js/DateInput.VmwpQFr5.js", + "name": "DateInput", + "src": "../lib/src/components/widgets/DateInput/DateInput.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_types.cZoyy9Y-.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_getColors.DtAxY2Hd.js", + "_Icon.RiOK8SDN.js", + "_UriUtil.olyUCSHN.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_ErrorOutline.esm.CZ5wypOV.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIcon.BmvkC-YW.js", + "_chevron-down.gANryksn.js", + "_moment.CaJaEtMO.js", + "_useBasicWidgetState.CpWukz_T.js", + "_useIntlLocale.CiG3jZ1C.js" + ] + }, + "../lib/src/components/widgets/DateTimeInput/DateTimeInput.tsx": { + "file": "static/js/DateTimeInput.grj3wp9V.js", + "name": "DateTimeInput", + "src": "../lib/src/components/widgets/DateTimeInput/DateTimeInput.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_types.cZoyy9Y-.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_getColors.DtAxY2Hd.js", + "_Icon.RiOK8SDN.js", + "_UriUtil.olyUCSHN.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_ErrorOutline.esm.CZ5wypOV.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIcon.BmvkC-YW.js", + "_useWindowDimensionsContext.HIxtcWyF.js", + "_useScrollbarGutterSize.B_VG1Wad.js", + "_chevron-down.gANryksn.js", + "_moment.CaJaEtMO.js", + "_useBasicWidgetState.CpWukz_T.js", + "_useIntlLocale.CiG3jZ1C.js", + "_styled-components.BxoGPtnX.js" + ] + }, + "../lib/src/components/widgets/DownloadButton/DownloadButton.tsx": { + "file": "static/js/DownloadButton.BwGuQT8W.js", + "name": "DownloadButton", + "src": "../lib/src/components/widgets/DownloadButton/DownloadButton.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_UriUtil.olyUCSHN.js", + "_styled-components.B5oT30oI.js", + "_BaseButton.DzUQ5vsa.js", + "_useTimeout.CUauXJkz.js", + "_BaseButtonTooltip.DyFZqtoX.js", + "_DynamicButtonLabel.UT8nPWDL.js", + "_styled-components.Dvviq2B_.js", + "_createDownloadLinkElement.CV8DGZx1.js", + "_iconPosition.CHJpUZea.js" + ] + }, + "../lib/src/components/widgets/Feedback/Feedback.tsx": { + "file": "static/js/Feedback.DgyQ79Uj.js", + "name": "Feedback", + "src": "../lib/src/components/widgets/Feedback/Feedback.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_protobuf.DC2L68b9.js", + "_utils.BrY_0PXX.js", + "_DynamicIcon.44zobID_.js", + "_useBasicWidgetState.CpWukz_T.js" + ] + }, + "../lib/src/components/widgets/FileUploader/FileUploader.tsx": { + "file": "static/js/FileUploader.Bg9tjvVJ.js", + "name": "FileUploader", + "src": "../lib/src/components/widgets/FileUploader/FileUploader.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_react-dom.DZwq-Xzd.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_isEqual.CgNOpGTC.js", + "_zip.DLtjLZjW.js", + "_styled-components.B5oT30oI.js", + "_BaseButton.DzUQ5vsa.js", + "_FormClearHelper.D0Yt6KG5.js", + "_DynamicButtonLabel.UT8nPWDL.js", + "_useCalculatedDimensions.BnLCBgVi.js", + "_utils.Ca1sxtey.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIcon.BmvkC-YW.js", + "_UploadFileInfo.WAP1L8Dh.js" + ] + }, + "../lib/src/components/widgets/Form/FormSubmitContent.tsx": { + "file": "static/js/FormSubmitContent.BI0VZSTX.js", + "name": "FormSubmitContent", + "src": "../lib/src/components/widgets/Form/FormSubmitContent.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_Tooltip.PNC8NIZa.js", + "_styled-components.B5oT30oI.js", + "_BaseButton.DzUQ5vsa.js", + "_BaseButtonTooltip.DyFZqtoX.js", + "_DynamicButtonLabel.UT8nPWDL.js", + "_FormsContext.Dt-mNfG5.js", + "_useRequiredContext.F4hG38Ff.js", + "_iconPosition.CHJpUZea.js" + ] + }, + "../lib/src/components/widgets/MenuButton/MenuButton.tsx": { + "file": "static/js/MenuButton.447LlVwi.js", + "name": "MenuButton", + "src": "../lib/src/components/widgets/MenuButton/MenuButton.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_DynamicIcon.44zobID_.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_useCollection.CEK9PDaH.js", + "_useFocusRing.C8atAWyK.js", + "_Autocomplete.D9k6mFCZ.js", + "_usePress.C0FRp5XM.js", + "_SelectionIndicator.rChpdeaI.js", + "_Text.CGzIOlkG.js", + "_getItemCount.s1TO7Fph.js", + "_FocusScope.0TQQ9LKf.js", + "_styled-components.B5oT30oI.js", + "_BaseButton.DzUQ5vsa.js", + "_useFloatingOverlay.DlcdWSVH.js", + "_BaseButtonTooltip.DyFZqtoX.js", + "_DynamicButtonLabel.UT8nPWDL.js", + "_useOverlayDismissal.DB4_ko2H.js" + ] + }, + "../lib/src/components/widgets/Multiselect/Multiselect.tsx": { + "file": "static/js/Multiselect.D5pVZElZ.js", + "name": "Multiselect", + "src": "../lib/src/components/widgets/Multiselect/Multiselect.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_toString.tRXNBxtF.js", + "_isArrayLikeObject.B3Zf3PTL.js", + "__arrayIncludesWith.DcNFv7pK.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "__baseIsEqual.sdZCjgvS.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIcon.BmvkC-YW.js", + "_fuzzyFilterSelectOptions.Dqs6-TB7.js", + "_isMobile.ZOwND-6T.js", + "_useWindowDimensionsContext.HIxtcWyF.js", + "_useScrollbarGutterSize.B_VG1Wad.js", + "_assertThisInitialized.Cpir0pD1.js", + "_es2015.HS3QcJYh.js", + "_chevron-down.gANryksn.js", + "_useBasicWidgetState.CpWukz_T.js", + "_styled-components.D0lsbQYu.js" + ] + }, + "../lib/src/components/widgets/NumberInput/NumberInput.tsx": { + "file": "static/js/NumberInput.DstpPDIG.js", + "name": "NumberInput", + "src": "../lib/src/components/widgets/NumberInput/NumberInput.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_Icon.RiOK8SDN.js", + "_DynamicIcon.44zobID_.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_useTextField.BYQ8oAlv.js", + "_TextField.L8vxRwMe.js", + "_useCalculatedDimensions.BnLCBgVi.js", + "_index.esm.DCRlH4DP.js", + "_ErrorOutline.esm.CZ5wypOV.js", + "_Cancel.esm.CTWwYXdL.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIcon.BmvkC-YW.js", + "_sprintfjs.gMlXBjFJ.js", + "_useBasicWidgetState.CpWukz_T.js", + "_InputInstructions.D7oNXsUt.js" + ] + }, + "../lib/src/components/widgets/Pagination/Pagination.tsx": { + "file": "static/js/Pagination.DqlKvCRL.js", + "name": "Pagination", + "src": "../lib/src/components/widgets/Pagination/Pagination.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_utils.BrY_0PXX.js", + "_DynamicIcon.44zobID_.js", + "_useEmotionTheme.D29Ufy6b.js", + "_useResizeObserver.C0ES3go_.js", + "_useBasicWidgetState.CpWukz_T.js" + ] + }, + "../lib/src/components/widgets/Radio/Radio.tsx": { + "file": "static/js/Radio.Dsg0wIzc.js", + "name": "Radio", + "src": "../lib/src/components/widgets/Radio/Radio.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_types.cZoyy9Y-.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_Tooltip.PNC8NIZa.js", + "_useFocusRing.C8atAWyK.js", + "_useLabel.BMjZg4WL.js", + "_usePress.C0FRp5XM.js", + "_Text.CGzIOlkG.js", + "_VisuallyHidden.8TzBGVb_.js", + "_useField.CLWVwWoT.js", + "_useFormValidation.CZGpvO3z.js", + "_useFormReset.Chklfqrk.js", + "_useSlot.CBG0sVdI.js", + "_FocusScope.0TQQ9LKf.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIconInline.DB6cihzP.js", + "_useBasicWidgetState.CpWukz_T.js" + ] + }, + "../lib/src/components/widgets/Selectbox/Selectbox.tsx": { + "file": "static/js/Selectbox.Cwc8yxyo.js", + "name": "Selectbox", + "src": "../lib/src/components/widgets/Selectbox/Selectbox.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_react-dom.DZwq-Xzd.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_useCollection.CEK9PDaH.js", + "_useFocusRing.C8atAWyK.js", + "_useLabel.BMjZg4WL.js", + "_KeyboardArrowDown.esm.Duf7utJJ.js", + "_Autocomplete.D9k6mFCZ.js", + "_Hidden.Bpblr2PM.js", + "_SelectionIndicator.rChpdeaI.js", + "_Text.CGzIOlkG.js", + "_useField.CLWVwWoT.js", + "_useFormValidation.CZGpvO3z.js", + "_useFormReset.Chklfqrk.js", + "_useTextField.BYQ8oAlv.js", + "_getItemCount.s1TO7Fph.js", + "_FocusScope.0TQQ9LKf.js", + "_useFloatingOverlay.DlcdWSVH.js", + "_useExecuteWhenChanged.CJi0fna4.js", + "_Cancel.esm.CTWwYXdL.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIcon.BmvkC-YW.js", + "_fuzzyFilterSelectOptions.Dqs6-TB7.js", + "_isMobile.ZOwND-6T.js", + "_useBasicWidgetState.CpWukz_T.js" + ] + }, + "../lib/src/components/widgets/Slider/Slider.tsx": { + "file": "static/js/Slider.C9sm4pxt.js", + "name": "Slider", + "src": "../lib/src/components/widgets/Slider/Slider.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_Tooltip.PNC8NIZa.js", + "_useFocusRing.C8atAWyK.js", + "_useLabel.BMjZg4WL.js", + "_textSelection.CRrpnEtY.js", + "_useNumberFormatter.t6impjkR.js", + "_VisuallyHidden.8TzBGVb_.js", + "_useFormReset.Chklfqrk.js", + "_useExecuteWhenChanged.CJi0fna4.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIcon.BmvkC-YW.js", + "_moment.CaJaEtMO.js", + "_formatNumber.D1UJmEyL.js", + "_formatMoment.CtdYuS92.js", + "_useBasicWidgetState.CpWukz_T.js", + "_withCalculatedWidth.DClbrdOz.js" + ] + }, + "../lib/src/components/widgets/TextArea/TextArea.tsx": { + "file": "static/js/TextArea.C9d2R91L.js", + "name": "TextArea", + "src": "../lib/src/components/widgets/TextArea/TextArea.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_useEmotionTheme.D29Ufy6b.js", + "_useCalculatedDimensions.BnLCBgVi.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIcon.BmvkC-YW.js", + "_useBasicWidgetState.CpWukz_T.js", + "_InputInstructions.D7oNXsUt.js", + "_useTextInputAutoExpand.By9qSO8B.js", + "_useUpdateUiValue.9IVpZphL.js" + ] + }, + "../lib/src/components/widgets/TextInput/TextInput.tsx": { + "file": "static/js/TextInput.BhHFMr_0.js", + "name": "TextInput", + "src": "../lib/src/components/widgets/TextInput/TextInput.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_protobuf.DC2L68b9.js", + "_DynamicIcon.44zobID_.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_useTextField.BYQ8oAlv.js", + "_TextField.L8vxRwMe.js", + "_useCalculatedDimensions.BnLCBgVi.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIcon.BmvkC-YW.js", + "_useBasicWidgetState.CpWukz_T.js", + "_InputInstructions.D7oNXsUt.js", + "_useUpdateUiValue.9IVpZphL.js" + ] + }, + "../lib/src/components/widgets/TimeInput/TimeInput.tsx": { + "file": "static/js/TimeInput.iK1vjZY7.js", + "name": "TimeInput", + "src": "../lib/src/components/widgets/TimeInput/TimeInput.tsx", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_types.cZoyy9Y-.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_WidgetLabel.CVV1ys75.js", + "_WidgetLabelHelpIcon.BmvkC-YW.js", + "_useWindowDimensionsContext.HIxtcWyF.js", + "_useScrollbarGutterSize.B_VG1Wad.js", + "_chevron-down.gANryksn.js", + "_useBasicWidgetState.CpWukz_T.js", + "_timepicker.Waqmgzcy.js", + "_styled-components.BxoGPtnX.js" + ] + }, + "../node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/data-grid-overlay-editor.js": { + "file": "static/js/data-grid-overlay-editor.Cl0FibMX.js", + "name": "data-grid-overlay-editor", + "src": "../node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/data-grid-overlay-editor.js", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_react-dom.DZwq-Xzd.js", + "_click-outside-container.Ci0KWfiz.js", + "_dist.Bp4fj7nv.js" + ] + }, + "../node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/private/number-overlay-editor.js": { + "file": "static/js/number-overlay-editor.B2gNG5Q4.js", + "name": "number-overlay-editor", + "src": "../node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/private/number-overlay-editor.js", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_dist.Bp4fj7nv.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/architecture-TIHT7OUA.mjs": { + "file": "static/js/architecture-TIHT7OUA.DnieQxxl.js", + "name": "architecture-TIHT7OUA", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/architecture-TIHT7OUA.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-MOZMSUNE.EeATBuYk.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/cynefin-VYW2F7L2.mjs": { + "file": "static/js/cynefin-VYW2F7L2.B0m8xIX_.js", + "name": "cynefin-VYW2F7L2", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/cynefin-VYW2F7L2.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-OSBZ3O6U._N6nOv0n.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/eventmodeling-45OFAUF4.mjs": { + "file": "static/js/eventmodeling-45OFAUF4.CekgnRoE.js", + "name": "eventmodeling-45OFAUF4", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/eventmodeling-45OFAUF4.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-5JV3BV7I.DJesgnfK.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/gitGraph-TEB2WS4Q.mjs": { + "file": "static/js/gitGraph-TEB2WS4Q.B19KcKzK.js", + "name": "gitGraph-TEB2WS4Q", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/gitGraph-TEB2WS4Q.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-CYSBUYHQ.Bo3-8CRa.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-DKCQHKI2.mjs": { + "file": "static/js/info-DKCQHKI2.DZm8nz8y.js", + "name": "info-DKCQHKI2", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-DKCQHKI2.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-BIQX33UG.B4NE4TKF.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-7NZHBO7P.mjs": { + "file": "static/js/packet-7NZHBO7P.CSLbnEM2.js", + "name": "packet-7NZHBO7P", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-7NZHBO7P.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-EMLP6XTP.B17sZ-5U.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-RZYD4A2V.mjs": { + "file": "static/js/pie-RZYD4A2V.Birim748.js", + "name": "pie-RZYD4A2V", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-RZYD4A2V.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-YOTPTUD7.CQZR6t9a.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-I7S5WNFK.mjs": { + "file": "static/js/radar-I7S5WNFK.1uY6lCNm.js", + "name": "radar-I7S5WNFK", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-I7S5WNFK.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-QBLGF6JB.DFvVIIOP.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/railroad-3IZDKUUU.mjs": { + "file": "static/js/railroad-3IZDKUUU.C6Jru1In.js", + "name": "railroad-3IZDKUUU", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/railroad-3IZDKUUU.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-5TONJI2A.CazhSWpT.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/railroad-abnf-AHOZXSZD.mjs": { + "file": "static/js/railroad-abnf-AHOZXSZD.CzIb4B2a.js", + "name": "railroad-abnf-AHOZXSZD", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/railroad-abnf-AHOZXSZD.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-5HE753X5.D2IwY2Hs.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/railroad-ebnf-EBAXGLYW.mjs": { + "file": "static/js/railroad-ebnf-EBAXGLYW.BAlUHa5l.js", + "name": "railroad-ebnf-EBAXGLYW", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/railroad-ebnf-EBAXGLYW.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-U6XO7XAA.t2Sk_D5L.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/railroad-peg-LSFZ7HO6.mjs": { + "file": "static/js/railroad-peg-LSFZ7HO6.t6fU60nY.js", + "name": "railroad-peg-LSFZ7HO6", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/railroad-peg-LSFZ7HO6.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-JG7HCLWE.2vZbAraA.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treeView-QDETBFTQ.mjs": { + "file": "static/js/treeView-QDETBFTQ.C_NgES55.js", + "name": "treeView-QDETBFTQ", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treeView-QDETBFTQ.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-CQNSW5MT.CwsHPlpw.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-6X3UGDF4.mjs": { + "file": "static/js/treemap-6X3UGDF4.D-6z5Emd.js", + "name": "treemap-6X3UGDF4", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-6X3UGDF4.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-R7FJI6CG.DpWbzOcb.js" + ] + }, + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-OPB4EBWU.mjs": { + "file": "static/js/wardley-OPB4EBWU.CGf0CVut.js", + "name": "wardley-OPB4EBWU", + "src": "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-OPB4EBWU.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-5FCAYU7R.C_m-TPOx.js" + ] + }, + "../node_modules/axios/index.js": { + "file": "static/js/axios.C1kCDFiR.js", + "name": "axios", + "src": "../node_modules/axios/index.js", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "../node_modules/iframe-resizer/js/iframeResizer.contentWindow.js": { + "file": "static/js/iframeResizer.contentWindow.BupgL6P9.js", + "name": "iframeResizer.contentWindow", + "src": "../node_modules/iframe-resizer/js/iframeResizer.contentWindow.js", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "../node_modules/katex/dist/fonts/KaTeX_AMS-Regular.ttf": { + "file": "static/media/KaTeX_AMS-Regular.DRggAlZN.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_AMS-Regular.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_AMS-Regular.woff": { + "file": "static/media/KaTeX_AMS-Regular.DMm9YOAa.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_AMS-Regular.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_AMS-Regular.woff2": { + "file": "static/media/KaTeX_AMS-Regular.BQhdFMY1.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_AMS-Regular.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Caligraphic-Bold.ttf": { + "file": "static/media/KaTeX_Caligraphic-Bold.ATXxdsX0.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Caligraphic-Bold.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff": { + "file": "static/media/KaTeX_Caligraphic-Bold.BEiXGLvX.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff2": { + "file": "static/media/KaTeX_Caligraphic-Bold.Dq_IR9rO.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Caligraphic-Regular.ttf": { + "file": "static/media/KaTeX_Caligraphic-Regular.wX97UBjC.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Caligraphic-Regular.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff": { + "file": "static/media/KaTeX_Caligraphic-Regular.CTRA-rTL.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff2": { + "file": "static/media/KaTeX_Caligraphic-Regular.Di6jR-x-.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Fraktur-Bold.ttf": { + "file": "static/media/KaTeX_Fraktur-Bold.BdnERNNW.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Fraktur-Bold.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Fraktur-Bold.woff": { + "file": "static/media/KaTeX_Fraktur-Bold.BsDP51OF.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Fraktur-Bold.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Fraktur-Bold.woff2": { + "file": "static/media/KaTeX_Fraktur-Bold.CL6g_b3V.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Fraktur-Bold.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Fraktur-Regular.ttf": { + "file": "static/media/KaTeX_Fraktur-Regular.CB_wures.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Fraktur-Regular.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Fraktur-Regular.woff": { + "file": "static/media/KaTeX_Fraktur-Regular.Dxdc4cR9.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Fraktur-Regular.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Fraktur-Regular.woff2": { + "file": "static/media/KaTeX_Fraktur-Regular.CTYiF6lA.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Fraktur-Regular.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Main-Bold.ttf": { + "file": "static/media/KaTeX_Main-Bold.waoOVXN0.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Main-Bold.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Main-Bold.woff": { + "file": "static/media/KaTeX_Main-Bold.Jm3AIy58.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Main-Bold.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Main-Bold.woff2": { + "file": "static/media/KaTeX_Main-Bold.Cx986IdX.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Main-Bold.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Main-BoldItalic.ttf": { + "file": "static/media/KaTeX_Main-BoldItalic.DzxPMmG6.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Main-BoldItalic.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Main-BoldItalic.woff": { + "file": "static/media/KaTeX_Main-BoldItalic.SpSLRI95.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Main-BoldItalic.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Main-BoldItalic.woff2": { + "file": "static/media/KaTeX_Main-BoldItalic.DxDJ3AOS.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Main-BoldItalic.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Main-Italic.ttf": { + "file": "static/media/KaTeX_Main-Italic.3WenGoN9.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Main-Italic.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Main-Italic.woff": { + "file": "static/media/KaTeX_Main-Italic.BMLOBm91.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Main-Italic.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Main-Italic.woff2": { + "file": "static/media/KaTeX_Main-Italic.NWA7e6Wa.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Main-Italic.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Main-Regular.ttf": { + "file": "static/media/KaTeX_Main-Regular.ypZvNtVU.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Main-Regular.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Main-Regular.woff": { + "file": "static/media/KaTeX_Main-Regular.Dr94JaBh.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Main-Regular.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Main-Regular.woff2": { + "file": "static/media/KaTeX_Main-Regular.B22Nviop.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Main-Regular.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Math-BoldItalic.ttf": { + "file": "static/media/KaTeX_Math-BoldItalic.B3XSjfu4.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Math-BoldItalic.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Math-BoldItalic.woff": { + "file": "static/media/KaTeX_Math-BoldItalic.iY-2wyZ7.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Math-BoldItalic.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Math-BoldItalic.woff2": { + "file": "static/media/KaTeX_Math-BoldItalic.CZnvNsCZ.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Math-BoldItalic.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Math-Italic.ttf": { + "file": "static/media/KaTeX_Math-Italic.flOr_0UB.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Math-Italic.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Math-Italic.woff": { + "file": "static/media/KaTeX_Math-Italic.DA0__PXp.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Math-Italic.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Math-Italic.woff2": { + "file": "static/media/KaTeX_Math-Italic.t53AETM-.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Math-Italic.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Bold.ttf": { + "file": "static/media/KaTeX_SansSerif-Bold.CFMepnvq.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Bold.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Bold.woff": { + "file": "static/media/KaTeX_SansSerif-Bold.DbIhKOiC.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Bold.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Bold.woff2": { + "file": "static/media/KaTeX_SansSerif-Bold.D1sUS0GD.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Bold.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Italic.ttf": { + "file": "static/media/KaTeX_SansSerif-Italic.YYjJ1zSn.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Italic.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Italic.woff": { + "file": "static/media/KaTeX_SansSerif-Italic.DN2j7dab.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Italic.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Italic.woff2": { + "file": "static/media/KaTeX_SansSerif-Italic.C3H0VqGB.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Italic.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Regular.ttf": { + "file": "static/media/KaTeX_SansSerif-Regular.BNo7hRIc.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Regular.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Regular.woff": { + "file": "static/media/KaTeX_SansSerif-Regular.CS6fqUqJ.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Regular.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Regular.woff2": { + "file": "static/media/KaTeX_SansSerif-Regular.DDBCnlJ7.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_SansSerif-Regular.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Script-Regular.ttf": { + "file": "static/media/KaTeX_Script-Regular.C5JkGWo-.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Script-Regular.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Script-Regular.woff": { + "file": "static/media/KaTeX_Script-Regular.D5yQViql.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Script-Regular.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Script-Regular.woff2": { + "file": "static/media/KaTeX_Script-Regular.D3wIWfF6.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Script-Regular.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Size1-Regular.ttf": { + "file": "static/media/KaTeX_Size1-Regular.Dbsnue_I.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Size1-Regular.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Size1-Regular.woff": { + "file": "static/media/KaTeX_Size1-Regular.C195tn64.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Size1-Regular.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Size1-Regular.woff2": { + "file": "static/media/KaTeX_Size1-Regular.mCD8mA8B.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Size1-Regular.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Size2-Regular.ttf": { + "file": "static/media/KaTeX_Size2-Regular.B7gKUWhC.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Size2-Regular.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Size2-Regular.woff": { + "file": "static/media/KaTeX_Size2-Regular.oD1tc_U0.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Size2-Regular.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Size2-Regular.woff2": { + "file": "static/media/KaTeX_Size2-Regular.Dy4dx90m.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Size2-Regular.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Size3-Regular.ttf": { + "file": "static/media/KaTeX_Size3-Regular.DgpXs0kz.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Size3-Regular.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Size3-Regular.woff": { + "file": "static/media/KaTeX_Size3-Regular.CTq5MqoE.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Size3-Regular.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Size4-Regular.ttf": { + "file": "static/media/KaTeX_Size4-Regular.DWFBv043.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Size4-Regular.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Size4-Regular.woff": { + "file": "static/media/KaTeX_Size4-Regular.BF-4gkZK.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Size4-Regular.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Size4-Regular.woff2": { + "file": "static/media/KaTeX_Size4-Regular.Dl5lxZxV.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Size4-Regular.woff2" + }, + "../node_modules/katex/dist/fonts/KaTeX_Typewriter-Regular.ttf": { + "file": "static/media/KaTeX_Typewriter-Regular.D3Ib7_Hf.ttf", + "src": "../node_modules/katex/dist/fonts/KaTeX_Typewriter-Regular.ttf" + }, + "../node_modules/katex/dist/fonts/KaTeX_Typewriter-Regular.woff": { + "file": "static/media/KaTeX_Typewriter-Regular.C0xS9mPB.woff", + "src": "../node_modules/katex/dist/fonts/KaTeX_Typewriter-Regular.woff" + }, + "../node_modules/katex/dist/fonts/KaTeX_Typewriter-Regular.woff2": { + "file": "static/media/KaTeX_Typewriter-Regular.CO6r4hn1.woff2", + "src": "../node_modules/katex/dist/fonts/KaTeX_Typewriter-Regular.woff2" + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/abnfDiagram-VRR7QNED.mjs": { + "file": "static/js/abnfDiagram-VRR7QNED.DMhlflzA.js", + "name": "abnfDiagram-VRR7QNED", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/abnfDiagram-VRR7QNED.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-5HE753X5.D2IwY2Hs.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-MOJQB5TN.B4REpjLl.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-ZJ3FMSHR.mjs": { + "file": "static/js/architectureDiagram-ZJ3FMSHR.DlLEMMhu.js", + "name": "architectureDiagram-ZJ3FMSHR", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-ZJ3FMSHR.mjs", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_cytoscape.esm.CQFVGiJu.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-677ZJIJ3.mjs": { + "file": "static/js/blockDiagram-677ZJIJ3.C0vRlcsk.js", + "name": "blockDiagram-677ZJIJ3", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-677ZJIJ3.mjs", + "isDynamicEntry": true, + "imports": [ + "_graphlib.CL58BBKe.js", + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_channel.CsxEH82A.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_line.BtQvjP12.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-5VM5RSS4.TOl2eSYi.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-LMCZKHZV.mjs": { + "file": "static/js/c4Diagram-LMCZKHZV.DG-8rZ3_.js", + "name": "c4Diagram-LMCZKHZV", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-LMCZKHZV.mjs", + "isDynamicEntry": true, + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_dist.BQ4V7D6H.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-32BRIVSS.CRML9a9R.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-OUVF2IWQ.mjs": { + "file": "static/js/classDiagram-OUVF2IWQ.D5f6ybuv.js", + "name": "classDiagram-OUVF2IWQ", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-OUVF2IWQ.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-32BRIVSS.CRML9a9R.js", + "_chunk-XXDRQBXY.BLiu-513.js", + "_chunk-VR4S4FIN.DMqg5-Rg.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-52WLFC77.CL_Wd-B6.js", + "_chunk-FWX5IMBZ.lGkST2x9.js", + "_chunk-V7JOEXUC.CFaH8Jy6.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-v2-EOCWNBFH.mjs": { + "file": "static/js/classDiagram-v2-EOCWNBFH.D5f6ybuv.js", + "name": "classDiagram-v2-EOCWNBFH", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-v2-EOCWNBFH.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-32BRIVSS.CRML9a9R.js", + "_chunk-XXDRQBXY.BLiu-513.js", + "_chunk-VR4S4FIN.DMqg5-Rg.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-52WLFC77.CL_Wd-B6.js", + "_chunk-FWX5IMBZ.lGkST2x9.js", + "_chunk-V7JOEXUC.CFaH8Jy6.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-JH36ORCC.mjs": { + "file": "static/js/cose-bilkent-JH36ORCC.B9LMTLkO.js", + "name": "cose-bilkent-JH36ORCC", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-JH36ORCC.mjs", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_cytoscape.esm.CQFVGiJu.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/cynefinDiagram-TSTJHNR4.mjs": { + "file": "static/js/cynefinDiagram-TSTJHNR4.CEu5Q_f3.js", + "name": "cynefinDiagram-TSTJHNR4", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/cynefinDiagram-TSTJHNR4.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/dagre-VKFMJZFB.mjs": { + "file": "static/js/dagre-VKFMJZFB.Bah_6no-.js", + "name": "dagre-VKFMJZFB", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/dagre-VKFMJZFB.mjs", + "isDynamicEntry": true, + "imports": [ + "_graphlib.CL58BBKe.js", + "_chunk-RYQCIY6F.6HsFiqTY.js", + "_dagre.BkrREj6y.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-52WLFC77.CL_Wd-B6.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-FQU43EPY.mjs": { + "file": "static/js/diagram-FQU43EPY.BE7tAPvI.js", + "name": "diagram-FQU43EPY", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-FQU43EPY.mjs", + "isDynamicEntry": true, + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-G47NLZAW.mjs": { + "file": "static/js/diagram-G47NLZAW.BTMhzBea.js", + "name": "diagram-G47NLZAW", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-G47NLZAW.mjs", + "isDynamicEntry": true, + "imports": [ + "_ordinal.CVZABass.js", + "_defaultLocale.DAnyU4o_.js", + "_src.CE7XIH0z.js", + "_treemap.BfjIY-m6.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js", + "_chunk-VR4S4FIN.DMqg5-Rg.js", + "_chunk-C7G6YPKG.EaPayahY.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-NH7WQ7WH.mjs": { + "file": "static/js/diagram-NH7WQ7WH.BcYK2yBU.js", + "name": "diagram-NH7WQ7WH", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-NH7WQ7WH.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-OA4YK3LP.mjs": { + "file": "static/js/diagram-OA4YK3LP.CyOhmsHY.js", + "name": "diagram-OA4YK3LP", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-OA4YK3LP.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-2Q5K7J3B.BsaEqoYJ.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-WEI45ONY.mjs": { + "file": "static/js/diagram-WEI45ONY.BG3T0S9S.js", + "name": "diagram-WEI45ONY", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-WEI45ONY.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/ebnfDiagram-CCIWWBDH.mjs": { + "file": "static/js/ebnfDiagram-CCIWWBDH.DcPPbnkc.js", + "name": "ebnfDiagram-CCIWWBDH", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/ebnfDiagram-CCIWWBDH.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-U6XO7XAA.t2Sk_D5L.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-MOJQB5TN.B4REpjLl.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-Q63AITRT.mjs": { + "file": "static/js/erDiagram-Q63AITRT.B4gwyYrm.js", + "name": "erDiagram-Q63AITRT", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-Q63AITRT.mjs", + "isDynamicEntry": true, + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_channel.CsxEH82A.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-XXDRQBXY.BLiu-513.js", + "_chunk-VR4S4FIN.DMqg5-Rg.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-52WLFC77.CL_Wd-B6.js", + "_chunk-FWX5IMBZ.lGkST2x9.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-23GEKE2U.mjs": { + "file": "static/js/flowDiagram-23GEKE2U.CXzCA38j.js", + "name": "flowDiagram-23GEKE2U", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-23GEKE2U.mjs", + "isDynamicEntry": true, + "imports": [ + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-32BRIVSS.CRML9a9R.js", + "_chunk-XXDRQBXY.BLiu-513.js", + "_chunk-VR4S4FIN.DMqg5-Rg.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-52WLFC77.CL_Wd-B6.js", + "_chunk-FWX5IMBZ.lGkST2x9.js", + "_chunk-ZIRB5QZD.Dh20_f-h.js", + "_chunk-PUDLZKDR.CXuYzR_2.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-NO4QXBWP.mjs": { + "file": "static/js/ganttDiagram-NO4QXBWP.yPY5pVNx.js", + "name": "ganttDiagram-NO4QXBWP", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-NO4QXBWP.mjs", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_linear.CR3348bP.js", + "_time.C6xaHmap.js", + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_dist.BQ4V7D6H.js", + "_chunk-ICXQ74PX.CwBrFo8s.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-IHSO6WYX.mjs": { + "file": "static/js/gitGraphDiagram-IHSO6WYX.DSTYnMCn.js", + "name": "gitGraphDiagram-IHSO6WYX", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-IHSO6WYX.mjs", + "isDynamicEntry": true, + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js", + "_chunk-2Q5K7J3B.BsaEqoYJ.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-FWYZ7A6U.mjs": { + "file": "static/js/infoDiagram-FWYZ7A6U.DIYKk8dP.js", + "name": "infoDiagram-FWYZ7A6U", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-FWYZ7A6U.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_mermaid-parser.core.CrKH_ZR4.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/ishikawaDiagram-FXEZZL3T.mjs": { + "file": "static/js/ishikawaDiagram-FXEZZL3T.s1JZe2Qr.js", + "name": "ishikawaDiagram-FXEZZL3T", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/ishikawaDiagram-FXEZZL3T.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_rough.esm.CSKSodPl.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-5HDEW3XC.mjs": { + "file": "static/js/journeyDiagram-5HDEW3XC.KPMTa86o.js", + "name": "journeyDiagram-5HDEW3XC", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-5HDEW3XC.mjs", + "isDynamicEntry": true, + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_arc.Bz4qkNTB.js", + "_chunk-5VM5RSS4.TOl2eSYi.js", + "_chunk-32BRIVSS.CRML9a9R.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/kanban-definition-HUTT4EX6.mjs": { + "file": "static/js/kanban-definition-HUTT4EX6.Db46tShx.js", + "name": "kanban-definition-HUTT4EX6", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/kanban-definition-HUTT4EX6.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-5VM5RSS4.TOl2eSYi.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-ZIRB5QZD.Dh20_f-h.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/mindmap-definition-LN4V7U3C.mjs": { + "file": "static/js/mindmap-definition-LN4V7U3C.DHJbAA5i.js", + "name": "mindmap-definition-LN4V7U3C", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/mindmap-definition-LN4V7U3C.mjs", + "isDynamicEntry": true, + "imports": [ + "_v4.DDdyfk2q.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-XXDRQBXY.BLiu-513.js", + "_chunk-VR4S4FIN.DMqg5-Rg.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-52WLFC77.CL_Wd-B6.js", + "_chunk-FWX5IMBZ.lGkST2x9.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/pegDiagram-2B236MQR.mjs": { + "file": "static/js/pegDiagram-2B236MQR.BjystR3K.js", + "name": "pegDiagram-2B236MQR", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/pegDiagram-2B236MQR.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-JG7HCLWE.2vZbAraA.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-MOJQB5TN.B4REpjLl.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ENE6RG2P.mjs": { + "file": "static/js/pieDiagram-ENE6RG2P.9vMX9DIp.js", + "name": "pieDiagram-ENE6RG2P", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ENE6RG2P.mjs", + "isDynamicEntry": true, + "imports": [ + "_ordinal.CVZABass.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_path.DK9UMQdM.js", + "_dist.BQ4V7D6H.js", + "_arc.Bz4qkNTB.js", + "_array.BifhSqXX.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-ABIIQ3AL.mjs": { + "file": "static/js/quadrantDiagram-ABIIQ3AL.CpqBZe8i.js", + "name": "quadrantDiagram-ABIIQ3AL", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-ABIIQ3AL.mjs", + "isDynamicEntry": true, + "imports": [ + "_linear.CR3348bP.js", + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/railroadDiagram-RFXS5EU6.mjs": { + "file": "static/js/railroadDiagram-RFXS5EU6.CROcOPiz.js", + "name": "railroadDiagram-RFXS5EU6", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/railroadDiagram-RFXS5EU6.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-5TONJI2A.CazhSWpT.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-MOJQB5TN.B4REpjLl.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/requirementDiagram-TGXJPOKE.mjs": { + "file": "static/js/requirementDiagram-TGXJPOKE.BvMUTR9O.js", + "name": "requirementDiagram-TGXJPOKE", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/requirementDiagram-TGXJPOKE.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-XXDRQBXY.BLiu-513.js", + "_chunk-VR4S4FIN.DMqg5-Rg.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-52WLFC77.CL_Wd-B6.js", + "_chunk-FWX5IMBZ.lGkST2x9.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-HTMAVEWB.mjs": { + "file": "static/js/sankeyDiagram-HTMAVEWB.DoB9rjtV.js", + "name": "sankeyDiagram-HTMAVEWB", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-HTMAVEWB.mjs", + "isDynamicEntry": true, + "imports": [ + "_ordinal.CVZABass.js", + "_colors.Cg5Vh3br.js", + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-DBY2YBRQ.mjs": { + "file": "static/js/sequenceDiagram-DBY2YBRQ.BvD5UN5M.js", + "name": "sequenceDiagram-DBY2YBRQ", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-DBY2YBRQ.mjs", + "isDynamicEntry": true, + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_dist.BQ4V7D6H.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-32BRIVSS.CRML9a9R.js", + "_chunk-2Q5K7J3B.BsaEqoYJ.js", + "_chunk-ZIRB5QZD.Dh20_f-h.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/sizeCapture-X5ZJPWSS.mjs": { + "file": "static/js/sizeCapture-X5ZJPWSS.BLIUHMgQ.js", + "name": "sizeCapture-X5ZJPWSS", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/sizeCapture-X5ZJPWSS.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-2N3HPSRC.mjs": { + "file": "static/js/stateDiagram-2N3HPSRC.Dvl6akVh.js", + "name": "stateDiagram-2N3HPSRC", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-2N3HPSRC.mjs", + "isDynamicEntry": true, + "imports": [ + "_graphlib.CL58BBKe.js", + "_dagre.BkrREj6y.js", + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_line.BtQvjP12.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-32BRIVSS.CRML9a9R.js", + "_chunk-XXDRQBXY.BLiu-513.js", + "_chunk-VR4S4FIN.DMqg5-Rg.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-52WLFC77.CL_Wd-B6.js", + "_chunk-FWX5IMBZ.lGkST2x9.js", + "_chunk-EX3LRPZG.B6XHH3aH.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-v2-6OUMAXLB.mjs": { + "file": "static/js/stateDiagram-v2-6OUMAXLB.Biz9ppdk.js", + "name": "stateDiagram-v2-6OUMAXLB", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-v2-6OUMAXLB.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-32BRIVSS.CRML9a9R.js", + "_chunk-XXDRQBXY.BLiu-513.js", + "_chunk-VR4S4FIN.DMqg5-Rg.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-52WLFC77.CL_Wd-B6.js", + "_chunk-FWX5IMBZ.lGkST2x9.js", + "_chunk-EX3LRPZG.B6XHH3aH.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/swimlanes-5IMT3BWC.mjs": { + "file": "static/js/swimlanes-5IMT3BWC.C_AyqNhM.js", + "name": "swimlanes-5IMT3BWC", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/swimlanes-5IMT3BWC.mjs", + "isDynamicEntry": true, + "imports": [ + "_graphlib.CL58BBKe.js", + "_chunk-RYQCIY6F.6HsFiqTY.js", + "_preload-helper.HclGiUj8.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-52WLFC77.CL_Wd-B6.js" + ], + "dynamicImports": [ + "../node_modules/mermaid/dist/chunks/mermaid.core/sizeCapture-X5ZJPWSS.mjs" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-G3AALYLV.mjs": { + "file": "static/js/swimlanesDiagram-G3AALYLV.Cy3LPWnv.js", + "name": "swimlanesDiagram-G3AALYLV", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-G3AALYLV.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-32BRIVSS.CRML9a9R.js", + "_chunk-XXDRQBXY.BLiu-513.js", + "_chunk-VR4S4FIN.DMqg5-Rg.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-52WLFC77.CL_Wd-B6.js", + "_chunk-FWX5IMBZ.lGkST2x9.js", + "_chunk-ZIRB5QZD.Dh20_f-h.js", + "_chunk-PUDLZKDR.CXuYzR_2.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-FHXFAJF6.mjs": { + "file": "static/js/timeline-definition-FHXFAJF6.DvUSwW99.js", + "name": "timeline-definition-FHXFAJF6", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-FHXFAJF6.mjs", + "isDynamicEntry": true, + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_arc.Bz4qkNTB.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-VAUOI2AC.BOaFDBFv.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-L72KCM5P.mjs": { + "file": "static/js/vennDiagram-L72KCM5P.NbBJYoKI.js", + "name": "vennDiagram-L72KCM5P", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-L72KCM5P.mjs", + "isDynamicEntry": true, + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_rough.esm.CSKSodPl.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-EHGQE667.mjs": { + "file": "static/js/wardleyDiagram-EHGQE667.CE-CIJTy.js", + "name": "wardleyDiagram-EHGQE667", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-EHGQE667.mjs", + "isDynamicEntry": true, + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-JWPE2WC7.A3RzWITa.js", + "_mermaid-parser.core.CrKH_ZR4.js" + ] + }, + "../node_modules/mermaid/dist/chunks/mermaid.core/xychartDiagram-FW5EYKEG.mjs": { + "file": "static/js/xychartDiagram-FW5EYKEG.BlFxuj8T.js", + "name": "xychartDiagram-FW5EYKEG", + "src": "../node_modules/mermaid/dist/chunks/mermaid.core/xychartDiagram-FW5EYKEG.mjs", + "isDynamicEntry": true, + "imports": [ + "_linear.CR3348bP.js", + "_ordinal.CVZABass.js", + "_range.EplFIxc7.js", + "_init.Cs1-1e_z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_line.BtQvjP12.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js" + ] + }, + "../node_modules/mermaid/dist/mermaid.core.mjs": { + "file": "static/js/mermaid.core.DRnJBexq.js", + "name": "mermaid.core", + "src": "../node_modules/mermaid/dist/mermaid.core.mjs", + "isDynamicEntry": true, + "imports": [ + "_preload-helper.HclGiUj8.js", + "_src.CE7XIH0z.js", + "_purify.es.sLXpNpJ5.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-VAUOI2AC.BOaFDBFv.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-52WLFC77.CL_Wd-B6.js", + "_chunk-FWX5IMBZ.lGkST2x9.js", + "_chunk-ZIRB5QZD.Dh20_f-h.js" + ], + "dynamicImports": [ + "../node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-LMCZKHZV.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-23GEKE2U.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-G3AALYLV.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-Q63AITRT.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-IHSO6WYX.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-NO4QXBWP.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-FWYZ7A6U.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ENE6RG2P.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-ABIIQ3AL.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/xychartDiagram-FW5EYKEG.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/requirementDiagram-TGXJPOKE.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-DBY2YBRQ.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-OUVF2IWQ.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-v2-EOCWNBFH.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-2N3HPSRC.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-v2-6OUMAXLB.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-5HDEW3XC.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-FHXFAJF6.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/mindmap-definition-LN4V7U3C.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/kanban-definition-HUTT4EX6.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-HTMAVEWB.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-NH7WQ7WH.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-WEI45ONY.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-677ZJIJ3.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-OA4YK3LP.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-ZJ3FMSHR.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-FQU43EPY.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/ishikawaDiagram-FXEZZL3T.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-L72KCM5P.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-G47NLZAW.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-EHGQE667.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/cynefinDiagram-TSTJHNR4.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/railroadDiagram-RFXS5EU6.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/ebnfDiagram-CCIWWBDH.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/abnfDiagram-VRR7QNED.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/pegDiagram-2B236MQR.mjs" + ] + }, + "../node_modules/mermaid/node_modules/katex/dist/katex.mjs": { + "file": "static/js/katex.B7rAX3Vi.js", + "name": "katex", + "src": "../node_modules/mermaid/node_modules/katex/dist/katex.mjs", + "isDynamicEntry": true + }, + "../node_modules/native-file-system-adapter/src/FileSystemDirectoryHandle.js": { + "file": "static/js/FileSystemDirectoryHandle.p7DJujU-.js", + "name": "FileSystemDirectoryHandle", + "src": "../node_modules/native-file-system-adapter/src/FileSystemDirectoryHandle.js", + "isDynamicEntry": true, + "imports": [ + "_preload-helper.HclGiUj8.js", + "_FileSystemHandle.CFTLjada.js", + "_util.D5poj9OK.js" + ], + "dynamicImports": [ + "../node_modules/native-file-system-adapter/src/FileSystemFileHandle.js" + ] + }, + "../node_modules/native-file-system-adapter/src/FileSystemFileHandle.js": { + "file": "static/js/FileSystemFileHandle.CU3-lWxj.js", + "name": "FileSystemFileHandle", + "src": "../node_modules/native-file-system-adapter/src/FileSystemFileHandle.js", + "isDynamicEntry": true, + "imports": [ + "_FileSystemHandle.CFTLjada.js", + "_util.D5poj9OK.js", + "_config.Mbx-WYSj.js" + ] + }, + "../node_modules/native-file-system-adapter/src/adapters/downloader.js": { + "file": "static/js/downloader.BNL8VwzI.js", + "name": "downloader", + "src": "../node_modules/native-file-system-adapter/src/adapters/downloader.js", + "isDynamicEntry": true, + "imports": [ + "_util.D5poj9OK.js", + "_config.Mbx-WYSj.js" + ] + }, + "../node_modules/native-file-system-adapter/src/adapters/memory.js": { + "file": "static/js/memory.BBXA0YvX.js", + "name": "memory", + "src": "../node_modules/native-file-system-adapter/src/adapters/memory.js", + "isDynamicEntry": true, + "imports": [ + "_util.D5poj9OK.js", + "_config.Mbx-WYSj.js" + ] + }, + "../node_modules/native-file-system-adapter/src/adapters/sandbox.js": { + "file": "static/js/sandbox.eE-Zfl8S.js", + "name": "sandbox", + "src": "../node_modules/native-file-system-adapter/src/adapters/sandbox.js", + "isDynamicEntry": true, + "imports": [ + "_util.D5poj9OK.js" + ] + }, + "../node_modules/native-file-system-adapter/src/es6.js": { + "file": "static/js/es6.CiwTgjbX.js", + "name": "es6", + "src": "../node_modules/native-file-system-adapter/src/es6.js", + "isDynamicEntry": true, + "imports": [ + "_preload-helper.HclGiUj8.js", + "_FileSystemHandle.CFTLjada.js", + "../node_modules/native-file-system-adapter/src/FileSystemDirectoryHandle.js", + "../node_modules/native-file-system-adapter/src/FileSystemFileHandle.js" + ], + "dynamicImports": [ + "_util.D5poj9OK.js", + "../node_modules/native-file-system-adapter/src/FileSystemFileHandle.js", + "../node_modules/native-file-system-adapter/src/adapters/downloader.js", + "../node_modules/native-file-system-adapter/src/adapters/sandbox.js", + "../node_modules/native-file-system-adapter/src/FileSystemDirectoryHandle.js" + ] + }, + "../node_modules/node-emoji/lib/index.js": { + "file": "static/js/lib.Bu0LUpLz.js", + "name": "lib", + "src": "../node_modules/node-emoji/lib/index.js", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "../node_modules/rehype-katex/index.js": { + "file": "static/js/rehype-katex.vcBaU5XZ.js", + "name": "rehype-katex", + "src": "../node_modules/rehype-katex/index.js", + "isDynamicEntry": true, + "imports": [ + "_lib.DaUKNU-6.js", + "_hastscript.BGKGo9FQ.js", + "_web-namespaces.BxZ_GhEx.js" + ] + }, + "../node_modules/rehype-raw/index.js": { + "file": "static/js/rehype-raw.BD2zFDNP.js", + "name": "rehype-raw", + "src": "../node_modules/rehype-raw/index.js", + "isDynamicEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_lib.CMmWlZtt.js", + "_space-separated-tokens.BCngOmQZ.js", + "_hastscript.BGKGo9FQ.js", + "_web-namespaces.BxZ_GhEx.js" + ] + }, + "../node_modules/remark-emoji/index.js": { + "file": "static/js/remark-emoji.DKwdiqLP.js", + "name": "remark-emoji", + "src": "../node_modules/remark-emoji/index.js", + "isDynamicEntry": true, + "imports": [ + "_lib.DuoFSfCJ.js", + "../node_modules/node-emoji/lib/index.js" + ] + }, + "../node_modules/wavesurfer.js/dist/plugins/record.js": { + "file": "static/js/record.MREo2lrP.js", + "name": "record", + "src": "../node_modules/wavesurfer.js/dist/plugins/record.js", + "isDynamicEntry": true + }, + "../node_modules/wavesurfer.js/dist/wavesurfer.esm.js": { + "file": "static/js/wavesurfer.esm.hdwAnkyS.js", + "name": "wavesurfer.esm", + "src": "../node_modules/wavesurfer.js/dist/wavesurfer.esm.js", + "isDynamicEntry": true + }, + "_AlertElement.BAyMiYwt.js": { + "file": "static/js/AlertElement.BAyMiYwt.js", + "name": "AlertElement", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_DynamicIcon.44zobID_.js", + "_useEmotionTheme.D29Ufy6b.js", + "_ErrorElement.BWmlOcKX.js" + ] + }, + "_Autocomplete.D9k6mFCZ.js": { + "file": "static/js/Autocomplete.D9k6mFCZ.js", + "name": "Autocomplete", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_BaseButton.DzUQ5vsa.js": { + "file": "static/js/BaseButton.DzUQ5vsa.js", + "name": "BaseButton", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_styled-components.B5oT30oI.js" + ] + }, + "_BaseButtonTooltip.DyFZqtoX.js": { + "file": "static/js/BaseButtonTooltip.DyFZqtoX.js", + "name": "BaseButtonTooltip", + "imports": [ + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_Tooltip.PNC8NIZa.js", + "_styled-components.B5oT30oI.js" + ] + }, + "_Cancel.esm.CTWwYXdL.js": { + "file": "static/js/Cancel.esm.CTWwYXdL.js", + "name": "Cancel.esm", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_index.esm.DCRlH4DP.js" + ] + }, + "_Check.esm.B4TBPV6z.js": { + "file": "static/js/Check.esm.B4TBPV6z.js", + "name": "Check.esm", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_index.esm.DCRlH4DP.js" + ] + }, + "_Close.esm.DiV9yyug.js": { + "file": "static/js/Close.esm.DiV9yyug.js", + "name": "Close.esm", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_index.esm.DCRlH4DP.js" + ] + }, + "_CodeBlockCopyToolbar.D57Zh6DT.js": { + "file": "static/js/CodeBlockCopyToolbar.D57Zh6DT.js", + "name": "CodeBlockCopyToolbar", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_ErrorElement.BWmlOcKX.js", + "_Check.esm.B4TBPV6z.js", + "_ContentCopy.esm.Dq-fIx3A.js", + "_Toolbar.BynU-Hbw.js", + "_useCopyToClipboard.31Hpj0n3.js" + ] + }, + "_ContentCopy.esm.Dq-fIx3A.js": { + "file": "static/js/ContentCopy.esm.Dq-fIx3A.js", + "name": "ContentCopy.esm", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_index.esm.DCRlH4DP.js" + ] + }, + "_DataFrame.DUkanX9_.css": { + "file": "static/css/DataFrame.DUkanX9_.css", + "src": "_DataFrame.DUkanX9_.css" + }, + "_DataFrame.Wny8mRut.js": { + "file": "static/js/DataFrame.Wny8mRut.js", + "name": "DataFrame", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_react-dom.DZwq-Xzd.js", + "_utils.94RcZhG4.js", + "_emotion-react.browser.esm.B06RJmME.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_toString.tRXNBxtF.js", + "_merge.CkO-ckia.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_pandasStylerUtils.CpHtlemx.js", + "_isEmpty.DjruDP6v.js", + "_isEqual.CgNOpGTC.js", + "_getColors.DtAxY2Hd.js", + "_classnames.B69Vzagp.js", + "_lib.CzPO8p6E.js", + "_DynamicIcon.44zobID_.js", + "_UriUtil.olyUCSHN.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_ErrorElement.BWmlOcKX.js", + "_useFloatingOverlay.DlcdWSVH.js", + "_preload-helper.HclGiUj8.js", + "_useExecuteWhenChanged.CJi0fna4.js", + "_FormClearHelper.D0Yt6KG5.js", + "_useTimeout.CUauXJkz.js", + "_useCalculatedDimensions.BnLCBgVi.js", + "_objectWithoutPropertiesLoose.DkqnLJVA.js", + "_index.esm.DCRlH4DP.js", + "_Check.esm.B4TBPV6z.js", + "_toConsumableArray.BxvvZSIl.js", + "_Delete.esm.CDosXh7J.js", + "_FileDownload.esm.BM_tuzhj.js", + "_Toolbar.BynU-Hbw.js", + "_useCopyToClipboard.31Hpj0n3.js", + "_useRequiredContext.F4hG38Ff.js", + "__hasPath.BAJp1Wyr.js", + "__baseAssignValue.D38XrOT1.js", + "_recordbatch.BmKVw6jF.js", + "_useOverlayDismissal.DB4_ko2H.js", + "_useScrollbarGutterSize.B_VG1Wad.js", + "_slicedToArray.624-tfZX.js", + "_possibleConstructorReturn.DlxXudXd.js", + "_createSuper.CUU0SpoM.js", + "_withFullScreenWrapper.DjqP6oFO.js", + "_click-outside-container.Ci0KWfiz.js", + "_dist.Bp4fj7nv.js", + "_moment.CaJaEtMO.js", + "_numbro.-0LqK-W4.js", + "_dist.CETvsizV.js", + "_reactJsonViewCompat.nQHHQTSK.js", + "_formatNumber.D1UJmEyL.js", + "_formatMoment.CtdYuS92.js", + "_createDownloadLinkElement.CV8DGZx1.js", + "_styled-components.CuxloOeN.js" + ], + "dynamicImports": [ + "../node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/data-grid-overlay-editor.js", + "../node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/private/number-overlay-editor.js", + "../node_modules/native-file-system-adapter/src/es6.js" + ], + "css": [ + "static/css/DataFrame.DUkanX9_.css" + ] + }, + "_Delete.esm.CDosXh7J.js": { + "file": "static/js/Delete.esm.CDosXh7J.js", + "name": "Delete.esm", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_index.esm.DCRlH4DP.js" + ] + }, + "_DynamicButtonLabel.UT8nPWDL.js": { + "file": "static/js/DynamicButtonLabel.UT8nPWDL.js", + "name": "DynamicButtonLabel", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_DynamicIcon.44zobID_.js", + "_styled-components.B5oT30oI.js" + ] + }, + "_DynamicIcon.44zobID_.js": { + "file": "static/js/DynamicIcon.44zobID_.js", + "name": "DynamicIcon", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_Icon.RiOK8SDN.js" + ] + }, + "_ErrorElement.BWmlOcKX.js": { + "file": "static/js/ErrorElement.BWmlOcKX.js", + "name": "ErrorElement", + "imports": [ + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_getColors.DtAxY2Hd.js" + ] + }, + "_ErrorHandling.H5STbbYb.js": { + "file": "static/js/ErrorHandling.H5STbbYb.js", + "name": "ErrorHandling" + }, + "_ErrorOutline.esm.CZ5wypOV.js": { + "file": "static/js/ErrorOutline.esm.CZ5wypOV.js", + "name": "ErrorOutline.esm", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_index.esm.DCRlH4DP.js" + ] + }, + "_FileDownload.esm.BM_tuzhj.js": { + "file": "static/js/FileDownload.esm.BM_tuzhj.js", + "name": "FileDownload.esm", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_index.esm.DCRlH4DP.js" + ] + }, + "_FileSystemHandle.CFTLjada.js": { + "file": "static/js/FileSystemHandle.CFTLjada.js", + "name": "FileSystemHandle" + }, + "_FocusScope.0TQQ9LKf.js": { + "file": "static/js/FocusScope.0TQQ9LKf.js", + "name": "FocusScope", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_react-dom.DZwq-Xzd.js", + "_Tooltip.PNC8NIZa.js", + "_useFocusRing.C8atAWyK.js" + ] + }, + "_FormClearHelper.D0Yt6KG5.js": { + "file": "static/js/FormClearHelper.D0Yt6KG5.js", + "name": "FormClearHelper", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_utils.94RcZhG4.js", + "_types.cZoyy9Y-.js" + ] + }, + "_FormsContext.Dt-mNfG5.js": { + "file": "static/js/FormsContext.Dt-mNfG5.js", + "name": "FormsContext", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js" + ] + }, + "_Hidden.Bpblr2PM.js": { + "file": "static/js/Hidden.Bpblr2PM.js", + "name": "Hidden", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_IFrameUtil.PlC_b34Z.js": { + "file": "static/js/IFrameUtil.PlC_b34Z.js", + "name": "IFrameUtil" + }, + "_Icon.RiOK8SDN.js": { + "file": "static/js/Icon.RiOK8SDN.js", + "name": "Icon", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_emotion-react.browser.esm.B06RJmME.js" + ] + }, + "_InputInstructions.D7oNXsUt.js": { + "file": "static/js/InputInstructions.D7oNXsUt.js", + "name": "InputInstructions", + "imports": [ + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_emotion-react.browser.esm.B06RJmME.js", + "_styled-components.jxsKpeRi.js" + ] + }, + "_KeyboardArrowDown.esm.Duf7utJJ.js": { + "file": "static/js/KeyboardArrowDown.esm.Duf7utJJ.js", + "name": "KeyboardArrowDown.esm", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_react-dom.DZwq-Xzd.js", + "_Tooltip.PNC8NIZa.js", + "_useCollection.CEK9PDaH.js", + "_useFocusRing.C8atAWyK.js", + "_useLabel.BMjZg4WL.js", + "_Hidden.Bpblr2PM.js", + "_usePress.C0FRp5XM.js", + "_ProgressBar.BvdOcqLD.js", + "_SelectionIndicator.rChpdeaI.js", + "_VisuallyHidden.8TzBGVb_.js", + "_FocusScope.0TQQ9LKf.js", + "_index.esm.DCRlH4DP.js" + ] + }, + "_NavigationContext.CaL318Cx.js": { + "file": "static/js/NavigationContext.CaL318Cx.js", + "name": "NavigationContext", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_Particles.CD7975JF.js": { + "file": "static/js/Particles.CD7975JF.js", + "name": "Particles", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_react-dom.DZwq-Xzd.js", + "_range.DL19EGGd.js", + "_UriUtil.olyUCSHN.js", + "_PortalContext.BUXYSLQA.js" + ] + }, + "_PortalContext.BUXYSLQA.js": { + "file": "static/js/PortalContext.BUXYSLQA.js", + "name": "PortalContext", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_ProgressBar.BvdOcqLD.js": { + "file": "static/js/ProgressBar.BvdOcqLD.js", + "name": "ProgressBar", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js", + "_useLabel.BMjZg4WL.js", + "_useNumberFormatter.t6impjkR.js" + ] + }, + "_ProgressBar.C0SD2GrQ.js": { + "file": "static/js/ProgressBar.C0SD2GrQ.js", + "name": "ProgressBar", + "imports": [ + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_ProgressBar.BvdOcqLD.js" + ] + }, + "_ResizeObserver.es.CdkJ1I5V.js": { + "file": "static/js/ResizeObserver.es.CdkJ1I5V.js", + "name": "ResizeObserver.es", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "_SelectionIndicator.rChpdeaI.js": { + "file": "static/js/SelectionIndicator.rChpdeaI.js", + "name": "SelectionIndicator", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js", + "_useFocusRing.C8atAWyK.js", + "_usePress.C0FRp5XM.js", + "_FocusScope.0TQQ9LKf.js" + ] + }, + "_StreamlitMarkdown.DJLoxxnS.js": { + "file": "static/js/StreamlitMarkdown.DJLoxxnS.js", + "name": "StreamlitMarkdown", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_utils.94RcZhG4.js", + "_emotion-react.browser.esm.B06RJmME.js", + "_toString.tRXNBxtF.js", + "_merge.CkO-ckia.js", + "_isArrayLikeObject.B3Zf3PTL.js", + "__baseClone.Bcnb-YL-.js", + "_last.DfjdtCRp.js", + "_getColors.DtAxY2Hd.js", + "_UriUtil.olyUCSHN.js", + "_useCrossOriginAttribute.DBi7mGp8.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_lib.DuoFSfCJ.js", + "_lib.DaUKNU-6.js", + "_lib.CMmWlZtt.js", + "_space-separated-tokens.BCngOmQZ.js", + "_ErrorElement.BWmlOcKX.js", + "_preload-helper.HclGiUj8.js" + ], + "dynamicImports": [ + "../node_modules/rehype-katex/index.js", + "_katex.min.BDrowdx1.js", + "../node_modules/rehype-raw/index.js", + "../node_modules/remark-emoji/index.js", + "../lib/src/components/elements/CodeBlock/StreamlitSyntaxHighlighter.tsx", + "../lib/src/components/shared/StreamlitMarkdown/MermaidChart.tsx" + ] + }, + "_TableChart.esm.Bm7WHa8s.js": { + "file": "static/js/TableChart.esm.Bm7WHa8s.js", + "name": "TableChart.esm", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_index.esm.DCRlH4DP.js" + ] + }, + "_Text.CGzIOlkG.js": { + "file": "static/js/Text.CGzIOlkG.js", + "name": "Text", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_TextField.L8vxRwMe.js": { + "file": "static/js/TextField.L8vxRwMe.js", + "name": "TextField", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js", + "_useLabel.BMjZg4WL.js", + "_Autocomplete.D9k6mFCZ.js", + "_Hidden.Bpblr2PM.js", + "_Text.CGzIOlkG.js", + "_useField.CLWVwWoT.js", + "_useFormValidation.CZGpvO3z.js", + "_useTextField.BYQ8oAlv.js" + ] + }, + "_Toolbar.BynU-Hbw.js": { + "file": "static/js/Toolbar.BynU-Hbw.js", + "name": "Toolbar", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_Icon.RiOK8SDN.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_styled-components.B5oT30oI.js", + "_BaseButton.DzUQ5vsa.js", + "_ErrorElement.BWmlOcKX.js", + "_index.esm.DCRlH4DP.js" + ] + }, + "_Tooltip.PNC8NIZa.js": { + "file": "static/js/Tooltip.PNC8NIZa.js", + "name": "Tooltip", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_react-dom.DZwq-Xzd.js", + "_emotion-react.browser.esm.B06RJmME.js", + "_getColors.DtAxY2Hd.js", + "_useFloatingOverlay.DlcdWSVH.js" + ] + }, + "_UploadFileInfo.WAP1L8Dh.js": { + "file": "static/js/UploadFileInfo.WAP1L8Dh.js", + "name": "UploadFileInfo" + }, + "_UriUtil.olyUCSHN.js": { + "file": "static/js/UriUtil.olyUCSHN.js", + "name": "UriUtil", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_protobuf.DC2L68b9.js" + ] + }, + "_ViewStateContext.C6Nfqh3k.js": { + "file": "static/js/ViewStateContext.C6Nfqh3k.js", + "name": "ViewStateContext", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_VisuallyHidden.8TzBGVb_.js": { + "file": "static/js/VisuallyHidden.8TzBGVb_.js", + "name": "VisuallyHidden", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js" + ] + }, + "_WidgetLabel.CVV1ys75.js": { + "file": "static/js/WidgetLabel.CVV1ys75.js", + "name": "WidgetLabel", + "imports": [ + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_types.cZoyy9Y-.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_styled-components.jxsKpeRi.js" + ] + }, + "_WidgetLabelHelpIcon.BmvkC-YW.js": { + "file": "static/js/WidgetLabelHelpIcon.BmvkC-YW.js", + "name": "WidgetLabelHelpIcon", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_Tooltip.PNC8NIZa.js", + "_styled-components.jxsKpeRi.js" + ] + }, + "_WidgetLabelHelpIconInline.DB6cihzP.js": { + "file": "static/js/WidgetLabelHelpIconInline.DB6cihzP.js", + "name": "WidgetLabelHelpIconInline", + "imports": [ + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "_Tooltip.PNC8NIZa.js", + "_styled-components.jxsKpeRi.js" + ] + }, + "__arrayIncludesWith.DcNFv7pK.js": { + "file": "static/js/_arrayIncludesWith.DcNFv7pK.js", + "name": "_arrayIncludesWith", + "imports": [ + "__baseIndexOf.CYLdY-L6.js" + ] + }, + "__arrayReduce.CiwPAjrV.js": { + "file": "static/js/_arrayReduce.CiwPAjrV.js", + "name": "_arrayReduce" + }, + "__baseAssignValue.D38XrOT1.js": { + "file": "static/js/_baseAssignValue.D38XrOT1.js", + "name": "_baseAssignValue", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "__hasPath.BAJp1Wyr.js" + ] + }, + "__baseClone.Bcnb-YL-.js": { + "file": "static/js/_baseClone.Bcnb-YL-.js", + "name": "_baseClone", + "imports": [ + "_isSymbol.CmW3dkoN.js", + "_toString.tRXNBxtF.js", + "_isArrayLike.Crw2F5li.js", + "_isArrayLikeObject.B3Zf3PTL.js" + ] + }, + "__baseEach.PLhpSRgM.js": { + "file": "static/js/_baseEach.PLhpSRgM.js", + "name": "_baseEach", + "imports": [ + "_toString.tRXNBxtF.js", + "_isArrayLike.Crw2F5li.js", + "_isArrayLikeObject.B3Zf3PTL.js", + "__baseIsEqual.sdZCjgvS.js", + "__baseProperty.BV6HSwpm.js" + ] + }, + "__baseFlatten.IOj0lc7G.js": { + "file": "static/js/_baseFlatten.IOj0lc7G.js", + "name": "_baseFlatten", + "imports": [ + "_isSymbol.CmW3dkoN.js", + "_toString.tRXNBxtF.js", + "_isArrayLikeObject.B3Zf3PTL.js" + ] + }, + "__baseIndexOf.CYLdY-L6.js": { + "file": "static/js/_baseIndexOf.CYLdY-L6.js", + "name": "_baseIndexOf" + }, + "__baseIsEqual.sdZCjgvS.js": { + "file": "static/js/_baseIsEqual.sdZCjgvS.js", + "name": "_baseIsEqual", + "imports": [ + "_isSymbol.CmW3dkoN.js", + "_toString.tRXNBxtF.js", + "_isArrayLike.Crw2F5li.js", + "_isArrayLikeObject.B3Zf3PTL.js" + ] + }, + "__baseMap.OhVc4KF-.js": { + "file": "static/js/_baseMap.OhVc4KF-.js", + "name": "_baseMap", + "imports": [ + "_isArrayLike.Crw2F5li.js", + "__baseEach.PLhpSRgM.js" + ] + }, + "__baseProperty.BV6HSwpm.js": { + "file": "static/js/_baseProperty.BV6HSwpm.js", + "name": "_baseProperty" + }, + "__hasPath.BAJp1Wyr.js": { + "file": "static/js/_hasPath.BAJp1Wyr.js", + "name": "_hasPath", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "__hasUnicode.Cp9Achgk.js": { + "file": "static/js/_hasUnicode.Cp9Achgk.js", + "name": "_hasUnicode" + }, + "__isIterateeCall.BUStsXAd.js": { + "file": "static/js/_isIterateeCall.BUStsXAd.js", + "name": "_isIterateeCall", + "imports": [ + "_isSymbol.CmW3dkoN.js", + "_isArrayLike.Crw2F5li.js" + ] + }, + "_arc.Bz4qkNTB.js": { + "file": "static/js/arc.Bz4qkNTB.js", + "name": "arc", + "imports": [ + "_path.DK9UMQdM.js", + "_dist.BQ4V7D6H.js" + ] + }, + "_array.BifhSqXX.js": { + "file": "static/js/array.BifhSqXX.js", + "name": "array" + }, + "_assertThisInitialized.Cpir0pD1.js": { + "file": "static/js/assertThisInitialized.Cpir0pD1.js", + "name": "assertThisInitialized" + }, + "_channel.CsxEH82A.js": { + "file": "static/js/channel.CsxEH82A.js", + "name": "channel", + "imports": [ + "_chunk-WYO6CB5R.-gOV9D83.js" + ] + }, + "_chevron-down.gANryksn.js": { + "file": "static/js/chevron-down.gANryksn.js", + "name": "chevron-down", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_es2015.HS3QcJYh.js" + ] + }, + "_chunk-2Q5K7J3B.BsaEqoYJ.js": { + "file": "static/js/chunk-2Q5K7J3B.BsaEqoYJ.js", + "name": "chunk-2Q5K7J3B", + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js" + ] + }, + "_chunk-32BRIVSS.CRML9a9R.js": { + "file": "static/js/chunk-32BRIVSS.CRML9a9R.js", + "name": "chunk-32BRIVSS", + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_dist.BQ4V7D6H.js" + ] + }, + "_chunk-52WLFC77.CL_Wd-B6.js": { + "file": "static/js/chunk-52WLFC77.CL_Wd-B6.js", + "name": "chunk-52WLFC77", + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_line.BtQvjP12.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-7BUUIJ7U.CAhmNhj7.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_rough.esm.CSKSodPl.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js" + ] + }, + "_chunk-5FCAYU7R.C_m-TPOx.js": { + "file": "static/js/chunk-5FCAYU7R.C_m-TPOx.js", + "name": "chunk-5FCAYU7R", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-5HE753X5.D2IwY2Hs.js": { + "file": "static/js/chunk-5HE753X5.D2IwY2Hs.js", + "name": "chunk-5HE753X5", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-5JV3BV7I.DJesgnfK.js": { + "file": "static/js/chunk-5JV3BV7I.DJesgnfK.js", + "name": "chunk-5JV3BV7I", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-5TONJI2A.CazhSWpT.js": { + "file": "static/js/chunk-5TONJI2A.CazhSWpT.js", + "name": "chunk-5TONJI2A", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-5VM5RSS4.TOl2eSYi.js": { + "file": "static/js/chunk-5VM5RSS4.TOl2eSYi.js", + "name": "chunk-5VM5RSS4", + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js" + ] + }, + "_chunk-7BUUIJ7U.CAhmNhj7.js": { + "file": "static/js/chunk-7BUUIJ7U.CAhmNhj7.js", + "name": "chunk-7BUUIJ7U", + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js" + ] + }, + "_chunk-BIQX33UG.B4NE4TKF.js": { + "file": "static/js/chunk-BIQX33UG.B4NE4TKF.js", + "name": "chunk-BIQX33UG", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-C7G6YPKG.EaPayahY.js": { + "file": "static/js/chunk-C7G6YPKG.EaPayahY.js", + "name": "chunk-C7G6YPKG", + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_chunk-WYO6CB5R.-gOV9D83.js" + ] + }, + "_chunk-CQNSW5MT.CwsHPlpw.js": { + "file": "static/js/chunk-CQNSW5MT.CwsHPlpw.js", + "name": "chunk-CQNSW5MT", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-CYSBUYHQ.Bo3-8CRa.js": { + "file": "static/js/chunk-CYSBUYHQ.Bo3-8CRa.js", + "name": "chunk-CYSBUYHQ", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-EMLP6XTP.B17sZ-5U.js": { + "file": "static/js/chunk-EMLP6XTP.B17sZ-5U.js", + "name": "chunk-EMLP6XTP", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-EX3LRPZG.B6XHH3aH.js": { + "file": "static/js/chunk-EX3LRPZG.B6XHH3aH.js", + "name": "chunk-EX3LRPZG", + "imports": [ + "_src.CE7XIH0z.js", + "_purify.es.sLXpNpJ5.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-32BRIVSS.CRML9a9R.js", + "_chunk-XXDRQBXY.BLiu-513.js", + "_chunk-VR4S4FIN.DMqg5-Rg.js", + "_chunk-FWX5IMBZ.lGkST2x9.js" + ] + }, + "_chunk-FWX5IMBZ.lGkST2x9.js": { + "file": "static/js/chunk-FWX5IMBZ.lGkST2x9.js", + "name": "chunk-FWX5IMBZ", + "imports": [ + "_preload-helper.HclGiUj8.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-52WLFC77.CL_Wd-B6.js" + ], + "dynamicImports": [ + "../node_modules/mermaid/dist/chunks/mermaid.core/dagre-VKFMJZFB.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/swimlanes-5IMT3BWC.mjs", + "../node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-JH36ORCC.mjs" + ] + }, + "_chunk-HOUHSVGY.zNH8MoI9.js": { + "file": "static/js/chunk-HOUHSVGY.zNH8MoI9.js", + "name": "chunk-HOUHSVGY", + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js" + ] + }, + "_chunk-ICXQ74PX.CwBrFo8s.js": { + "file": "static/js/chunk-ICXQ74PX.CwBrFo8s.js", + "name": "chunk-ICXQ74PX", + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_dist.BQ4V7D6H.js" + ] + }, + "_chunk-JG7HCLWE.2vZbAraA.js": { + "file": "static/js/chunk-JG7HCLWE.2vZbAraA.js", + "name": "chunk-JG7HCLWE", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-JWPE2WC7.A3RzWITa.js": { + "file": "static/js/chunk-JWPE2WC7.A3RzWITa.js", + "name": "chunk-JWPE2WC7", + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js" + ] + }, + "_chunk-KEIR6QF5.Dj-OpFgW.js": { + "file": "static/js/chunk-KEIR6QF5.Dj-OpFgW.js", + "name": "chunk-KEIR6QF5" + }, + "_chunk-MOJQB5TN.B4REpjLl.js": { + "file": "static/js/chunk-MOJQB5TN.B4REpjLl.js", + "name": "chunk-MOJQB5TN", + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-VAUOI2AC.BOaFDBFv.js" + ] + }, + "_chunk-MOZMSUNE.EeATBuYk.js": { + "file": "static/js/chunk-MOZMSUNE.EeATBuYk.js", + "name": "chunk-MOZMSUNE", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-OGEWGWER.BQmEmpLE.js": { + "file": "static/js/chunk-OGEWGWER.BQmEmpLE.js", + "name": "chunk-OGEWGWER", + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js" + ] + }, + "_chunk-OSBZ3O6U._N6nOv0n.js": { + "file": "static/js/chunk-OSBZ3O6U._N6nOv0n.js", + "name": "chunk-OSBZ3O6U", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-PUDLZKDR.CXuYzR_2.js": { + "file": "static/js/chunk-PUDLZKDR.CXuYzR_2.js", + "name": "chunk-PUDLZKDR", + "imports": [ + "_src.CE7XIH0z.js", + "_purify.es.sLXpNpJ5.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_channel.CsxEH82A.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-5VM5RSS4.TOl2eSYi.js", + "_chunk-32BRIVSS.CRML9a9R.js", + "_chunk-XXDRQBXY.BLiu-513.js", + "_chunk-VR4S4FIN.DMqg5-Rg.js", + "_chunk-ZGVPDNZ5.GnXVbPyR.js", + "_chunk-FWX5IMBZ.lGkST2x9.js", + "_chunk-ZIRB5QZD.Dh20_f-h.js" + ] + }, + "_chunk-Q4XR5HBZ.DWR7wB4i.js": { + "file": "static/js/chunk-Q4XR5HBZ.DWR7wB4i.js", + "name": "chunk-Q4XR5HBZ", + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-HOUHSVGY.zNH8MoI9.js" + ] + }, + "_chunk-QBLGF6JB.DFvVIIOP.js": { + "file": "static/js/chunk-QBLGF6JB.DFvVIIOP.js", + "name": "chunk-QBLGF6JB", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-R7FJI6CG.DpWbzOcb.js": { + "file": "static/js/chunk-R7FJI6CG.DpWbzOcb.js", + "name": "chunk-R7FJI6CG", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-RYQCIY6F.6HsFiqTY.js": { + "file": "static/js/chunk-RYQCIY6F.6HsFiqTY.js", + "name": "chunk-RYQCIY6F", + "imports": [ + "__baseClone.Bcnb-YL-.js", + "_graphlib.CL58BBKe.js", + "_isUndefined.Dk8JX1dj.js", + "_map.CsK82nE3.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js" + ] + }, + "_chunk-U6XO7XAA.t2Sk_D5L.js": { + "file": "static/js/chunk-U6XO7XAA.t2Sk_D5L.js", + "name": "chunk-U6XO7XAA", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-V7JOEXUC.CFaH8Jy6.js": { + "file": "static/js/chunk-V7JOEXUC.CFaH8Jy6.js", + "name": "chunk-V7JOEXUC", + "imports": [ + "_src.CE7XIH0z.js", + "_purify.es.sLXpNpJ5.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-5VM5RSS4.TOl2eSYi.js", + "_chunk-32BRIVSS.CRML9a9R.js", + "_chunk-XXDRQBXY.BLiu-513.js", + "_chunk-VR4S4FIN.DMqg5-Rg.js", + "_chunk-FWX5IMBZ.lGkST2x9.js" + ] + }, + "_chunk-VAUOI2AC.BOaFDBFv.js": { + "file": "static/js/chunk-VAUOI2AC.BOaFDBFv.js", + "name": "chunk-VAUOI2AC", + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js" + ] + }, + "_chunk-VR4S4FIN.DMqg5-Rg.js": { + "file": "static/js/chunk-VR4S4FIN.DMqg5-Rg.js", + "name": "chunk-VR4S4FIN", + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js" + ] + }, + "_chunk-WYO6CB5R.-gOV9D83.js": { + "file": "static/js/chunk-WYO6CB5R.-gOV9D83.js", + "name": "chunk-WYO6CB5R", + "imports": [ + "_preload-helper.HclGiUj8.js", + "_purify.es.sLXpNpJ5.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js" + ], + "dynamicImports": [ + "../node_modules/mermaid/node_modules/katex/dist/katex.mjs" + ] + }, + "_chunk-XXDRQBXY.BLiu-513.js": { + "file": "static/js/chunk-XXDRQBXY.BLiu-513.js", + "name": "chunk-XXDRQBXY", + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js" + ] + }, + "_chunk-Y2CYZVJY.DsF7k-Jl.js": { + "file": "static/js/chunk-Y2CYZVJY.DsF7k-Jl.js", + "name": "chunk-Y2CYZVJY" + }, + "_chunk-YOTPTUD7.CQZR6t9a.js": { + "file": "static/js/chunk-YOTPTUD7.CQZR6t9a.js", + "name": "chunk-YOTPTUD7", + "imports": [ + "_chunk-KEIR6QF5.Dj-OpFgW.js" + ] + }, + "_chunk-ZGVPDNZ5.GnXVbPyR.js": { + "file": "static/js/chunk-ZGVPDNZ5.GnXVbPyR.js", + "name": "chunk-ZGVPDNZ5", + "imports": [ + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js", + "_src.BygSYTzs.js", + "_chunk-WYO6CB5R.-gOV9D83.js", + "_chunk-ICXQ74PX.CwBrFo8s.js", + "_chunk-HOUHSVGY.zNH8MoI9.js", + "_chunk-Q4XR5HBZ.DWR7wB4i.js", + "_chunk-OGEWGWER.BQmEmpLE.js", + "_chunk-C7G6YPKG.EaPayahY.js", + "_rough.esm.CSKSodPl.js" + ] + }, + "_chunk-ZIRB5QZD.Dh20_f-h.js": { + "file": "static/js/chunk-ZIRB5QZD.Dh20_f-h.js", + "name": "chunk-ZIRB5QZD", + "imports": [ + "_chunk-Y2CYZVJY.DsF7k-Jl.js" + ] + }, + "_classnames.B69Vzagp.js": { + "file": "static/js/classnames.B69Vzagp.js", + "name": "classnames", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "_click-outside-container.Ci0KWfiz.js": { + "file": "static/js/click-outside-container.Ci0KWfiz.js", + "name": "click-outside-container", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "__hasPath.BAJp1Wyr.js" + ] + }, + "_colors.Cg5Vh3br.js": { + "file": "static/js/colors.Cg5Vh3br.js", + "name": "colors" + }, + "_config.Mbx-WYSj.js": { + "file": "static/js/config.Mbx-WYSj.js", + "name": "config" + }, + "_createDownloadLinkElement.CV8DGZx1.js": { + "file": "static/js/createDownloadLinkElement.CV8DGZx1.js", + "name": "createDownloadLinkElement", + "imports": [ + "_protobuf.DC2L68b9.js" + ] + }, + "_createSuper.CUU0SpoM.js": { + "file": "static/js/createSuper.CUU0SpoM.js", + "name": "createSuper", + "imports": [ + "_possibleConstructorReturn.DlxXudXd.js" + ] + }, + "_cytoscape.esm.CQFVGiJu.js": { + "file": "static/js/cytoscape.esm.CQFVGiJu.js", + "name": "cytoscape.esm" + }, + "_dagre.BkrREj6y.js": { + "file": "static/js/dagre.BkrREj6y.js", + "name": "dagre", + "imports": [ + "_isSymbol.CmW3dkoN.js", + "_toString.tRXNBxtF.js", + "__isIterateeCall.BUStsXAd.js", + "_isArrayLike.Crw2F5li.js", + "_merge.CkO-ckia.js", + "_isArrayLikeObject.B3Zf3PTL.js", + "__baseClone.Bcnb-YL-.js", + "_graphlib.CL58BBKe.js", + "__baseIndexOf.CYLdY-L6.js", + "_last.DfjdtCRp.js", + "__hasUnicode.Cp9Achgk.js", + "__baseEach.PLhpSRgM.js", + "__baseProperty.BV6HSwpm.js", + "_now.BzMxC3T_.js", + "_isUndefined.Dk8JX1dj.js", + "_map.CsK82nE3.js", + "_pick.CbtWtxHL.js", + "_sortBy.BN5z75-Y.js", + "_range.DL19EGGd.js" + ] + }, + "_defaultLocale.DAnyU4o_.js": { + "file": "static/js/defaultLocale.DAnyU4o_.js", + "name": "defaultLocale" + }, + "_dist.BQ4V7D6H.js": { + "file": "static/js/dist.BQ4V7D6H.js", + "name": "dist", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "_dist.Bp4fj7nv.js": { + "file": "static/js/dist.Bp4fj7nv.js", + "name": "dist", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_dist.CETvsizV.js": { + "file": "static/js/dist.CETvsizV.js", + "name": "dist", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "_emotion-is-prop-valid.esm.CygBv61C.js": { + "file": "static/js/emotion-is-prop-valid.esm.CygBv61C.js", + "name": "emotion-is-prop-valid.esm", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "_emotion-react.browser.esm.B06RJmME.js": { + "file": "static/js/emotion-react.browser.esm.B06RJmME.js", + "name": "emotion-react.browser.esm", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js" + ] + }, + "_emotion-styled.browser.esm.DsRKNFfx.js": { + "file": "static/js/emotion-styled.browser.esm.DsRKNFfx.js", + "name": "emotion-styled.browser.esm", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_es2015.HS3QcJYh.js": { + "file": "static/js/es2015.HS3QcJYh.js", + "name": "es2015", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_objectWithoutPropertiesLoose.DkqnLJVA.js", + "_tslib.es6.DWZnz9P1.js", + "_assertThisInitialized.Cpir0pD1.js" + ] + }, + "_formatMoment.CtdYuS92.js": { + "file": "static/js/formatMoment.CtdYuS92.js", + "name": "formatMoment" + }, + "_formatNumber.D1UJmEyL.js": { + "file": "static/js/formatNumber.D1UJmEyL.js", + "name": "formatNumber", + "imports": [ + "_types.cZoyy9Y-.js", + "_numbro.-0LqK-W4.js", + "_sprintfjs.gMlXBjFJ.js" + ] + }, + "_fuzzyFilterSelectOptions.Dqs6-TB7.js": { + "file": "static/js/fuzzyFilterSelectOptions.Dqs6-TB7.js", + "name": "fuzzyFilterSelectOptions", + "imports": [ + "_protobuf.DC2L68b9.js", + "_sortBy.BN5z75-Y.js" + ] + }, + "_getColors.DtAxY2Hd.js": { + "file": "static/js/getColors.DtAxY2Hd.js", + "name": "getColors" + }, + "_getItemCount.s1TO7Fph.js": { + "file": "static/js/getItemCount.s1TO7Fph.js", + "name": "getItemCount", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js", + "_useCollection.CEK9PDaH.js" + ] + }, + "_graphlib.CL58BBKe.js": { + "file": "static/js/graphlib.CL58BBKe.js", + "name": "graphlib", + "imports": [ + "_toString.tRXNBxtF.js", + "_isArrayLike.Crw2F5li.js", + "_isArrayLikeObject.B3Zf3PTL.js", + "__arrayIncludesWith.DcNFv7pK.js", + "__baseFlatten.IOj0lc7G.js", + "__arrayReduce.CiwPAjrV.js", + "__baseIsEqual.sdZCjgvS.js", + "__baseEach.PLhpSRgM.js", + "_isUndefined.Dk8JX1dj.js", + "_isEmpty.DjruDP6v.js" + ] + }, + "_hastscript.BGKGo9FQ.js": { + "file": "static/js/hastscript.BGKGo9FQ.js", + "name": "hastscript", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_space-separated-tokens.BCngOmQZ.js" + ] + }, + "_iconPosition.CHJpUZea.js": { + "file": "static/js/iconPosition.CHJpUZea.js", + "name": "iconPosition", + "imports": [ + "_protobuf.DC2L68b9.js" + ] + }, + "_index.esm.DCRlH4DP.js": { + "file": "static/js/index.esm.DCRlH4DP.js", + "name": "index.esm", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_objectWithoutPropertiesLoose.DkqnLJVA.js" + ] + }, + "_init.Cs1-1e_z.js": { + "file": "static/js/init.Cs1-1e_z.js", + "name": "init" + }, + "_inputUtils.CD44xxT-.js": { + "file": "static/js/inputUtils.CD44xxT-.js", + "name": "inputUtils" + }, + "_isArrayLike.Crw2F5li.js": { + "file": "static/js/isArrayLike.Crw2F5li.js", + "name": "isArrayLike", + "imports": [ + "_isSymbol.CmW3dkoN.js" + ] + }, + "_isArrayLikeObject.B3Zf3PTL.js": { + "file": "static/js/isArrayLikeObject.B3Zf3PTL.js", + "name": "isArrayLikeObject", + "imports": [ + "_isSymbol.CmW3dkoN.js", + "_toString.tRXNBxtF.js", + "_isArrayLike.Crw2F5li.js" + ] + }, + "_isEmpty.DjruDP6v.js": { + "file": "static/js/isEmpty.DjruDP6v.js", + "name": "isEmpty", + "imports": [ + "_toString.tRXNBxtF.js", + "_isArrayLike.Crw2F5li.js", + "_isArrayLikeObject.B3Zf3PTL.js" + ] + }, + "_isEqual.CgNOpGTC.js": { + "file": "static/js/isEqual.CgNOpGTC.js", + "name": "isEqual", + "imports": [ + "__baseIsEqual.sdZCjgvS.js" + ] + }, + "_isMobile.ZOwND-6T.js": { + "file": "static/js/isMobile.ZOwND-6T.js", + "name": "isMobile", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "_isSymbol.CmW3dkoN.js": { + "file": "static/js/isSymbol.CmW3dkoN.js", + "name": "isSymbol" + }, + "_isUndefined.Dk8JX1dj.js": { + "file": "static/js/isUndefined.Dk8JX1dj.js", + "name": "isUndefined", + "imports": [ + "_toString.tRXNBxtF.js", + "_isArrayLikeObject.B3Zf3PTL.js", + "__baseEach.PLhpSRgM.js" + ] + }, + "_katex.CAfVENUR.css": { + "file": "static/css/katex.CAfVENUR.css", + "src": "_katex.CAfVENUR.css" + }, + "_katex.min.BDrowdx1.js": { + "file": "static/js/katex.min.BDrowdx1.js", + "name": "katex.min", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ], + "css": [ + "static/css/katex.CAfVENUR.css" + ], + "assets": [ + "static/media/KaTeX_AMS-Regular.BQhdFMY1.woff2", + "static/media/KaTeX_AMS-Regular.DMm9YOAa.woff", + "static/media/KaTeX_AMS-Regular.DRggAlZN.ttf", + "static/media/KaTeX_Caligraphic-Bold.Dq_IR9rO.woff2", + "static/media/KaTeX_Caligraphic-Bold.BEiXGLvX.woff", + "static/media/KaTeX_Caligraphic-Bold.ATXxdsX0.ttf", + "static/media/KaTeX_Caligraphic-Regular.Di6jR-x-.woff2", + "static/media/KaTeX_Caligraphic-Regular.CTRA-rTL.woff", + "static/media/KaTeX_Caligraphic-Regular.wX97UBjC.ttf", + "static/media/KaTeX_Fraktur-Bold.CL6g_b3V.woff2", + "static/media/KaTeX_Fraktur-Bold.BsDP51OF.woff", + "static/media/KaTeX_Fraktur-Bold.BdnERNNW.ttf", + "static/media/KaTeX_Fraktur-Regular.CTYiF6lA.woff2", + "static/media/KaTeX_Fraktur-Regular.Dxdc4cR9.woff", + "static/media/KaTeX_Fraktur-Regular.CB_wures.ttf", + "static/media/KaTeX_Main-Bold.Cx986IdX.woff2", + "static/media/KaTeX_Main-Bold.Jm3AIy58.woff", + "static/media/KaTeX_Main-Bold.waoOVXN0.ttf", + "static/media/KaTeX_Main-BoldItalic.DxDJ3AOS.woff2", + "static/media/KaTeX_Main-BoldItalic.SpSLRI95.woff", + "static/media/KaTeX_Main-BoldItalic.DzxPMmG6.ttf", + "static/media/KaTeX_Main-Italic.NWA7e6Wa.woff2", + "static/media/KaTeX_Main-Italic.BMLOBm91.woff", + "static/media/KaTeX_Main-Italic.3WenGoN9.ttf", + "static/media/KaTeX_Main-Regular.B22Nviop.woff2", + "static/media/KaTeX_Main-Regular.Dr94JaBh.woff", + "static/media/KaTeX_Main-Regular.ypZvNtVU.ttf", + "static/media/KaTeX_Math-BoldItalic.CZnvNsCZ.woff2", + "static/media/KaTeX_Math-BoldItalic.iY-2wyZ7.woff", + "static/media/KaTeX_Math-BoldItalic.B3XSjfu4.ttf", + "static/media/KaTeX_Math-Italic.t53AETM-.woff2", + "static/media/KaTeX_Math-Italic.DA0__PXp.woff", + "static/media/KaTeX_Math-Italic.flOr_0UB.ttf", + "static/media/KaTeX_SansSerif-Bold.D1sUS0GD.woff2", + "static/media/KaTeX_SansSerif-Bold.DbIhKOiC.woff", + "static/media/KaTeX_SansSerif-Bold.CFMepnvq.ttf", + "static/media/KaTeX_SansSerif-Italic.C3H0VqGB.woff2", + "static/media/KaTeX_SansSerif-Italic.DN2j7dab.woff", + "static/media/KaTeX_SansSerif-Italic.YYjJ1zSn.ttf", + "static/media/KaTeX_SansSerif-Regular.DDBCnlJ7.woff2", + "static/media/KaTeX_SansSerif-Regular.CS6fqUqJ.woff", + "static/media/KaTeX_SansSerif-Regular.BNo7hRIc.ttf", + "static/media/KaTeX_Script-Regular.D3wIWfF6.woff2", + "static/media/KaTeX_Script-Regular.D5yQViql.woff", + "static/media/KaTeX_Script-Regular.C5JkGWo-.ttf", + "static/media/KaTeX_Size1-Regular.mCD8mA8B.woff2", + "static/media/KaTeX_Size1-Regular.C195tn64.woff", + "static/media/KaTeX_Size1-Regular.Dbsnue_I.ttf", + "static/media/KaTeX_Size2-Regular.Dy4dx90m.woff2", + "static/media/KaTeX_Size2-Regular.oD1tc_U0.woff", + "static/media/KaTeX_Size2-Regular.B7gKUWhC.ttf", + "static/media/KaTeX_Size3-Regular.CTq5MqoE.woff", + "static/media/KaTeX_Size3-Regular.DgpXs0kz.ttf", + "static/media/KaTeX_Size4-Regular.Dl5lxZxV.woff2", + "static/media/KaTeX_Size4-Regular.BF-4gkZK.woff", + "static/media/KaTeX_Size4-Regular.DWFBv043.ttf", + "static/media/KaTeX_Typewriter-Regular.CO6r4hn1.woff2", + "static/media/KaTeX_Typewriter-Regular.C0xS9mPB.woff", + "static/media/KaTeX_Typewriter-Regular.D3Ib7_Hf.ttf" + ] + }, + "_last.DfjdtCRp.js": { + "file": "static/js/last.DfjdtCRp.js", + "name": "last", + "imports": [ + "_isArrayLikeObject.B3Zf3PTL.js", + "__baseFlatten.IOj0lc7G.js" + ] + }, + "_lib.CMmWlZtt.js": { + "file": "static/js/lib.CMmWlZtt.js", + "name": "lib", + "imports": [ + "_lib.DaUKNU-6.js" + ] + }, + "_lib.CzPO8p6E.js": { + "file": "static/js/lib.CzPO8p6E.js", + "name": "lib", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_react-dom.DZwq-Xzd.js", + "_utils.BrY_0PXX.js", + "_objectWithoutPropertiesLoose.DkqnLJVA.js" + ] + }, + "_lib.DaUKNU-6.js": { + "file": "static/js/lib.DaUKNU-6.js", + "name": "lib" + }, + "_lib.DuoFSfCJ.js": { + "file": "static/js/lib.DuoFSfCJ.js", + "name": "lib", + "imports": [ + "_lib.DaUKNU-6.js" + ] + }, + "_line.BtQvjP12.js": { + "file": "static/js/line.BtQvjP12.js", + "name": "line", + "imports": [ + "_path.DK9UMQdM.js", + "_array.BifhSqXX.js", + "_chunk-ICXQ74PX.CwBrFo8s.js" + ] + }, + "_linear.CR3348bP.js": { + "file": "static/js/linear.CR3348bP.js", + "name": "linear", + "imports": [ + "_defaultLocale.DAnyU4o_.js", + "_init.Cs1-1e_z.js", + "_string.2gFcx07-.js", + "_value.D6n4OHqi.js" + ] + }, + "_loglevel.BJBYxGId.js": { + "file": "static/js/loglevel.BJBYxGId.js", + "name": "loglevel", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "_map.CsK82nE3.js": { + "file": "static/js/map.CsK82nE3.js", + "name": "map", + "imports": [ + "_toString.tRXNBxtF.js", + "__baseEach.PLhpSRgM.js", + "__baseMap.OhVc4KF-.js" + ] + }, + "_merge.CkO-ckia.js": { + "file": "static/js/merge.CkO-ckia.js", + "name": "merge", + "imports": [ + "_isSymbol.CmW3dkoN.js", + "_toString.tRXNBxtF.js", + "__isIterateeCall.BUStsXAd.js", + "_isArrayLike.Crw2F5li.js", + "_isArrayLikeObject.B3Zf3PTL.js", + "__baseClone.Bcnb-YL-.js" + ] + }, + "_mermaid-parser.core.CrKH_ZR4.js": { + "file": "static/js/mermaid-parser.core.CrKH_ZR4.js", + "name": "mermaid-parser.core", + "imports": [ + "_preload-helper.HclGiUj8.js", + "_chunk-KEIR6QF5.Dj-OpFgW.js", + "_chunk-MOZMSUNE.EeATBuYk.js", + "_chunk-OSBZ3O6U._N6nOv0n.js", + "_chunk-5JV3BV7I.DJesgnfK.js", + "_chunk-CYSBUYHQ.Bo3-8CRa.js", + "_chunk-BIQX33UG.B4NE4TKF.js", + "_chunk-EMLP6XTP.B17sZ-5U.js", + "_chunk-YOTPTUD7.CQZR6t9a.js", + "_chunk-QBLGF6JB.DFvVIIOP.js", + "_chunk-5TONJI2A.CazhSWpT.js", + "_chunk-5HE753X5.D2IwY2Hs.js", + "_chunk-U6XO7XAA.t2Sk_D5L.js", + "_chunk-JG7HCLWE.2vZbAraA.js", + "_chunk-CQNSW5MT.CwsHPlpw.js", + "_chunk-R7FJI6CG.DpWbzOcb.js", + "_chunk-5FCAYU7R.C_m-TPOx.js" + ], + "dynamicImports": [ + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-DKCQHKI2.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-7NZHBO7P.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-RZYD4A2V.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treeView-QDETBFTQ.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/architecture-TIHT7OUA.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/gitGraph-TEB2WS4Q.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/eventmodeling-45OFAUF4.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-I7S5WNFK.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/railroad-3IZDKUUU.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/railroad-ebnf-EBAXGLYW.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/railroad-abnf-AHOZXSZD.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/railroad-peg-LSFZ7HO6.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-6X3UGDF4.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-OPB4EBWU.mjs", + "../node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/cynefin-VYW2F7L2.mjs" + ] + }, + "_moment.CaJaEtMO.js": { + "file": "static/js/moment.CaJaEtMO.js", + "name": "moment", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "_now.BzMxC3T_.js": { + "file": "static/js/now.BzMxC3T_.js", + "name": "now", + "imports": [ + "_isSymbol.CmW3dkoN.js" + ] + }, + "_numbro.-0LqK-W4.js": { + "file": "static/js/numbro.-0LqK-W4.js", + "name": "numbro" + }, + "_objectWithoutPropertiesLoose.DkqnLJVA.js": { + "file": "static/js/objectWithoutPropertiesLoose.DkqnLJVA.js", + "name": "objectWithoutPropertiesLoose" + }, + "_ordinal.CVZABass.js": { + "file": "static/js/ordinal.CVZABass.js", + "name": "ordinal", + "imports": [ + "_init.Cs1-1e_z.js" + ] + }, + "_pandasStylerUtils.CpHtlemx.js": { + "file": "static/js/pandasStylerUtils.CpHtlemx.js", + "name": "pandasStylerUtils", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_loglevel.BJBYxGId.js", + "_utils.94RcZhG4.js", + "_types.cZoyy9Y-.js", + "_toString.tRXNBxtF.js", + "__isIterateeCall.BUStsXAd.js", + "__baseIndexOf.CYLdY-L6.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "__hasUnicode.Cp9Achgk.js", + "_range.DL19EGGd.js", + "_unzip.BaBcYNJz.js", + "_recordbatch.BmKVw6jF.js", + "_serialization.yxLiAHgz.js", + "_moment.CaJaEtMO.js", + "_numbro.-0LqK-W4.js" + ] + }, + "_path.C6YKSwkP.js": { + "file": "static/js/path.C6YKSwkP.js", + "name": "path" + }, + "_path.DK9UMQdM.js": { + "file": "static/js/path.DK9UMQdM.js", + "name": "path", + "imports": [ + "_path.C6YKSwkP.js" + ] + }, + "_pick.CbtWtxHL.js": { + "file": "static/js/pick.CbtWtxHL.js", + "name": "pick", + "imports": [ + "_isArrayLike.Crw2F5li.js", + "_isArrayLikeObject.B3Zf3PTL.js", + "__baseClone.Bcnb-YL-.js", + "_last.DfjdtCRp.js", + "__baseEach.PLhpSRgM.js" + ] + }, + "_possibleConstructorReturn.DlxXudXd.js": { + "file": "static/js/possibleConstructorReturn.DlxXudXd.js", + "name": "possibleConstructorReturn", + "imports": [ + "_objectWithoutPropertiesLoose.DkqnLJVA.js", + "_assertThisInitialized.Cpir0pD1.js" + ] + }, + "_preload-helper.HclGiUj8.js": { + "file": "static/js/preload-helper.HclGiUj8.js", + "name": "preload-helper" + }, + "_protobuf.DC2L68b9.js": { + "file": "static/js/protobuf.DC2L68b9.js", + "name": "protobuf", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "_purify.es.sLXpNpJ5.js": { + "file": "static/js/purify.es.sLXpNpJ5.js", + "name": "purify.es" + }, + "_query-string.aaJx2e0Y.js": { + "file": "static/js/query-string.aaJx2e0Y.js", + "name": "query-string", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "_range.DL19EGGd.js": { + "file": "static/js/range.DL19EGGd.js", + "name": "range", + "imports": [ + "__isIterateeCall.BUStsXAd.js" + ] + }, + "_range.EplFIxc7.js": { + "file": "static/js/range.EplFIxc7.js", + "name": "range" + }, + "_react-dom.DZwq-Xzd.js": { + "file": "static/js/react-dom.DZwq-Xzd.js", + "name": "react-dom", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_reactJsonViewCompat.nQHHQTSK.js": { + "file": "static/js/reactJsonViewCompat.nQHHQTSK.js", + "name": "reactJsonViewCompat", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_resolveDefaultExport.DJbX7TqQ.js" + ] + }, + "_recordbatch.BmKVw6jF.js": { + "file": "static/js/recordbatch.BmKVw6jF.js", + "name": "recordbatch", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_tslib.es6.DWZnz9P1.js" + ] + }, + "_resolveDefaultExport.DJbX7TqQ.js": { + "file": "static/js/resolveDefaultExport.DJbX7TqQ.js", + "name": "resolveDefaultExport" + }, + "_rolldown-runtime.DAXXjFlN.js": { + "file": "static/js/rolldown-runtime.DAXXjFlN.js", + "name": "rolldown-runtime" + }, + "_rough.esm.CSKSodPl.js": { + "file": "static/js/rough.esm.CSKSodPl.js", + "name": "rough.esm" + }, + "_serialization.yxLiAHgz.js": { + "file": "static/js/serialization.yxLiAHgz.js", + "name": "serialization", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_tslib.es6.DWZnz9P1.js", + "_recordbatch.BmKVw6jF.js" + ] + }, + "_shim.Bu3ywy0h.js": { + "file": "static/js/shim.Bu3ywy0h.js", + "name": "shim", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_slicedToArray.624-tfZX.js": { + "file": "static/js/slicedToArray.624-tfZX.js", + "name": "slicedToArray", + "imports": [ + "_possibleConstructorReturn.DlxXudXd.js" + ] + }, + "_sortBy.BN5z75-Y.js": { + "file": "static/js/sortBy.BN5z75-Y.js", + "name": "sortBy", + "imports": [ + "_isSymbol.CmW3dkoN.js", + "_toString.tRXNBxtF.js", + "__isIterateeCall.BUStsXAd.js", + "_isArrayLikeObject.B3Zf3PTL.js", + "__baseFlatten.IOj0lc7G.js", + "__baseEach.PLhpSRgM.js", + "__baseMap.OhVc4KF-.js" + ] + }, + "_space-separated-tokens.BCngOmQZ.js": { + "file": "static/js/space-separated-tokens.BCngOmQZ.js", + "name": "space-separated-tokens", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "_sprintfjs.gMlXBjFJ.js": { + "file": "static/js/sprintfjs.gMlXBjFJ.js", + "name": "sprintfjs", + "imports": [ + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js" + ] + }, + "_src.BygSYTzs.js": { + "file": "static/js/src.BygSYTzs.js", + "name": "src", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_src.CE7XIH0z.js", + "_chunk-Y2CYZVJY.DsF7k-Jl.js" + ] + }, + "_src.CE7XIH0z.js": { + "file": "static/js/src.CE7XIH0z.js", + "name": "src", + "imports": [ + "_string.2gFcx07-.js", + "_timer.BMV81txb.js" + ] + }, + "_src.ChOBTULJ.js": { + "file": "static/js/src.ChOBTULJ.js", + "name": "src", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_protobuf.DC2L68b9.js" + ] + }, + "_string.2gFcx07-.js": { + "file": "static/js/string.2gFcx07-.js", + "name": "string" + }, + "_styled-components.B5oT30oI.js": { + "file": "static/js/styled-components.B5oT30oI.js", + "name": "styled-components", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_getColors.DtAxY2Hd.js", + "_Tooltip.PNC8NIZa.js", + "_useFocusRing.C8atAWyK.js", + "_SelectionIndicator.rChpdeaI.js", + "_useToggleState.DJlTB6nZ.js", + "_FocusScope.0TQQ9LKf.js" + ] + }, + "_styled-components.BwagcMZe.js": { + "file": "static/js/styled-components.BwagcMZe.js", + "name": "styled-components", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_getColors.DtAxY2Hd.js", + "_Tooltip.PNC8NIZa.js", + "_useFocusRing.C8atAWyK.js", + "_usePress.C0FRp5XM.js", + "_VisuallyHidden.8TzBGVb_.js", + "_useFormValidation.CZGpvO3z.js", + "_useFormReset.Chklfqrk.js", + "_useSlot.CBG0sVdI.js", + "_useToggleState.DJlTB6nZ.js" + ] + }, + "_styled-components.BxoGPtnX.js": { + "file": "static/js/styled-components.BxoGPtnX.js", + "name": "styled-components", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_chevron-down.gANryksn.js", + "_styled-components.D0lsbQYu.js" + ] + }, + "_styled-components.CuxloOeN.js": { + "file": "static/js/styled-components.CuxloOeN.js", + "name": "styled-components", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_merge.CkO-ckia.js", + "_getColors.DtAxY2Hd.js", + "_linear.CR3348bP.js", + "_ordinal.CVZABass.js", + "_time.C6xaHmap.js", + "_range.EplFIxc7.js", + "_defaultLocale.DAnyU4o_.js", + "_path.C6YKSwkP.js", + "_init.Cs1-1e_z.js", + "_string.2gFcx07-.js", + "_value.D6n4OHqi.js", + "_timer.BMV81txb.js", + "_threshold.BuzS4kmB.js", + "_colors.Cg5Vh3br.js", + "_treemap.BfjIY-m6.js" + ] + }, + "_styled-components.D0lsbQYu.js": { + "file": "static/js/styled-components.D0lsbQYu.js", + "name": "styled-components", + "imports": [ + "_emotion-styled.browser.esm.DsRKNFfx.js" + ] + }, + "_styled-components.Dvviq2B_.js": { + "file": "static/js/styled-components.Dvviq2B_.js", + "name": "styled-components", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_getColors.DtAxY2Hd.js", + "_src.ChOBTULJ.js" + ] + }, + "_styled-components.jxsKpeRi.js": { + "file": "static/js/styled-components.jxsKpeRi.js", + "name": "styled-components", + "imports": [ + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js" + ] + }, + "_textSelection.CRrpnEtY.js": { + "file": "static/js/textSelection.CRrpnEtY.js", + "name": "textSelection", + "imports": [ + "_Tooltip.PNC8NIZa.js", + "_useFocusRing.C8atAWyK.js" + ] + }, + "_threshold.BuzS4kmB.js": { + "file": "static/js/threshold.BuzS4kmB.js", + "name": "threshold", + "imports": [ + "_linear.CR3348bP.js", + "_init.Cs1-1e_z.js" + ] + }, + "_time.C6xaHmap.js": { + "file": "static/js/time.C6xaHmap.js", + "name": "time", + "imports": [ + "_linear.CR3348bP.js", + "_init.Cs1-1e_z.js", + "_string.2gFcx07-.js" + ] + }, + "_timepicker.Waqmgzcy.js": { + "file": "static/js/timepicker.Waqmgzcy.js", + "name": "timepicker", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_utils.94RcZhG4.js", + "_objectWithoutPropertiesLoose.DkqnLJVA.js", + "_possibleConstructorReturn.DlxXudXd.js", + "_assertThisInitialized.Cpir0pD1.js", + "_createSuper.CUU0SpoM.js", + "_chevron-down.gANryksn.js" + ] + }, + "_timer.BMV81txb.js": { + "file": "static/js/timer.BMV81txb.js", + "name": "timer", + "imports": [ + "_string.2gFcx07-.js" + ] + }, + "_toConsumableArray.BxvvZSIl.js": { + "file": "static/js/toConsumableArray.BxvvZSIl.js", + "name": "toConsumableArray", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_index.esm.DCRlH4DP.js", + "_possibleConstructorReturn.DlxXudXd.js" + ] + }, + "_toString.tRXNBxtF.js": { + "file": "static/js/toString.tRXNBxtF.js", + "name": "toString", + "imports": [ + "_isSymbol.CmW3dkoN.js" + ] + }, + "_toastQueue.CEO36h9N.js": { + "file": "static/js/toastQueue.CEO36h9N.js", + "name": "toastQueue", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_shim.Bu3ywy0h.js" + ] + }, + "_treemap.BfjIY-m6.js": { + "file": "static/js/treemap.BfjIY-m6.js", + "name": "treemap" + }, + "_tslib.es6.DWZnz9P1.js": { + "file": "static/js/tslib.es6.DWZnz9P1.js", + "name": "tslib.es6" + }, + "_types.cZoyy9Y-.js": { + "file": "static/js/types.cZoyy9Y-.js", + "name": "types" + }, + "_unzip.BaBcYNJz.js": { + "file": "static/js/unzip.BaBcYNJz.js", + "name": "unzip", + "imports": [ + "_toString.tRXNBxtF.js", + "_isArrayLikeObject.B3Zf3PTL.js", + "__baseProperty.BV6HSwpm.js" + ] + }, + "_uri.UNMuXGg5.js": { + "file": "static/js/uri.UNMuXGg5.js", + "name": "uri" + }, + "_urls.B0fCYwet.js": { + "file": "static/js/urls.B0fCYwet.js", + "name": "urls" + }, + "_useBasicWidgetState.CpWukz_T.js": { + "file": "static/js/useBasicWidgetState.CpWukz_T.js", + "name": "useBasicWidgetState", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_types.cZoyy9Y-.js", + "_FormClearHelper.D0Yt6KG5.js" + ] + }, + "_useCalculatedDimensions.BnLCBgVi.js": { + "file": "static/js/useCalculatedDimensions.BnLCBgVi.js", + "name": "useCalculatedDimensions", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_useResizeObserver.C0ES3go_.js" + ] + }, + "_useCollection.CEK9PDaH.js": { + "file": "static/js/useCollection.CEK9PDaH.js", + "name": "useCollection", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_react-dom.DZwq-Xzd.js", + "_Tooltip.PNC8NIZa.js", + "_useFocusRing.C8atAWyK.js", + "_Hidden.Bpblr2PM.js", + "_shim.Bu3ywy0h.js", + "_usePress.C0FRp5XM.js", + "_FocusScope.0TQQ9LKf.js" + ] + }, + "_useCopyToClipboard.31Hpj0n3.js": { + "file": "static/js/useCopyToClipboard.31Hpj0n3.js", + "name": "useCopyToClipboard", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_loglevel.BJBYxGId.js", + "_useTimeout.CUauXJkz.js" + ] + }, + "_useCrossOriginAttribute.DBi7mGp8.js": { + "file": "static/js/useCrossOriginAttribute.DBi7mGp8.js", + "name": "useCrossOriginAttribute", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_UriUtil.olyUCSHN.js" + ] + }, + "_useEmotionTheme.D29Ufy6b.js": { + "file": "static/js/useEmotionTheme.D29Ufy6b.js", + "name": "useEmotionTheme", + "imports": [ + "_emotion-styled.browser.esm.DsRKNFfx.js" + ] + }, + "_useExecuteWhenChanged.CJi0fna4.js": { + "file": "static/js/useExecuteWhenChanged.CJi0fna4.js", + "name": "useExecuteWhenChanged", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_useField.CLWVwWoT.js": { + "file": "static/js/useField.CLWVwWoT.js", + "name": "useField", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js", + "_useLabel.BMjZg4WL.js" + ] + }, + "_useFloatingOverlay.DlcdWSVH.js": { + "file": "static/js/useFloatingOverlay.DlcdWSVH.js", + "name": "useFloatingOverlay", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_react-dom.DZwq-Xzd.js" + ] + }, + "_useFocusRing.C8atAWyK.js": { + "file": "static/js/useFocusRing.C8atAWyK.js", + "name": "useFocusRing", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js" + ] + }, + "_useFormReset.Chklfqrk.js": { + "file": "static/js/useFormReset.Chklfqrk.js", + "name": "useFormReset", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js" + ] + }, + "_useFormValidation.CZGpvO3z.js": { + "file": "static/js/useFormValidation.CZGpvO3z.js", + "name": "useFormValidation", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js", + "_useFocusRing.C8atAWyK.js" + ] + }, + "_useIntlLocale.CiG3jZ1C.js": { + "file": "static/js/useIntlLocale.CiG3jZ1C.js", + "name": "useIntlLocale", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_react-dom.DZwq-Xzd.js", + "_utils.94RcZhG4.js", + "_chevron-down.gANryksn.js", + "_timepicker.Waqmgzcy.js" + ] + }, + "_useLabel.BMjZg4WL.js": { + "file": "static/js/useLabel.BMjZg4WL.js", + "name": "useLabel", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js" + ] + }, + "_useNumberFormatter.t6impjkR.js": { + "file": "static/js/useNumberFormatter.t6impjkR.js", + "name": "useNumberFormatter", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js" + ] + }, + "_useOverlayDismissal.DB4_ko2H.js": { + "file": "static/js/useOverlayDismissal.DB4_ko2H.js", + "name": "useOverlayDismissal", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_usePress.C0FRp5XM.js": { + "file": "static/js/usePress.C0FRp5XM.js", + "name": "usePress", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_react-dom.DZwq-Xzd.js", + "_Tooltip.PNC8NIZa.js", + "_useFocusRing.C8atAWyK.js", + "_textSelection.CRrpnEtY.js" + ] + }, + "_useRequiredContext.F4hG38Ff.js": { + "file": "static/js/useRequiredContext.F4hG38Ff.js", + "name": "useRequiredContext", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_useResizeObserver.C0ES3go_.js": { + "file": "static/js/useResizeObserver.C0ES3go_.js", + "name": "useResizeObserver", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_useTimeout.CUauXJkz.js" + ] + }, + "_useScrollbarGutterSize.B_VG1Wad.js": { + "file": "static/js/useScrollbarGutterSize.B_VG1Wad.js", + "name": "useScrollbarGutterSize", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_useSlot.CBG0sVdI.js": { + "file": "static/js/useSlot.CBG0sVdI.js", + "name": "useSlot", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js" + ] + }, + "_useTextField.BYQ8oAlv.js": { + "file": "static/js/useTextField.BYQ8oAlv.js", + "name": "useTextField", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js", + "_useFocusRing.C8atAWyK.js", + "_Hidden.Bpblr2PM.js", + "_useField.CLWVwWoT.js", + "_useFormValidation.CZGpvO3z.js", + "_useFormReset.Chklfqrk.js" + ] + }, + "_useTextInputAutoExpand.By9qSO8B.js": { + "file": "static/js/useTextInputAutoExpand.By9qSO8B.js", + "name": "useTextInputAutoExpand", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_useEmotionTheme.D29Ufy6b.js", + "_src.ChOBTULJ.js" + ] + }, + "_useTimeout.CUauXJkz.js": { + "file": "static/js/useTimeout.CUauXJkz.js", + "name": "useTimeout", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js" + ] + }, + "_useToggleState.DJlTB6nZ.js": { + "file": "static/js/useToggleState.DJlTB6nZ.js", + "name": "useToggleState", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_Tooltip.PNC8NIZa.js" + ] + }, + "_useUpdateUiValue.9IVpZphL.js": { + "file": "static/js/useUpdateUiValue.9IVpZphL.js", + "name": "useUpdateUiValue", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_utils.94RcZhG4.js", + "_inputUtils.CD44xxT-.js" + ] + }, + "_useWaveformController.By203ydw.js": { + "file": "static/js/useWaveformController.By203ydw.js", + "name": "useWaveformController", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_utils.94RcZhG4.js", + "_useEmotionTheme.D29Ufy6b.js", + "_preload-helper.HclGiUj8.js" + ], + "dynamicImports": [ + "../node_modules/wavesurfer.js/dist/wavesurfer.esm.js", + "../node_modules/wavesurfer.js/dist/plugins/record.js" + ] + }, + "_useWidgetManagerElementState.CbF0sesb.js": { + "file": "static/js/useWidgetManagerElementState.CbF0sesb.js", + "name": "useWidgetManagerElementState", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_types.cZoyy9Y-.js", + "_FormClearHelper.D0Yt6KG5.js" + ] + }, + "_useWindowDimensionsContext.HIxtcWyF.js": { + "file": "static/js/useWindowDimensionsContext.HIxtcWyF.js", + "name": "useWindowDimensionsContext", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_useRequiredContext.F4hG38Ff.js" + ] + }, + "_util.D5poj9OK.js": { + "file": "static/js/util.D5poj9OK.js", + "name": "util", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_preload-helper.HclGiUj8.js" + ], + "dynamicImports": [ + "../node_modules/native-file-system-adapter/src/adapters/memory.js", + "../node_modules/native-file-system-adapter/src/adapters/sandbox.js", + "../node_modules/native-file-system-adapter/src/FileSystemDirectoryHandle.js", + "../node_modules/native-file-system-adapter/src/FileSystemFileHandle.js" + ] + }, + "_utils.94RcZhG4.js": { + "file": "static/js/utils.94RcZhG4.js", + "name": "utils", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_react-dom.DZwq-Xzd.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_isArrayLike.Crw2F5li.js", + "_merge.CkO-ckia.js", + "_isArrayLikeObject.B3Zf3PTL.js", + "_getColors.DtAxY2Hd.js" + ] + }, + "_utils.BrY_0PXX.js": { + "file": "static/js/utils.BrY_0PXX.js", + "name": "utils", + "imports": [ + "_protobuf.DC2L68b9.js" + ] + }, + "_utils.Ca1sxtey.js": { + "file": "static/js/utils.Ca1sxtey.js", + "name": "utils", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_utils.94RcZhG4.js", + "_types.cZoyy9Y-.js", + "_getColors.DtAxY2Hd.js", + "_Icon.RiOK8SDN.js", + "_DynamicIcon.44zobID_.js", + "_Tooltip.PNC8NIZa.js", + "_styled-components.B5oT30oI.js", + "_BaseButton.DzUQ5vsa.js", + "_index.esm.DCRlH4DP.js", + "_ErrorOutline.esm.CZ5wypOV.js", + "_TableChart.esm.Bm7WHa8s.js", + "_Cancel.esm.CTWwYXdL.js", + "_tslib.es6.DWZnz9P1.js", + "_UploadFileInfo.WAP1L8Dh.js" + ] + }, + "_v4.DDdyfk2q.js": { + "file": "static/js/v4.DDdyfk2q.js", + "name": "v4" + }, + "_value.D6n4OHqi.js": { + "file": "static/js/value.D6n4OHqi.js", + "name": "value", + "imports": [ + "_string.2gFcx07-.js" + ] + }, + "_web-namespaces.BxZ_GhEx.js": { + "file": "static/js/web-namespaces.BxZ_GhEx.js", + "name": "web-namespaces" + }, + "_webgl-device.7mKl-kgB.js": { + "file": "static/js/webgl-device.7mKl-kgB.js", + "name": "webgl-device", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js" + ] + }, + "_withCalculatedWidth.DClbrdOz.js": { + "file": "static/js/withCalculatedWidth.DClbrdOz.js", + "name": "withCalculatedWidth", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_Tooltip.PNC8NIZa.js", + "_useCalculatedDimensions.BnLCBgVi.js" + ] + }, + "_withFullScreenWrapper.DjqP6oFO.js": { + "file": "static/js/withFullScreenWrapper.DjqP6oFO.js", + "name": "withFullScreenWrapper", + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_useEmotionTheme.D29Ufy6b.js", + "_useCalculatedDimensions.BnLCBgVi.js", + "_ViewStateContext.C6Nfqh3k.js", + "_useWindowDimensionsContext.HIxtcWyF.js" + ] + }, + "_zip.DLtjLZjW.js": { + "file": "static/js/zip.DLtjLZjW.js", + "name": "zip", + "imports": [ + "_isArrayLikeObject.B3Zf3PTL.js", + "_unzip.BaBcYNJz.js" + ] + }, + "index.html": { + "file": "static/js/index.BvGIeCyC.js", + "name": "index", + "src": "index.html", + "isEntry": true, + "imports": [ + "_rolldown-runtime.DAXXjFlN.js", + "_emotion-is-prop-valid.esm.CygBv61C.js", + "_emotion-styled.browser.esm.DsRKNFfx.js", + "_loglevel.BJBYxGId.js", + "_react-dom.DZwq-Xzd.js", + "_utils.94RcZhG4.js", + "_emotion-react.browser.esm.B06RJmME.js", + "_protobuf.DC2L68b9.js", + "_types.cZoyy9Y-.js", + "_uri.UNMuXGg5.js", + "_toString.tRXNBxtF.js", + "__baseClone.Bcnb-YL-.js", + "_StreamlitMarkdown.DJLoxxnS.js", + "__baseEach.PLhpSRgM.js", + "_isEqual.CgNOpGTC.js", + "_pick.CbtWtxHL.js", + "_getColors.DtAxY2Hd.js", + "_classnames.B69Vzagp.js", + "_utils.BrY_0PXX.js", + "_lib.CzPO8p6E.js", + "_Close.esm.DiV9yyug.js", + "_Icon.RiOK8SDN.js", + "_DynamicIcon.44zobID_.js", + "_UriUtil.olyUCSHN.js", + "_useCrossOriginAttribute.DBi7mGp8.js", + "_useEmotionTheme.D29Ufy6b.js", + "_Tooltip.PNC8NIZa.js", + "_useCollection.CEK9PDaH.js", + "_useFocusRing.C8atAWyK.js", + "_useLabel.BMjZg4WL.js", + "_KeyboardArrowDown.esm.Duf7utJJ.js", + "_Hidden.Bpblr2PM.js", + "_shim.Bu3ywy0h.js", + "_SelectionIndicator.rChpdeaI.js", + "_Text.CGzIOlkG.js", + "_styled-components.BwagcMZe.js", + "_FocusScope.0TQQ9LKf.js", + "_toastQueue.CEO36h9N.js", + "_styled-components.B5oT30oI.js", + "_BaseButton.DzUQ5vsa.js", + "_ErrorElement.BWmlOcKX.js", + "_useFloatingOverlay.DlcdWSVH.js", + "_preload-helper.HclGiUj8.js", + "_useExecuteWhenChanged.CJi0fna4.js", + "_useWidgetManagerElementState.CbF0sesb.js", + "_useTimeout.CUauXJkz.js", + "_BaseButtonTooltip.DyFZqtoX.js", + "_DynamicButtonLabel.UT8nPWDL.js", + "_useResizeObserver.C0ES3go_.js", + "_useCalculatedDimensions.BnLCBgVi.js", + "_objectWithoutPropertiesLoose.DkqnLJVA.js", + "_index.esm.DCRlH4DP.js", + "_FormsContext.Dt-mNfG5.js", + "_AlertElement.BAyMiYwt.js", + "_useCopyToClipboard.31Hpj0n3.js", + "_katex.min.BDrowdx1.js", + "_useRequiredContext.F4hG38Ff.js", + "_ViewStateContext.C6Nfqh3k.js", + "_styled-components.Dvviq2B_.js", + "_NavigationContext.CaL318Cx.js", + "_PortalContext.BUXYSLQA.js", + "_CodeBlockCopyToolbar.D57Zh6DT.js", + "_isMobile.ZOwND-6T.js", + "_useWindowDimensionsContext.HIxtcWyF.js", + "_v4.DDdyfk2q.js", + "_useOverlayDismissal.DB4_ko2H.js", + "_useScrollbarGutterSize.B_VG1Wad.js", + "_ErrorHandling.H5STbbYb.js", + "_ResizeObserver.es.CdkJ1I5V.js", + "_query-string.aaJx2e0Y.js", + "_src.ChOBTULJ.js", + "_slicedToArray.624-tfZX.js", + "_possibleConstructorReturn.DlxXudXd.js", + "_createSuper.CUU0SpoM.js", + "_es2015.HS3QcJYh.js" + ], + "dynamicImports": [ + "../lib/src/components/elements/Table/Table.tsx", + "../lib/src/components/elements/ArrowVegaLiteChart/ArrowVegaLiteChart.tsx", + "../lib/src/components/elements/Audio/Audio.tsx", + "../lib/src/components/elements/Balloons/Balloons.tsx", + "../lib/src/components/elements/DeckGlJsonChart/DeckGlJsonChart.tsx", + "../lib/src/components/elements/GraphVizChart/GraphVizChart.tsx", + "../lib/src/components/elements/Html/Html.tsx", + "../lib/src/components/elements/IFrame/IFrame.tsx", + "../lib/src/components/elements/ImageList/ImageList.tsx", + "../lib/src/components/elements/Json/Json.tsx", + "../lib/src/components/elements/LinkButton/LinkButton.tsx", + "../lib/src/components/elements/Metric/Metric.tsx", + "../lib/src/components/elements/PageLink/PageLink.tsx", + "../lib/src/components/elements/PlotlyChart/PlotlyChart.tsx", + "../lib/src/components/elements/Progress/Progress.tsx", + "../lib/src/components/elements/Snow/Snow.tsx", + "../lib/src/components/elements/Spinner/Spinner.tsx", + "../lib/src/components/elements/CodeBlock/StreamlitSyntaxHighlighter.tsx", + "../lib/src/components/elements/Toast/Toast.tsx", + "../lib/src/components/elements/Video/Video.tsx", + "../lib/src/components/widgets/AudioInput/AudioInput.tsx", + "_DataFrame.Wny8mRut.js", + "../lib/src/components/widgets/Button/Button.tsx", + "../lib/src/components/widgets/ButtonGroup/ButtonGroup.tsx", + "../lib/src/components/widgets/CustomComponent/ComponentInstance.tsx", + "../lib/src/components/widgets/CameraInput/CameraInput.tsx", + "../lib/src/components/widgets/ChatInput/ChatInput.tsx", + "../lib/src/components/widgets/Checkbox/Checkbox.tsx", + "../lib/src/components/widgets/ColorPicker/ColorPicker.tsx", + "../lib/src/components/widgets/DateInput/DateInput.tsx", + "../lib/src/components/widgets/DateTimeInput/DateTimeInput.tsx", + "../lib/src/components/widgets/DownloadButton/DownloadButton.tsx", + "../lib/src/components/widgets/Feedback/Feedback.tsx", + "../lib/src/components/widgets/FileUploader/FileUploader.tsx", + "../lib/src/components/widgets/Form/FormSubmitContent.tsx", + "../lib/src/components/widgets/Multiselect/Multiselect.tsx", + "../lib/src/components/widgets/MenuButton/MenuButton.tsx", + "../lib/src/components/widgets/NumberInput/NumberInput.tsx", + "../lib/src/components/widgets/Pagination/Pagination.tsx", + "../lib/src/components/widgets/Radio/Radio.tsx", + "../lib/src/components/widgets/Selectbox/Selectbox.tsx", + "../lib/src/components/widgets/Slider/Slider.tsx", + "../lib/src/components/widgets/TextArea/TextArea.tsx", + "../lib/src/components/widgets/TextInput/TextInput.tsx", + "../lib/src/components/widgets/TimeInput/TimeInput.tsx", + "../lib/src/components/widgets/BidiComponent/BidiComponent.tsx", + "../node_modules/node-emoji/lib/index.js", + "../node_modules/axios/index.js", + "../node_modules/iframe-resizer/js/iframeResizer.contentWindow.js" + ], + "css": [ + "static/css/index.C4kyYqWK.css" + ], + "assets": [ + "static/media/fireworks.B4d-_KUe.gif", + "static/media/snowflake.JU2jBHL8.svg", + "static/media/SourceCodeVF-Upright.ttf.BjWn63N-.woff2", + "static/media/SourceCodeVF-Italic.ttf.Ba1oaZG1.woff2", + "static/media/SourceSansVF-Upright.ttf.BsWL4Kly.woff2", + "static/media/SourceSansVF-Italic.ttf.Bt9VkdQ3.woff2", + "static/media/SourceSerifVariable-Roman.ttf.mdpVL9bi.woff2", + "static/media/SourceSerifVariable-Italic.ttf.CVdzAtxO.woff2", + "static/media/MaterialSymbols-Rounded.1hm6dVzH.woff2" + ] + }, + "src/assets/fonts/MaterialSymbols/MaterialSymbols-Rounded.woff2": { + "file": "static/media/MaterialSymbols-Rounded.1hm6dVzH.woff2", + "src": "src/assets/fonts/MaterialSymbols/MaterialSymbols-Rounded.woff2" + }, + "src/assets/fonts/Source_Code/SourceCodeVF-Italic.ttf.woff2": { + "file": "static/media/SourceCodeVF-Italic.ttf.Ba1oaZG1.woff2", + "src": "src/assets/fonts/Source_Code/SourceCodeVF-Italic.ttf.woff2" + }, + "src/assets/fonts/Source_Code/SourceCodeVF-Upright.ttf.woff2": { + "file": "static/media/SourceCodeVF-Upright.ttf.BjWn63N-.woff2", + "src": "src/assets/fonts/Source_Code/SourceCodeVF-Upright.ttf.woff2" + }, + "src/assets/fonts/Source_Sans/SourceSansVF-Italic.ttf.woff2": { + "file": "static/media/SourceSansVF-Italic.ttf.Bt9VkdQ3.woff2", + "src": "src/assets/fonts/Source_Sans/SourceSansVF-Italic.ttf.woff2" + }, + "src/assets/fonts/Source_Sans/SourceSansVF-Upright.ttf.woff2": { + "file": "static/media/SourceSansVF-Upright.ttf.BsWL4Kly.woff2", + "src": "src/assets/fonts/Source_Sans/SourceSansVF-Upright.ttf.woff2" + }, + "src/assets/fonts/Source_Serif/SourceSerifVariable-Italic.ttf.woff2": { + "file": "static/media/SourceSerifVariable-Italic.ttf.CVdzAtxO.woff2", + "src": "src/assets/fonts/Source_Serif/SourceSerifVariable-Italic.ttf.woff2" + }, + "src/assets/fonts/Source_Serif/SourceSerifVariable-Roman.ttf.woff2": { + "file": "static/media/SourceSerifVariable-Roman.ttf.mdpVL9bi.woff2", + "src": "src/assets/fonts/Source_Serif/SourceSerifVariable-Roman.ttf.woff2" + }, + "src/assets/img/fireworks.gif": { + "file": "static/media/fireworks.B4d-_KUe.gif", + "src": "src/assets/img/fireworks.gif" + }, + "src/assets/svg/snowflake.svg": { + "file": "static/media/snowflake.JU2jBHL8.svg", + "src": "src/assets/svg/snowflake.svg" + } +} \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/css/DataFrame.DUkanX9_.css b/venv/Lib/site-packages/streamlit/static/static/css/DataFrame.DUkanX9_.css new file mode 100644 index 0000000000000000000000000000000000000000..521a1b63603e707664117362ff8d5148ea74415a --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/css/DataFrame.DUkanX9_.css @@ -0,0 +1 @@ +.gdg-r17m35ur{background-color:var(--gdg-bg-header-has-focus);box-shadow:0 0 0 1px var(--gdg-border-color);color:var(--gdg-text-group-header);min-height:var(--r17m35ur-0);font:var(--gdg-header-font-style) var(--gdg-font-family);border:none;border-radius:9px;outline:none;flex-grow:1;padding:0 8px}.gdg-c1tqibwd{background-color:var(--gdg-bg-header);align-items:center;padding:0 8px;display:flex}.gdg-s1dgczr6 .dvn-scroller{overflow:var(--s1dgczr6-0);transform:translate(0,0)}.gdg-s1dgczr6 .dvn-hidden{visibility:hidden}.gdg-s1dgczr6 .dvn-scroll-inner{pointer-events:none;display:flex}.gdg-s1dgczr6 .dvn-scroll-inner>*{flex-shrink:0}.gdg-s1dgczr6 .dvn-scroll-inner .dvn-spacer{flex-grow:1}.gdg-s1dgczr6 .dvn-scroll-inner .dvn-stack{flex-direction:column;display:flex}.gdg-s1dgczr6 .dvn-underlay>*{position:absolute;top:0;left:0}.gdg-s1dgczr6 canvas{outline:none}.gdg-s1dgczr6 canvas *{height:0}.gdg-wmyidgi{min-width:10px;max-width:100%;min-height:10px;max-height:100%;width:var(--wmyidgi-0);height:var(--wmyidgi-1);direction:ltr;position:relative;overflow:clip}.gdg-wmyidgi>:first-child{width:100%;height:100%;position:absolute;top:0;left:0}.gdg-b1ygi5by{flex-wrap:wrap;margin-top:auto;margin-bottom:auto;display:flex;overflow:auto}.gdg-b1ygi5by .boe-bubble{border-radius:var(--gdg-rounding-radius,calc(var(--gdg-bubble-height) / 2));padding:0 var(--gdg-bubble-padding);height:var(--gdg-bubble-height);background-color:var(--gdg-bg-bubble);color:var(--gdg-text-dark);margin:var(--gdg-bubble-margin);white-space:nowrap;justify-content:center;align-items:center;display:flex}.gdg-b1ygi5by textarea{opacity:0;width:0;height:0;position:absolute;top:0;left:0}.gdg-u1rrojo{flex-grow:1;align-items:center;min-height:21px;display:flex}.gdg-u1rrojo .gdg-link-area{cursor:pointer;text-overflow:ellipsis;white-space:nowrap;color:var(--gdg-link-color);flex-grow:1;flex-shrink:1;margin-right:8px;overflow:hidden;text-decoration:underline!important}.gdg-u1rrojo .gdg-edit-icon{width:32px;color:var(--gdg-accent-color);cursor:pointer;flex-shrink:0;justify-content:center;align-items:center;display:flex}.gdg-u1rrojo .gdg-edit-icon>*{width:24px;height:24px}.gdg-u1rrojo textarea{opacity:0;width:0;height:0;position:absolute;top:0;left:0}.gdg-m1pnx84e{min-width:var(--m1pnx84e-0);width:100%;color:var(--gdg-text-dark);justify-content:space-between;align-items:flex-start;display:flex;position:relative}.gdg-m1pnx84e .gdg-g1y0xocz{flex-shrink:1;min-width:0}.gdg-m1pnx84e .gdg-spacer{flex:1}.gdg-m1pnx84e .gdg-edit-icon{cursor:pointer;color:var(--gdg-accent-color);width:24px;height:24px;transition:all "0.125s ease";border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:flex;position:relative}.gdg-m1pnx84e .gdg-edit-icon>*{width:16px;height:16px}.gdg-m1pnx84e .gdg-edit-hover :hover{background-color:var(--gdg-accent-light);transition:background-color .15s}.gdg-m1pnx84e .gdg-checkmark-hover :hover{color:#fff;background-color:var(--gdg-accent-color)}.gdg-m1pnx84e .gdg-md-edit-textarea{opacity:0;width:0;height:0;margin-top:25px;padding:0;position:relative;top:0;left:0}.gdg-m1pnx84e .gdg-ml-6{margin-left:6px}.gdg-d4zsq0x{flex-wrap:wrap;display:flex}.gdg-d4zsq0x .doe-bubble{background-color:var(--gdg-bg-cell);height:24px;color:var(--gdg-text-dark);border-radius:var(--gdg-rounding-radius,6px);justify-content:center;align-items:center;margin:2px;padding:0 8px;display:flex;box-shadow:0 0 1px #3e415666,0 1px 3px #3e415666}.gdg-d4zsq0x .doe-bubble img{object-fit:contain;height:16px;margin-right:4px}.gdg-d4zsq0x textarea{opacity:0;width:0;height:0;position:absolute;top:0;left:0}.gdg-i2iowwq{height:100%;display:flex}.gdg-i2iowwq .gdg-centering-container{justify-content:center;align-items:center;height:100%;display:flex}.gdg-i2iowwq .gdg-centering-container img,.gdg-i2iowwq .gdg-centering-container canvas{max-height:calc(100vh - var(--overlay-top) - 20px);object-fit:contain;-webkit-user-select:none;user-select:none}.gdg-i2iowwq .gdg-centering-container canvas{max-width:380px}.gdg-i2iowwq .gdg-edit-icon{width:48px;height:48px;color:var(--gdg-accent-color);cursor:pointer;justify-content:center;align-items:center;display:flex;position:absolute;top:12px;right:0}.gdg-i2iowwq .gdg-edit-icon>*{width:24px;height:24px}.gdg-i2iowwq textarea{opacity:0;width:0;height:0;position:absolute;top:0;left:0}.gdg-n15fjm3e{color:var(--gdg-text-dark);margin:6px 0 3px;display:flex}.gdg-n15fjm3e>input{font-size:var(--gdg-editor-font-size);font-family:var(--gdg-font-family);color:var(--gdg-text-dark);background-color:var(--gdg-bg-cell);padding:0}.gdg-d19meir1{box-sizing:border-box;--overlay-top:var(--d19meir1-0);left:var(--d19meir1-1);top:var(--d19meir1-0);min-width:var(--d19meir1-2);min-height:var(--d19meir1-3);width:max-content;max-width:400px;max-height:calc(100vh - var(--d19meir1-4));font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);text-align:start;flex-direction:column;display:flex;position:absolute;overflow:hidden}@keyframes glide_fade_in-gdg-d19meir1{0%{opacity:0}to{opacity:1}}.gdg-d19meir1.gdg-style{background-color:var(--gdg-bg-cell);box-shadow:0 0 0 1px var(--gdg-accent-color),0px 0px 1px #3e415666,0px 6px 12px #3e415626;border-radius:2px;animation:60ms glide_fade_in-gdg-d19meir1}.gdg-d19meir1.gdg-pad{padding:var(--d19meir1-5) 8.5px 3px}.gdg-d19meir1 .gdg-clip-region{border-radius:2px;flex-direction:column;flex-grow:1;display:flex;overflow:hidden auto}.gdg-d19meir1 .gdg-clip-region .gdg-growing-entry{height:100%}.gdg-d19meir1 .gdg-clip-region input.gdg-input{border:0;outline:none;width:100%}.gdg-d19meir1 .gdg-clip-region textarea.gdg-input{border:0;outline:none}.gdg-seveqep{background-color:var(--gdg-bg-cell);color:var(--gdg-text-dark);border:1px solid var(--gdg-border-color);font-size:var(--gdg-editor-font-size);border-radius:6px;padding:8px;animation:.15s forwards gdg-search-fadein-gdg-seveqep;position:absolute;top:4px;right:20px}.gdg-seveqep.out{animation:.15s forwards gdg-search-fadeout-gdg-seveqep}.gdg-seveqep .gdg-search-bar-inner{display:flex}.gdg-seveqep .gdg-search-status{padding-top:4px;font-size:11px}.gdg-seveqep .gdg-search-progress{background-color:var(--gdg-text-light);height:4px;position:absolute;bottom:0;left:0}.gdg-seveqep input{width:220px;color:var(--gdg-text-dark);background-color:var(--gdg-bg-cell);border:0;outline:none}.gdg-seveqep button{cursor:pointer;width:24px;height:24px;color:var(--gdg-text-medium);background:0 0;border:none;outline:none;justify-content:center;align-items:center;padding:0;display:flex}.gdg-seveqep button:hover{color:var(--gdg-text-dark)}.gdg-seveqep button .button-icon{width:16px;height:16px}.gdg-seveqep button:disabled{opacity:.4;pointer-events:none}@keyframes gdg-search-fadeout-gdg-seveqep{0%{transform:translate(0)}to{transform:translate(400px)}}@keyframes gdg-search-fadein-gdg-seveqep{0%{transform:translate(400px)}to{transform:translate(0)}}.gdg-mnuv029{word-break:break-word;-webkit-touch-callout:default;padding-top:6px}.gdg-mnuv029>*{margin:0}.gdg-mnuv029 :last-child{margin-bottom:0}.gdg-mnuv029 p img{width:100%}.gdg-izpuzkl{resize:none;white-space:pre-wrap;width:100%;min-width:100%;height:100%;font-size:var(--gdg-editor-font-size);line-height:16px;font-family:var(--gdg-font-family);-webkit-text-fill-color:var(--gdg-text-dark);color:var(--gdg-text-dark);background-color:#0000;border:0;border-radius:0;margin:0;padding:0;position:absolute;inset:0;overflow:hidden}.gdg-invalid .gdg-izpuzkl{-webkit-text-decoration:underline #d60606;text-decoration:underline #d60606}.gdg-izpuzkl ::-webkit-input-placeholder{color:var(--gdg-text-light)}.gdg-izpuzkl ::placeholder{color:var(--gdg-text-light)}.gdg-izpuzkl :-ms-placeholder-shown{color:var(--gdg-text-light)}.gdg-izpuzkl ::placeholder{color:var(--gdg-text-light)}.gdg-s69h75o{visibility:hidden;white-space:pre-wrap;word-wrap:break-word;width:max-content;min-width:100%;max-width:100%;font-size:var(--gdg-editor-font-size);line-height:16px;font-family:var(--gdg-font-family);color:var(--gdg-text-dark);margin:0;padding:0 0 2px}.gdg-g1y0xocz{margin-top:6px;position:relative}.gdg-w1hnqk7o .gdg-footer{justify-content:flex-end;padding:20px;display:flex}.gdg-w1hnqk7o .gdg-footer button{font-size:14px;font-weight:500;font-family:var(--gdg-font-family);cursor:pointer;border-radius:var(--gdg-rounding-radius,9px);border:none;padding:8px 16px}.gdg-w1hnqk7o .gdg-save-button{background-color:var(--gdg-accent-color);color:var(--gdg-accent-fg)}.gdg-w1hnqk7o .gdg-close-button{background-color:var(--gdg-bg-header);color:var(--gdg-text-medium);margin-right:8px}.gdg-e1ywxz2x{color:var(--gdg-text-light);align-items:center;padding:6px 0;display:flex}.gdg-e1ywxz2x .gdg-active{color:var(--gdg-text-dark)}.gdg-e1ywxz2x>*{cursor:pointer;width:16px;height:16px;margin-right:2px;position:relative}.gdg-e1ywxz2x>* svg{width:100%;height:100%}.gdg-s1wtovjx{min-height:26px;font-size:var(--gdg-editor-font-size);font-family:var(--gdg-font-family);color:var(--gdg-text-dark);background-color:#0000;border:none;outline:none}.gdg-s1wtovjx ::-webkit-calendar-picker-indicator{background-color:#fff}.gdg-wghi2zc{flex-direction:column;align-items:stretch;display:flex}.gdg-wghi2zc .glide-select{font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size)}.gdg-p13nj8j0{font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);color:var(--gdg-text-dark)}.gdg-p13nj8j0>div{border:1px solid var(--gdg-border-color);border-radius:4px}.gdg-r6sia3g{display:"flex";margin:auto 8.5px;padding-bottom:3px}.gdg-e1wnlokz{color:var(--gdg-text-dark);box-sizing:border-box;flex-direction:column;align-items:stretch;padding-top:6px;display:flex}.gdg-e1wnlokz *{box-sizing:border-box}.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz label{cursor:pointer;display:flex}.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz label input{cursor:pointer;width:auto}.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz label .gdg-pill{border-radius:var(--gdg-rounding-radius,var(--e1wnlokz-0));min-height:var(--e1wnlokz-1);padding:2px var(--e1wnlokz-2);font:12px var(--gdg-font-family);background-color:var(--gdg-bg-bubble);align-items:center;margin-bottom:6px;margin-left:8px;margin-right:6px;transition:box-shadow .15s;display:flex}.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz label .gdg-pill.gdg-unselected{opacity:.8}.gdg-e1wnlokz label:hover .gdg-pill{box-shadow:0 1px 4px #00000026}.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-readonly label{cursor:default}.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-readonly label .gdg-pill{box-shadow:none!important}.gdg-w1i61rz{flex-direction:column;align-items:stretch;margin-top:auto;margin-bottom:auto;display:flex}.gdg-w1i61rz .gdg-multi-select{font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size)}.gdg-phbadu4{font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);color:var(--gdg-text-dark)}.gdg-phbadu4>div{border:1px solid var(--gdg-border-color);border-radius:4px}.gdg-lw5nakc{flex-direction:column;margin:4px 0;display:flex}.gdg-lw5nakc>button{color:var(--gdg-accent-color);cursor:pointer;background-color:#0000;border:none;border-radius:4px;outline:none;align-self:flex-end;padding:6px 8px;font-weight:600;transition:background-color .2s}.gdg-lw5nakc>button:hover,.gdg-lw5nakc>button:focus-visible{background-color:var(--gdg-accent-light)}.gdg-lw5nakc>button:disabled{opacity:.4;pointer-events:none}.gdg-lw5nakc .gdg-link-title-editor{min-width:250px;display:flex}.gdg-lw5nakc .gdg-link-title-editor>input{border:1px solid var(--gdg-border-color);box-shadow:none;border-radius:4px;outline:none;flex-grow:1;width:0;min-width:0;padding:6px 8px;transition:border .2s}.gdg-lw5nakc .gdg-link-title-editor>input:not(:last-child){margin-right:4px}.gdg-lw5nakc .gdg-link-title-editor>input:focus{border:1px solid var(--gdg-accent-color)}.gdg-lw5nakc .gdg-link-title-editor:not(:last-child){margin-bottom:4px}.gdg-lw5nakc .gdg-link-title-editor>button{cursor:pointer;color:var(--gdg-text-medium);background-color:#0000;border:none;border-radius:4px;outline:none;transition:background-color .2s,color .2s}.gdg-lw5nakc .gdg-link-title-editor>button:hover,.gdg-lw5nakc .gdg-link-title-editor>button:focus-visible{background-color:var(--gdg-accent-light);color:var(--gdg-text-dark)} diff --git a/venv/Lib/site-packages/streamlit/static/static/css/DeckGlJsonChart.s6LXjV0D.css b/venv/Lib/site-packages/streamlit/static/static/css/DeckGlJsonChart.s6LXjV0D.css new file mode 100644 index 0000000000000000000000000000000000000000..75095079f77bbd65c933989ce867907dbae7116a --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/css/DeckGlJsonChart.s6LXjV0D.css @@ -0,0 +1 @@ +.mapboxgl-map{-webkit-tap-highlight-color:#0000;font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;overflow:hidden}.mapboxgl-canvas{position:absolute;top:0;left:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;z-index:2;position:absolute}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){-webkit-box-shadow:0 0 2px #0000001a;-moz-box-shadow:0 0 2px #0000001a;box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px buttontext}}.mapboxgl-ctrl-group button{box-sizing:border-box;cursor:pointer;background-color:#0000;border:0;outline:none;width:29px;height:29px;padding:0;display:block}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;width:100%;height:100%;display:block}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:#0000}.mapboxgl-ctrl-group button+button{border-top:1px solid buttontext}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-ms-animation:mapboxgl-spin 2s infinite linear;animation:2s linear infinite mapboxgl-spin}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes mapboxgl-spin{0%{-moz-transform:rotate(0)}to{-moz-transform:rotate(1turn)}}@-o-keyframes mapboxgl-spin{0%{-o-transform:rotate(0)}to{-o-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{cursor:pointer;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;width:88px;height:23px;margin:0 0 -4px -4px;display:block;overflow:hidden}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:#0000;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;min-height:20px;margin:10px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{visibility:visible;padding:2px 28px 2px 8px}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{cursor:pointer;box-sizing:border-box;background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;outline:none;width:24px;height:24px;display:none;position:absolute;top:0;right:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{margin-left:2px;font-weight:700}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{color:#333;box-sizing:border-box;background-color:#ffffffbf;border:2px solid #333;border-top:#333;padding:0 5px;font-size:10px}.mapboxgl-popup{will-change:transform;pointer-events:none;display:flex;position:absolute;top:0;left:0}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{z-index:1;border:10px solid #0000;width:0;height:0}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{border-top:none;border-bottom-color:#fff;align-self:center}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{border-top:none;border-bottom-color:#fff;border-left:none;align-self:flex-start}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{border-top:none;border-bottom-color:#fff;border-right:none;align-self:flex-end}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{border-top-color:#fff;border-bottom:none;align-self:center}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{border-top-color:#fff;border-bottom:none;border-left:none;align-self:flex-start}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{border-top-color:#fff;border-bottom:none;border-right:none;align-self:flex-end}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{border-left:none;border-right-color:#fff;align-self:center}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{border-left-color:#fff;border-right:none;align-self:center}.mapboxgl-popup-close-button{cursor:pointer;background-color:#0000;border:0;border-radius:0 3px 0 0;position:absolute;top:0;right:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{pointer-events:auto;background:#fff;border-radius:3px;padding:10px 10px 15px;position:relative;box-shadow:0 1px 2px #0000001a}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{will-change:transform;position:absolute;top:0;left:0}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;width:15px;height:15px}.mapboxgl-user-location-dot:before{content:"";-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:2s infinite mapboxgl-user-location-dot-pulse;position:absolute}.mapboxgl-user-location-dot:after{content:"";box-sizing:border-box;border:2px solid #fff;border-radius:50%;width:19px;height:19px;position:absolute;top:-2px;left:-2px;box-shadow:0 0 3px #00000059}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;-webkit-transform:scale(1)}70%{opacity:0;-webkit-transform:scale(3)}to{opacity:0;-webkit-transform:scale(1)}}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;width:1px;height:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{opacity:.5;background:#fff;border:2px dotted #202020;width:0;height:0;position:absolute;top:0;left:0}@media print{.mapbox-improve-map{display:none}} diff --git a/venv/Lib/site-packages/streamlit/static/static/css/index.C4kyYqWK.css b/venv/Lib/site-packages/streamlit/static/static/css/index.C4kyYqWK.css new file mode 100644 index 0000000000000000000000000000000000000000..017389c6bdf13a5351f8753495dc8ecbe5705515 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/css/index.C4kyYqWK.css @@ -0,0 +1 @@ +@font-face{font-family:Source Code Pro;font-weight:100 900;font-style:normal;src:url(../media/SourceCodeVF-Upright.ttf.BjWn63N-.woff2)format("woff2")}@font-face{font-family:Source Code Pro;font-weight:100 900;font-style:italic;src:url(../media/SourceCodeVF-Italic.ttf.Ba1oaZG1.woff2)format("woff2")}@font-face{font-family:Source Sans;font-weight:100 900;font-style:normal;src:url(../media/SourceSansVF-Upright.ttf.BsWL4Kly.woff2)format("woff2")}@font-face{font-family:Source Sans;font-weight:100 900;font-style:italic;src:url(../media/SourceSansVF-Italic.ttf.Bt9VkdQ3.woff2)format("woff2")}@font-face{font-family:Source Serif;font-weight:100 900;font-style:normal;src:url(../media/SourceSerifVariable-Roman.ttf.mdpVL9bi.woff2)format("woff2")}@font-face{font-family:Source Serif;font-weight:100 900;font-style:italic;src:url(../media/SourceSerifVariable-Italic.ttf.CVdzAtxO.woff2)format("woff2")}@font-face{font-family:Material Symbols Rounded;font-style:normal;font-weight:400;font-display:block;src:url(../media/MaterialSymbols-Rounded.1hm6dVzH.woff2)format("woff2")} diff --git a/venv/Lib/site-packages/streamlit/static/static/css/katex.CAfVENUR.css b/venv/Lib/site-packages/streamlit/static/static/css/katex.CAfVENUR.css new file mode 100644 index 0000000000000000000000000000000000000000..e385977fcc8ba1ee4dc21038b6fe1400d919a9f0 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/css/katex.CAfVENUR.css @@ -0,0 +1 @@ +@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(../media/KaTeX_AMS-Regular.BQhdFMY1.woff2)format("woff2"),url(../media/KaTeX_AMS-Regular.DMm9YOAa.woff)format("woff"),url(../media/KaTeX_AMS-Regular.DRggAlZN.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(../media/KaTeX_Caligraphic-Bold.Dq_IR9rO.woff2)format("woff2"),url(../media/KaTeX_Caligraphic-Bold.BEiXGLvX.woff)format("woff"),url(../media/KaTeX_Caligraphic-Bold.ATXxdsX0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(../media/KaTeX_Caligraphic-Regular.Di6jR-x-.woff2)format("woff2"),url(../media/KaTeX_Caligraphic-Regular.CTRA-rTL.woff)format("woff"),url(../media/KaTeX_Caligraphic-Regular.wX97UBjC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(../media/KaTeX_Fraktur-Bold.CL6g_b3V.woff2)format("woff2"),url(../media/KaTeX_Fraktur-Bold.BsDP51OF.woff)format("woff"),url(../media/KaTeX_Fraktur-Bold.BdnERNNW.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(../media/KaTeX_Fraktur-Regular.CTYiF6lA.woff2)format("woff2"),url(../media/KaTeX_Fraktur-Regular.Dxdc4cR9.woff)format("woff"),url(../media/KaTeX_Fraktur-Regular.CB_wures.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(../media/KaTeX_Main-Bold.Cx986IdX.woff2)format("woff2"),url(../media/KaTeX_Main-Bold.Jm3AIy58.woff)format("woff"),url(../media/KaTeX_Main-Bold.waoOVXN0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(../media/KaTeX_Main-BoldItalic.DxDJ3AOS.woff2)format("woff2"),url(../media/KaTeX_Main-BoldItalic.SpSLRI95.woff)format("woff"),url(../media/KaTeX_Main-BoldItalic.DzxPMmG6.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(../media/KaTeX_Main-Italic.NWA7e6Wa.woff2)format("woff2"),url(../media/KaTeX_Main-Italic.BMLOBm91.woff)format("woff"),url(../media/KaTeX_Main-Italic.3WenGoN9.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(../media/KaTeX_Main-Regular.B22Nviop.woff2)format("woff2"),url(../media/KaTeX_Main-Regular.Dr94JaBh.woff)format("woff"),url(../media/KaTeX_Main-Regular.ypZvNtVU.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(../media/KaTeX_Math-BoldItalic.CZnvNsCZ.woff2)format("woff2"),url(../media/KaTeX_Math-BoldItalic.iY-2wyZ7.woff)format("woff"),url(../media/KaTeX_Math-BoldItalic.B3XSjfu4.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(../media/KaTeX_Math-Italic.t53AETM-.woff2)format("woff2"),url(../media/KaTeX_Math-Italic.DA0__PXp.woff)format("woff"),url(../media/KaTeX_Math-Italic.flOr_0UB.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(../media/KaTeX_SansSerif-Bold.D1sUS0GD.woff2)format("woff2"),url(../media/KaTeX_SansSerif-Bold.DbIhKOiC.woff)format("woff"),url(../media/KaTeX_SansSerif-Bold.CFMepnvq.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(../media/KaTeX_SansSerif-Italic.C3H0VqGB.woff2)format("woff2"),url(../media/KaTeX_SansSerif-Italic.DN2j7dab.woff)format("woff"),url(../media/KaTeX_SansSerif-Italic.YYjJ1zSn.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(../media/KaTeX_SansSerif-Regular.DDBCnlJ7.woff2)format("woff2"),url(../media/KaTeX_SansSerif-Regular.CS6fqUqJ.woff)format("woff"),url(../media/KaTeX_SansSerif-Regular.BNo7hRIc.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(../media/KaTeX_Script-Regular.D3wIWfF6.woff2)format("woff2"),url(../media/KaTeX_Script-Regular.D5yQViql.woff)format("woff"),url(../media/KaTeX_Script-Regular.C5JkGWo-.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(../media/KaTeX_Size1-Regular.mCD8mA8B.woff2)format("woff2"),url(../media/KaTeX_Size1-Regular.C195tn64.woff)format("woff"),url(../media/KaTeX_Size1-Regular.Dbsnue_I.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(../media/KaTeX_Size2-Regular.Dy4dx90m.woff2)format("woff2"),url(../media/KaTeX_Size2-Regular.oD1tc_U0.woff)format("woff"),url(../media/KaTeX_Size2-Regular.B7gKUWhC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC)format("woff2"),url(../media/KaTeX_Size3-Regular.CTq5MqoE.woff)format("woff"),url(../media/KaTeX_Size3-Regular.DgpXs0kz.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(../media/KaTeX_Size4-Regular.Dl5lxZxV.woff2)format("woff2"),url(../media/KaTeX_Size4-Regular.BF-4gkZK.woff)format("woff"),url(../media/KaTeX_Size4-Regular.DWFBv043.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(../media/KaTeX_Typewriter-Regular.CO6r4hn1.woff2)format("woff2"),url(../media/KaTeX_Typewriter-Regular.C0xS9mPB.woff)format("woff"),url(../media/KaTeX_Typewriter-Regular.D3Ib7_Hf.ttf)format("truetype")}.katex{text-indent:0;text-rendering:auto;font:1.21em/1.2 KaTeX_Main,Times New Roman,serif;position:relative}.katex *{border-color:currentColor;-ms-high-contrast-adjust:none!important}.katex .katex-version:after{content:"0.17.0"}.katex .katex-mathml{clip-path:inset(50%);border:0;width:1px;height:1px;padding:0;position:absolute;overflow:hidden}.katex .katex-html>.newline{display:block}.katex .base{white-space:nowrap;width:min-content;position:relative}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;table-layout:fixed;display:inline-table}.katex .vlist-r{display:table-row}.katex .vlist{vertical-align:bottom;display:table-cell;position:relative}.katex .vlist>span{height:0;display:block;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{width:0;overflow:hidden}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{vertical-align:bottom;width:2px;min-width:2px;font-size:1px;display:table-cell}.katex .vbox{flex-direction:column;align-items:baseline;display:inline-flex}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{flex-direction:row;display:inline-flex}.katex .thinbox{width:0;max-width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .smash{line-height:0;display:inline}.katex .clap,.katex .llap,.katex .rlap{width:0;position:relative}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .hdashline{border-bottom-style:dashed;width:100%;display:inline-block}.katex .sqrt>.root{margin-left:.277778em;margin-right:-.555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.833333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.714286em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.857143em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14286em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71429em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96286em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55429em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.416667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.583333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.833333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.347222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.416667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.486111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.694444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.833333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44028em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.289352em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.347222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.405093em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.520833em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.578704em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.694444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.833333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.289296em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.385728em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.433944em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.578592em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.694311em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.833173em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.200965em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.241158em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.281351em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.321543em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.361736em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.401929em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.482315em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.694534em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.833601em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{width:.12em;display:inline-block}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{min-width:1px;display:inline-block}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;height:inherit;width:100%;display:block;position:absolute}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;min-width:0;max-width:none;min-height:0;max-height:none}.katex .stretchy{width:100%;display:block;position:relative;overflow:hidden}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{width:100%;position:relative;overflow:hidden}.katex .halfarrow-left{width:50.2%;position:absolute;left:0;overflow:hidden}.katex .halfarrow-right{width:50.2%;position:absolute;right:0;overflow:hidden}.katex .brace-left{width:25.1%;position:absolute;left:0;overflow:hidden}.katex .brace-center{width:50%;position:absolute;left:25%;overflow:hidden}.katex .brace-right{width:25.1%;position:absolute;right:0;overflow:hidden}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{box-sizing:border-box;border:.04em solid}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{box-sizing:border-box;border-top:.049em solid;border-right:.049em solid;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{text-align:left;display:inline-block;position:absolute;right:calc(50% + .3em)}.katex .cd-label-right{text-align:right;display:inline-block;position:absolute;left:calc(50% + .3em)}.katex-display{text-align:center;margin:1em 0;display:block}.katex-display>.katex{text-align:center;white-space:nowrap;display:block}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{text-align:left;padding-left:2em}body{counter-reset:katexEqnNo mmlEqnNo} diff --git a/venv/Lib/site-packages/streamlit/static/static/js/AlertElement.BAyMiYwt.js b/venv/Lib/site-packages/streamlit/static/static/js/AlertElement.BAyMiYwt.js new file mode 100644 index 0000000000000000000000000000000000000000..27a12788ec4ed30370db5d25dc736ca61a9f46f8 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/AlertElement.BAyMiYwt.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as n,i as r,r as i,t as a}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{r as o}from"./StreamlitMarkdown.DJLoxxnS.js";import{t as s}from"./DynamicIcon.44zobID_.js";import{t as c}from"./useEmotionTheme.D29Ufy6b.js";import{o as l,r as u}from"./ErrorElement.BWmlOcKX.js";var d=e(t(),1),f=a(`div`,{target:`ee8gipb0`})(({theme:e,$hasTitle:t})=>({display:`flex`,flexDirection:t?`column`:`row`,gap:t?e.spacing.twoXS:e.spacing.sm,width:`100%`,[`${l} code`]:{paddingRight:e.spacing.lg}})),p=a(`div`,{target:`ee8gipb1`})(({theme:e})=>({display:`flex`,alignItems:`flex-start`,gap:e.spacing.sm})),m=a(`div`,{target:`ee8gipb2`})(({theme:e})=>({position:`relative`,top:e.spacing.threeXS,flexShrink:0})),h=a(`strong`,{target:`ee8gipb3`})(({theme:e})=>({fontSize:e.fontSizes.md,"& p":{fontWeight:e.fontWeights.bold}})),g=a(`div`,{target:`ee8gipb4`})({width:`100%`});function _({icon:e,body:t,title:a,kind:l}){let d=c(),_=e?{width:`calc(100% - (${d.iconSizes.lg} + ${d.spacing.sm}))`}:void 0,v=e?r(m,{children:r(s,{iconValue:e,size:`lg`,testid:`stAlertDynamicIcon`})}):null;return r(`div`,{className:`stAlert`,"data-testid":`stAlert`,children:r(u,{kind:l,children:r(f,{$hasTitle:!!a,children:a?n(i,{children:[n(p,{children:[v,r(h,{"data-testid":`stAlertTitle`,children:r(o,{source:a,allowHTML:!1,isLabel:!0,inheritFont:!0})})]}),r(g,{children:r(o,{source:t,allowHTML:!1})})]}):n(i,{children:[v,r(o,{source:t,allowHTML:!1,style:_})]})})})})}var v=(0,d.memo)(_);export{v as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/ArrowVegaLiteChart.C5lWLbxa.js b/venv/Lib/site-packages/streamlit/static/static/js/ArrowVegaLiteChart.C5lWLbxa.js new file mode 100644 index 0000000000000000000000000000000000000000..600c72931c5c7a819967204d42bde3b711fc6e0d --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/ArrowVegaLiteChart.C5lWLbxa.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as n,i as r,y as i}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as a}from"./loglevel.BJBYxGId.js";import{wt as o}from"./utils.94RcZhG4.js";import{t as s}from"./emotion-react.browser.esm.B06RJmME.js";import{U as c,f as l}from"./protobuf.DC2L68b9.js";import{n as u,t as d}from"./types.cZoyy9Y-.js";import{t as f}from"./uri.UNMuXGg5.js";import{c as p,f as m,o as h,p as g,s as _,y as v}from"./pandasStylerUtils.CpHtlemx.js";import{t as y}from"./isEqual.CgNOpGTC.js";import{h as b,m as x}from"./getColors.DtAxY2Hd.js";import{a as ee,i as te}from"./utils.BrY_0PXX.js";import{t as ne}from"./useEmotionTheme.D29Ufy6b.js";import{f as re}from"./ErrorElement.BWmlOcKX.js";import{n as S}from"./FormClearHelper.D0Yt6KG5.js";import{t as ie}from"./useCalculatedDimensions.BnLCBgVi.js";import{t as C}from"./index.esm.DCRlH4DP.js";import{t as ae}from"./DataFrame.Wny8mRut.js";import{t as oe}from"./Check.esm.B4TBPV6z.js";import{t as se}from"./ContentCopy.esm.Dq-fIx3A.js";import{t as ce}from"./FileDownload.esm.BM_tuzhj.js";import{n as w,t as le}from"./Toolbar.BynU-Hbw.js";import{t as ue}from"./TableChart.esm.Bm7WHa8s.js";import{t as de}from"./useCopyToClipboard.31Hpj0n3.js";import{t as fe}from"./useRequiredContext.F4hG38Ff.js";import{n as pe,t as T}from"./withFullScreenWrapper.DjqP6oFO.js";import{a as E,i as D,n as me,o as O,r as k,s as A,t as he}from"./styled-components.CuxloOeN.js";var j=e(t()),M=j.forwardRef(function(e,t){return j.createElement(C,i({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),j.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),j.createElement(`path`,{d:`M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z`}))});M.displayName=`InsertChart`;var ge=({data:e,height:t,width:n,customToolbarActions:i})=>r(ae,{element:new l({editingMode:l.EditingMode.READ_ONLY,disabled:!0,arrowData:null,id:``,columns:``,formId:``,columnOrder:[],selectionMode:[]}),data:e,widgetMgr:void 0,disabled:!0,fragmentId:void 0,disableFullscreenMode:!0,customToolbarActions:i,widthConfig:n??new c.WidthConfig({useStretch:!0}),heightConfig:t?new c.HeightConfig({pixelHeight:t}):void 0});function N(e,t){if(P(e,t),Array.isArray(e.layer))for(let n of e.layer)n&&typeof n==`object`&&N(n,t);for(let n of[`vconcat`,`hconcat`,`concat`])if(Array.isArray(e[n]))for(let r of e[n])r&&typeof r==`object`&&N(r,t);(`facet`in e||`repeat`in e)&&e.spec&&typeof e.spec==`object`&&N(e.spec,t)}function P(e,t){let n=e.encoding;if(!n)return;let r=n.color;if(!r)return;`value`in r&&b(r.value)&&(r.value=x(r.value,t));let i=r.scale;i&&Array.isArray(i.range)&&(i.range=i.range.map(e=>b(e)?x(e,t):e))}var F=20;function I(e){if(!(e.usermeta===null||typeof e.usermeta!=`object`||Array.isArray(e.usermeta)))return e.usermeta}function L(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0}function R(e){return typeof e==`string`&&[`svg`,`canvas`,`hybrid`].includes(e)?e:void 0}function z(e){if(L(e))return e;if(typeof e!=`object`||!e||Array.isArray(e))return;let t={};for(let n of[`left`,`right`,`top`,`bottom`]){let r=e[n];L(r)&&(t[n]=r)}return Object.keys(t).length>0?t:void 0}function B(e){let t=I(e);if(!t||!(`embedOptions`in t))return;let n={},r=t.embedOptions,i=r?.theme;i!==`streamlit`&&(typeof i==`string`||i===null)&&(n.theme=i);let a=R(r?.renderer);a&&(n.renderer=a);let o=z(r?.padding);if(o!==void 0&&(n.padding=o),Object.keys(n).length>0){t.embedOptions=n;return}delete t.embedOptions}function V(e){`params`in e&&`encoding`in e&&e.params.forEach(t=>{`select`in t&&(typeof t.select==`string`&&[`interval`,`point`].includes(t.select)&&(t.select={type:t.select}),!(typeof t.select!=`object`||t.select===null||!(`type`in t.select))&&t.select.type===`point`&&!(`encodings`in t.select)&&d(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))})}var H=(e,t,n,r,i,a,o,s)=>{let c=JSON.parse(e);typeof c.height==`number`&&c.height<=0&&delete c.height,typeof c.width==`number`&&c.width<=0&&delete c.width;let l=I(c)?.embedOptions?.theme;if(r===`streamlit`||l===`streamlit`?c.config=k(c.config,a):c.config=D(c.config,a),B(c),c.title&&(typeof c.title==`string`&&(c.title={text:c.title}),c.title.limit=c.title.limit??Math.max(o-40,0)),n&&s&&s>0&&(c.height=s),t&&o&&o>0&&(c.width=o,`vconcat`in c&&c.vconcat.forEach(e=>{typeof e!=`object`||!e||`hconcat`in e||`vconcat`in e||`concat`in e||`facet`in e||`repeat`in e||(e.width=o)})),c.padding||={},d(c.padding.bottom)&&(c.padding.bottom=F),c.datasets)throw Error(`Datasets should not be passed as part of the spec`);return i.length>0&&V(c),N(c,a),c},_e=(e,t,n,r,i)=>{let a=ne(),{id:o,formId:s,spec:c,data:l,datasets:u,vegaLiteTheme:d,selectionMode:f}=e,p=(0,j.useMemo)(()=>f,[JSON.stringify(f)]),m=(0,j.useMemo)(()=>H(c,r,i,d,p,a,0,0),[c,r,i,d,p,a]),h=`vconcat`in m||`hconcat`in m||`concat`in m,g=h&&r?t:void 0,_=h&&i?n:void 0,v=(0,j.useMemo)(()=>{let e={...m};return r&&delete e.width,i&&delete e.height,JSON.stringify({spec:e,useContainerWidth:r,useContainerHeight:i,concatWidth:g,concatHeight:_})},[m,r,i,g,_]);return{id:o,formId:s,vegaLiteTheme:d,spec:(0,j.useMemo)(()=>H(c,r,i,d,p,a,t,n),[c,r,i,d,p,a,t,n]),selectionMode:p,data:l,datasets:u,useContainerWidth:r,baseSpecKey:v}},U=e(a(),1),W={DATAFRAME_INDEX:`(index)`};function ve(e){return!e||e.dimensions.numDataRows===0?null:q(e)}function G(e){let t=K(e);if(d(t))return null;let n={};for(let[e,r]of Object.entries(t))n[e]=q(r);return n}function K(e){if(e?.length===0)return null;let t={};return e.forEach(e=>{if(!e)return;let n=e.hasName?e.name:null;t[n]=e.data}),t}function q(e){if(e.dimensions.numDataRows===0)return[];let t=[],{numDataRows:n,numDataColumns:r,numIndexColumns:i}=e.dimensions,a=e.columnTypes[0]??void 0,o=a?.type===_.INDEX&&(v(a)||g(a)||m(a));for(let a=0;a{let{id:r,formId:i,selectionMode:a}=e;return{maybeConfigureSelections:(0,j.useCallback)(e=>{a.forEach(s=>{e.addSignalListener(s,o(ye,(o,s)=>{let c=e.getState({data:(e,t)=>a.some(t=>`${t}_store`===e),recurse:!1});u(c)&&t.setElementState(r,`viewState`,c);let l=s;`vlPoint`in s&&`or`in s.vlPoint&&(l=s.vlPoint.or);let d={id:r,formId:i},f=JSON.parse(t.getStringValue(d)||`{}`),p={selection:{...f?.selection,[o]:l||{}}};y(f,p)||t.setStringValue(d,JSON.stringify(p),{fromUi:!0},n)}))});let s=t.getElementState(r,`viewState`);if(u(s))try{return e.setState(s)}catch(e){J.warn(`Failed to restore view state`,e)}return e},[r,a,t,i,n]),onFormCleared:(0,j.useCallback)(()=>{let e={selection:{}};a.forEach(t=>{e.selection[t]={}});let o={id:r,formId:i},s=t.getStringValue(o);y(s?JSON.parse(s):e,e)||t.setStringValue(o,JSON.stringify(e),{fromUi:!0},n)},[r,i,n,a,t])}},X=`source`,Z=(0,U.getLogger)(`useVegaEmbed`);function be(e,t,n){let r=(0,j.useRef)(null),i=(0,j.useRef)(null),a=(0,j.useRef)(X),o=(0,j.useRef)(null),s=(0,j.useRef)([]),c=(0,j.useRef)(null),l=(0,j.useRef)([]),[u,d]=(0,j.useState)(!1),{maybeConfigureSelections:f,onFormCleared:p}=Y(e,t,n);S({widgetMgr:t,element:e,onFormCleared:p});let{data:m,datasets:h}=e;(0,j.useEffect)(()=>{c.current=m,l.current=h,r.current===null&&(o.current=m,s.current=h)},[m,h]);let g=(0,j.useCallback)(()=>{i.current&&i.current(),i.current=null,r.current=null},[]),_=(0,j.useCallback)(async(e,t)=>{if(e.current===null)throw Error(`Element missing.`);d(!0);try{g();let n={ast:!0,expr:O,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,actions:!1},{vgSpec:u,view:d,finalize:p}=await E(e.current,t,n);r.current=f(d),i.current=p;let m=G(l.current),h=m?Object.keys(m):[];if(h.length===1){let[e]=h;a.current=e}else h.length===0&&u.data&&(a.current=X);let _=ve(c.current);if(_&&r.current.insert(a.current,_),m)for(let[e,t]of Object.entries(m))r.current.insert(e,t);return await r.current.runAsync(),await r.current.resize().runAsync(),o.current=c.current,s.current=l.current,r.current}finally{d(!1)}},[g,f]),v=(0,j.useCallback)((e,t,n,r)=>{if(!r||r.dimensions.numDataRows===0){try{e.remove(t,A)}catch{}return}if(!n||n.dimensions.numDataRows===0){e.insert(t,q(r));return}r.hash!==n.hash&&(e.data(t,q(r)),Z.info(`Replaced the ${t} dataset in Vega view.`))},[]);return{createView:_,updateView:(0,j.useCallback)(async(e,t)=>{if(r.current===null||u)return null;let n=o.current,i=s.current;(n||e)&&v(r.current,a.current,n,e);let c=K(i)??{},l=K(t)??{};for(let[e,t]of Object.entries(l)){let n=e||a.current,i=c[n];v(r.current,n,i,t)}for(let e of Object.keys(c))!Object.hasOwn(l,e)&&e!==a.current&&v(r.current,e,null,null);return await r.current?.resize().runAsync(),o.current=e,s.current=t,r.current},[v,u]),finalizeView:g,resizeView:(0,j.useCallback)(async(e,t)=>{if(r.current===null||u)return!1;try{return e>0&&r.current.width(e),t>0&&r.current.height(t),await r.current.resize().runAsync(),!0}catch(e){return Z.warn(`Failed to resize Vega view:`,e),!1}},[u]),exportToPng:(0,j.useCallback)(async()=>{if(r.current===null||u)return null;try{return await r.current.toImageURL(`png`)}catch(e){return Z.warn(`Failed to export Vega view as PNG:`,e),null}},[u]),isViewReady:r.current!==null&&!u}}function xe(e){try{let t=typeof e==`string`?JSON.parse(e):e;return!!(t.facet||t.encoding?.row||t.encoding?.column||t.encoding?.facet)}catch{return!1}}function Se(e){try{let t=typeof e==`string`?JSON.parse(e):e;return!(`vconcat`in t)||!Array.isArray(t.vconcat)?!1:t.vconcat.some(e=>typeof e==`object`&&!!e&&(`hconcat`in e||`vconcat`in e||`concat`in e||`layer`in e||`facet`in e||`repeat`in e))}catch{return!1}}function Ce(e){return e.map(e=>({hasName:e.hasName,name:e.name,data:new h(e.data)}))}var Q=T(({disableFullscreenMode:e,element:t,elementHash:i,fragmentId:a,widgetMgr:o,widthConfig:c,heightConfig:l})=>{let u=(0,j.useMemo)(()=>({data:t.data?new h(t.data):null,spec:t.spec,datasets:Ce(t.datasets),useContainerWidth:t.useContainerWidth,vegaLiteTheme:t.theme,id:t.id,selectionMode:t.selectionMode,formId:t.formId}),[i,t]),[d,p]=(0,j.useState)(!1),[m,g]=(0,j.useState)(!1),{expanded:_,height:v,width:y,expand:b,collapse:x}=fe(pe),{width:ne,height:S,elementRef:C}=ie([d]),ae=ee(c)||u.useContainerWidth,T=te(l),E=xe(u.spec),D=Se(u.spec),O=E&&!_?!1:ae,k=E?_?y??0:0:ne,A=(_?v:S)??0,N=_&&!D?!0:O,P=_?!0:T,F=_e(u,k,A,N,P),{createView:I,updateView:L,finalizeView:R,resizeView:z,exportToPng:B,isViewReady:V}=be(F,o,a),{data:H,datasets:U,spec:W,baseSpecKey:ve}=F,{isCopied:G,copyToClipboard:K}=de(),q=f(),ye=(0,j.useCallback)(()=>{(async()=>{let e=await B();if(!e)return;let t=new Date,n=e=>String(e).padStart(2,`0`),r=`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}-${n(t.getMinutes())}`,i=document.createElement(`a`);i.setAttribute(`href`,e),i.setAttribute(`download`,`${r}_chart.png`),i.style.display=`none`,document.body.appendChild(i),i.click(),document.body.removeChild(i)})()},[B]),J=(0,j.useCallback)(()=>{K(typeof W==`string`?W:JSON.stringify(W,null,2))},[K,W]),Y=(0,j.useRef)(null),X=(0,j.useRef)(W);X.current=W;let Z=(0,j.useRef)({width:k,height:A});Z.current={width:k,height:A};let Q=(!(O||_)||k>0)&&(!(T||_)||A>0);(0,j.useLayoutEffect)(()=>(C.current!==null&&Q&&(Y.current={width:Z.current.width,height:Z.current.height},I(C,X.current)),()=>{R()}),[I,R,ve,d,C,Q]);let $=N||P;if((0,j.useEffect)(()=>{if(!V||!$)return;let e=Y.current,t=N&&e?.width!==k,n=P&&e?.height!==A;if(!t&&!n)return;let r=!1;return(async()=>{await z(N?k:0,P?A:0)&&!r&&(Y.current={width:k,height:A})})(),()=>{r=!0}},[V,$,N,P,z,k,A]),(0,j.useEffect)(()=>{L(H,U)},[H,U]),(0,j.useEffect)(()=>{H||U?.[0]?.data?g(!0):g(!1)},[H,U]),d){let e=v??(S>0?S:void 0);return r(ge,{data:H??U[0]?.data,height:e,width:c??void 0,customToolbarActions:[r(w,{label:`Show chart`,icon:M,onClick:()=>{p(!1)}},`show-chart`)]})}return n(re,{height:T?_?v:`100%`:v,useContainerWidth:_?!0:O,children:[n(le,{target:re,isFullScreen:_,onExpand:b,onCollapse:x,disableFullscreenMode:e,children:[m&&r(w,{label:`Show data`,icon:ue,onClick:()=>{p(!0)}}),V&&r(w,{label:`Download as PNG`,icon:ce,onClick:ye}),q&&r(w,{label:G?`Copied!`:`Copy Vega-Lite spec`,icon:G?oe:se,onClick:J})]}),r(s,{styles:[me]}),r(he,{"data-testid":`stVegaLiteChart`,className:`stVegaLiteChart`,useContainerWidth:O,useContainerHeight:T,ref:C})]})}),$=(0,j.memo)(Q);export{$ as default,Se as hasNestedComposition,xe as isFacetChart}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/Audio.Bh9DVwbW.js b/venv/Lib/site-packages/streamlit/static/static/js/Audio.Bh9DVwbW.js new file mode 100644 index 0000000000000000000000000000000000000000..5cf89b33a8b23f41dcb31121b21529edb175a484 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/Audio.Bh9DVwbW.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{i as n,t as r}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as i}from"./loglevel.BJBYxGId.js";import{t as a}from"./useCrossOriginAttribute.DBi7mGp8.js";var o=e(t(),1),s=e(i(),1),c=r(`div`,{target:`e1z085g90`})(()=>({lineHeight:0})),l=r(`audio`,{target:`e1z085g91`})(({theme:e})=>({width:`100%`,height:e.sizes.minElementHeight,margin:0,padding:0})),u=(0,s.getLogger)(`Audio`);function d({element:e,endpoints:t,elementMgr:r}){let i=(0,o.useRef)(null),{startTime:s,endTime:d,loop:f,autoplay:p}=e,m=(0,o.useMemo)(()=>{if(!e.id)return!0;let t=r.getElementState(e.id,`preventAutoplay`);return t||r.setElementState(e.id,`preventAutoplay`,!0),t??!1},[e.id,r]);(0,o.useEffect)(()=>{i.current&&(i.current.currentTime=s)},[s]),(0,o.useEffect)(()=>{let t=i.current,n=()=>{t&&(t.currentTime=e.startTime)};return t&&t.addEventListener(`loadedmetadata`,n),()=>{t&&t.removeEventListener(`loadedmetadata`,n)}},[e]),(0,o.useEffect)(()=>{let e=i.current;if(!e)return;let t=!1,n=()=>{d>0&&e.currentTime>=d&&(f?(e.currentTime=s||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener(`timeupdate`,n),()=>{e&&d>0&&e.removeEventListener(`timeupdate`,n)}},[d,f,s]),(0,o.useEffect)(()=>{let e=i.current;if(!e)return;let t=()=>{f&&(e.currentTime=s||0,e.play())};return e.addEventListener(`ended`,t),()=>{e&&e.removeEventListener(`ended`,t)}},[f,s]);let h=a(e.url),g=t.buildMediaURL(e.url);return n(c,{children:n(l,{className:`stAudio`,"data-testid":`stAudio`,ref:i,controls:!0,autoPlay:p&&!m,src:g,onError:e=>{let n=e.currentTarget.src;u.error(`Client Error: Audio source error - ${n}`),t.sendClientErrorToHost(`Audio`,`Audio source failed to load`,`onerror triggered`,n)},crossOrigin:h})})}var f=(0,o.memo)(d);export{f as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/AudioInput.Bj4ItJDj.js b/venv/Lib/site-packages/streamlit/static/static/js/AudioInput.Bj4ItJDj.js new file mode 100644 index 0000000000000000000000000000000000000000..2dfe60081894067b51359f56757db359df0cd3ed --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/AudioInput.Bj4ItJDj.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as n,i as r,t as i,y as a}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{Xt as o,c as s}from"./utils.94RcZhG4.js";import{_ as c,z as l}from"./protobuf.DC2L68b9.js";import{n as u,t as d}from"./types.cZoyy9Y-.js";import{t as f}from"./zip.DLtjLZjW.js";import{n as p}from"./Icon.RiOK8SDN.js";import{t as m}from"./DynamicIcon.44zobID_.js";import{i as h}from"./UriUtil.olyUCSHN.js";import{t as ee}from"./useEmotionTheme.D29Ufy6b.js";import{t as te}from"./Tooltip.PNC8NIZa.js";import{t as g}from"./styled-components.B5oT30oI.js";import{t as _}from"./BaseButton.DzUQ5vsa.js";import{t as ne}from"./FormClearHelper.D0Yt6KG5.js";import{t as v}from"./useWidgetManagerElementState.CbF0sesb.js";import{t as y}from"./index.esm.DCRlH4DP.js";import{t as re}from"./Delete.esm.CDosXh7J.js";import{t as ie}from"./FileDownload.esm.BM_tuzhj.js";import{n as b,t as ae}from"./Toolbar.BynU-Hbw.js";import{t as oe}from"./WidgetLabel.CVV1ys75.js";import{t as se}from"./WidgetLabelHelpIcon.BmvkC-YW.js";import{t as x}from"./ErrorHandling.H5STbbYb.js";import{t as S}from"./createDownloadLinkElement.CV8DGZx1.js";import{t as ce}from"./useWaveformController.By203ydw.js";import{i as C}from"./urls.B0fCYwet.js";var w=e(t()),T=w.forwardRef(function(e,t){return w.createElement(y,a({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),w.createElement(`g`,{fill:`none`},w.createElement(`rect`,{width:24,height:24}),w.createElement(`rect`,{width:24,height:24}),w.createElement(`rect`,{width:24,height:24})),w.createElement(`path`,{d:`M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z`}),w.createElement(`path`,{d:`M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z`}))});T.displayName=`Mic`;var E=w.forwardRef(function(e,t){return w.createElement(y,a({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),w.createElement(`rect`,{width:24,height:24,fill:`none`}),w.createElement(`path`,{d:`M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z`}))});E.displayName=`Pause`;var D=w.forwardRef(function(e,t){return w.createElement(y,a({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),w.createElement(`rect`,{width:24,height:24,fill:`none`}),w.createElement(`path`,{d:`M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z`}))});D.displayName=`PlayArrow`;var O=w.forwardRef(function(e,t){return w.createElement(y,a({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),w.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),w.createElement(`path`,{d:`M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z`}))});O.displayName=`Refresh`;var k=w.forwardRef(function(e,t){return w.createElement(y,a({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),w.createElement(`g`,{fill:`none`},w.createElement(`rect`,{width:24,height:24}),w.createElement(`rect`,{width:24,height:24})),w.createElement(`path`,{fillRule:`evenodd`,d:`M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z`}))});k.displayName=`StopCircle`;var le=(e,t)=>{let{enforceDownloadInNewTab:n=!1}=(0,w.useContext)(h);return(0,w.useCallback)(()=>{if(!e)return;let r=S({enforceDownloadInNewTab:n,url:e,filename:t});r.style.display=`none`,document.body.appendChild(r),r.click(),document.body.removeChild(r)},[e,n,t])},ue=async({files:e,uploadClient:t,widgetMgr:n,widgetInfo:r,fragmentId:i,signal:a})=>{let o;try{o=await t.fetchFileURLs(e)}catch(t){return{successfulUploads:[],failedUploads:e.map(e=>({file:e,error:x(t)}))}}let s=f(e,o),u=[],d=[];return await Promise.all(s.map(async([e,n])=>{if(!e||!n?.uploadUrl||!n.fileId){e&&d.push({file:e,error:Error(`No upload URL found`)});return}try{await t.uploadFile({id:n.fileId,formId:r.formId||``},n.uploadUrl,e,void 0,a),u.push({fileUrl:n,file:e})}catch(t){let n=x(t);d.push({file:e,error:n})}})),n.setFileUploaderStateValue(r,new c({uploadedFileInfo:u.map(({file:e,fileUrl:t})=>new l({fileId:t.fileId,fileUrls:t,name:e.webkitRelativePath||e.name,size:e.size}))}),{fromUi:!0},i),{successfulUploads:u,failedUploads:d}},de=i(`div`,{target:`e1ywdc2n0`})(),A=i(`div`,{target:`e1ywdc2n1`})(({theme:e,disabled:t})=>({height:e.sizes.largestElementHeight,width:`100%`,background:e.colors.secondaryBg,borderRadius:e.radii.default,marginBottom:e.spacing.twoXS,display:`flex`,alignItems:`center`,position:`relative`,paddingLeft:e.spacing.xs,paddingRight:e.spacing.sm,border:e.colors.widgetBorderColor?`${e.sizes.borderWidth} solid ${e.colors.widgetBorderColor}`:void 0,cursor:t?`not-allowed`:`auto`,overflow:`hidden`})),fe=i(`div`,{target:`e1ywdc2n2`})({flex:1}),pe=i(`div`,{target:`e1ywdc2n3`})(({show:e,theme:t})=>({display:e?`block`:`none`,position:`relative`,height:t.sizes.largestElementHeight,"& > div":{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,display:`flex`,alignItems:`center`}})),me=i(`span`,{target:`e1ywdc2n4`})(({theme:e,isPlayingOrRecording:t,disabled:n})=>({margin:e.spacing.sm,fontFamily:e.fonts.monospace,color:n?e.colors.fadedText40:t?e.colors.bodyText:e.colors.fadedText60,backgroundColor:e.colors.secondaryBg,fontSize:e.fontSizes.sm})),j=i(`div`,{target:`e1ywdc2n5`})({width:`100%`,textAlign:`center`,overflow:`hidden`}),M=i(`span`,{target:`e1ywdc2n6`})(({theme:e})=>({color:e.colors.bodyText})),N=i(`a`,{target:`e1ywdc2n7`})(({theme:e})=>({color:e.colors.link,textDecoration:e.linkUnderline?`underline`:`none`})),P=i(`div`,{target:`e1ywdc2n8`})(({theme:e})=>({flex:1,height:e.sizes.largestElementHeight,display:`flex`,justifyContent:`center`,alignItems:`center`})),F=i(`div`,{target:`e1ywdc2n9`})(({theme:e})=>{let t=`0.625em`;return{opacity:.2,width:`100%`,height:t,backgroundSize:t,backgroundImage:`radial-gradient(${e.colors.fadedText10} 40%, transparent 40%)`,backgroundRepeat:`repeat`}}),I=i(`span`,{target:`e1ywdc2n10`})(({theme:e})=>({"& > button":{color:e.colors.primary,padding:e.spacing.threeXS},"& > button:hover, & > button:focus":{color:e.colors.redColor}})),L=i(`span`,{target:`e1ywdc2n11`})(({theme:e})=>({"& > button":{padding:e.spacing.threeXS,color:e.colors.fadedText60},"& > button:hover, & > button:focus":{color:e.colors.bodyText}})),R=i(`span`,{target:`e1ywdc2n12`})(({theme:e})=>({"& > button":{padding:e.spacing.threeXS,color:e.colors.fadedText60},"& > button:hover, & > button:focus":{color:e.colors.bodyText}})),z=i(`div`,{target:`e1ywdc2n13`})(({theme:e})=>({display:`flex`,justifyContent:`center`,alignItems:`center`,flexGrow:0,flexShrink:1,padding:e.spacing.xs,gap:e.spacing.twoXS,marginRight:e.spacing.twoXS})),B=({onClick:e,disabled:t,ariaLabel:n,iconContent:i})=>r(_,{kind:g.BORDERLESS_ICON,onClick:e,disabled:t,"aria-label":n,containerWidth:!0,"data-testid":`stAudioInputActionButton`,children:r(p,{content:i,size:`base`,color:`inherit`})}),V=({disabled:e,stopRecording:t})=>r(I,{children:r(B,{onClick:t,disabled:e,ariaLabel:`Stop recording`,iconContent:k})}),H=({disabled:e,isPlaying:t,onClickPlayPause:n})=>r(R,{children:t?r(B,{onClick:n,disabled:e,ariaLabel:`Pause`,iconContent:E}):r(B,{onClick:n,disabled:e,ariaLabel:`Play`,iconContent:D})}),U=({disabled:e,startRecording:t})=>r(L,{children:r(B,{onClick:t,disabled:e,ariaLabel:`Record`,iconContent:T})}),W=({onClick:e})=>r(R,{children:r(B,{disabled:!1,onClick:e,ariaLabel:`Reset`,iconContent:O})}),he=(0,w.memo)(({disabled:e,isRecording:t,isPlaying:i,isUploading:a,isError:o,recordingUrlExists:s,startRecording:c,stopRecording:l,onClickPlayPause:u,onClear:d})=>o?r(z,{children:r(W,{onClick:d})}):a?r(z,{children:r(m,{size:`base`,iconValue:`spinner`})}):n(z,{children:[t?r(V,{disabled:e,stopRecording:l}):r(U,{disabled:e,startRecording:c}),s&&r(H,{disabled:e,isPlaying:i,onClickPlayPause:u})]})),ge=(0,w.memo)(()=>r(j,{children:r(M,{children:`An error has occurred, please try again.`})})),G=`00:00`,K=e=>{let t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60),i=t%60,a=n%60,o=i.toString().padStart(2,`0`),s=a.toString().padStart(2,`0`),c=r.toString().padStart(2,`0`);return n<60?`${s}:${o}`:`${c}:${s}:${o}`},_e=(0,w.memo)(()=>n(j,{children:[r(M,{children:`This app would like to use your microphone.`}),` `,r(N,{href:C,rel:`noopener noreferrer`,target:`_blank`,children:`Learn how to allow access.`})]})),ve=(0,w.memo)(()=>r(P,{children:r(F,{})})),q=(0,w.memo)(({element:e,uploadClient:t,widgetMgr:i,fragmentId:a,disabled:c})=>{let l=ee(),f=(0,w.useRef)(null),[p,m]=(0,w.useState)(!1),[h,g]=(0,w.useState)(!1),[_,y]=(0,w.useState)(!1),[x,S]=(0,w.useState)(G),[C,T]=v({widgetMgr:i,id:e.id,key:`deleteFileUrl`,defaultValue:null}),[E,D]=v({widgetMgr:i,id:e.id,key:`recordingUrl`,defaultValue:null}),[O,k]=v({widgetMgr:i,id:e.id,formId:e.formId,key:`recordingTime`,defaultValue:G}),j=(0,w.useRef)(null),M=(0,w.useRef)(null),N=(0,w.useRef)(null),P=e.id,F=e.formId,I=(0,w.useCallback)(async e=>{j.current&&j.current.abort();let n=new AbortController;j.current=n;try{if(g(!0),u(F)&&i.setFormsWithUploadsInProgress(new Set([F])),n.signal.aborted)return;let r;try{r=URL.createObjectURL(e),M.current&&M.current!==r&&URL.revokeObjectURL(M.current),M.current=r}catch{y(!0),g(!1),u(F)&&i.setFormsWithUploadsInProgress(new Set);return}if(n.signal.aborted){URL.revokeObjectURL(r),M.current=null;return}D(r);let o=new Date().toISOString().slice(0,16).replace(/:/g,`-`),s=new File([e],`${o}_audio.wav`,{type:e.type});try{let{successfulUploads:e,failedUploads:r}=await ue({files:[s],uploadClient:t,widgetMgr:i,widgetInfo:{id:P,formId:F},fragmentId:a,signal:n.signal});if(n.signal.aborted)return;if(r.length>0){y(!0);return}y(!1);let o=e[0];o?.fileUrl?.deleteUrl&&T(o.fileUrl.deleteUrl)}catch{n.signal.aborted||y(!0)}finally{u(F)&&i.setFormsWithUploadsInProgress(new Set),n.signal.aborted||g(!1)}}catch{n.signal.aborted||(y(!0),g(!1)),u(F)&&i.setFormsWithUploadsInProgress(new Set)}},[t,i,P,F,a,T,D]),L=(0,w.useRef)(null),R=ce({containerRef:f,sampleRate:e.sampleRate??void 0,waveformPadding:s(l.spacing.twoXS),events:{onPermissionDenied:()=>{m(!0)},onError:()=>{y(!0)},onRecordStart:()=>{k(G),S(G)},onRecordReady:()=>{let e=K(L.current?.playback.getDurationMs()??0);k(e),S(e)},onApprove:I,onCancel:()=>{k(G),S(G)},onProgressMs:e=>{k(K(e))},onPlaybackPause:()=>{S(K(L.current?.playback.getCurrentTimeMs()??0))},onPlaybackFinish:()=>{S(K(L.current?.playback.getDurationMs()??0))}}});L.current=R;let{state:z,isPlaybackPlaying:B,start:V,stop:H,approve:U,cancel:W,playback:{play:q,pause:J,load:Y,getCurrentTimeMs:X,getDurationMs:Z}}=R,Q=(0,w.useCallback)(async({updateWidgetManager:n,deleteFile:r})=>{let o=E;if(o&&M.current===o&&(URL.revokeObjectURL(o),M.current=null),N.current&&=(cancelAnimationFrame(N.current),null),D(null),T(null),S(G),k(G),W(),n&&i.setFileUploaderStateValue(e,{},{fromUi:!0},a),r&&C)try{await t.deleteFile(C)}catch{}u(o)&&URL.revokeObjectURL(o)},[C,E,t,W,e,i,a,k,T,D]);(0,w.useEffect)(()=>{let e=()=>{B&&(S(K(X())),N.current=requestAnimationFrame(e))};return B?N.current=requestAnimationFrame(e):N.current&&=(cancelAnimationFrame(N.current),null),()=>{N.current&&=(cancelAnimationFrame(N.current),null)}},[B,X]),(0,w.useEffect)(()=>{if(!E)return;let e=!1;return S(O),(async()=>{try{if(await Y(E),e)return;let t=Z();t>0&&S(K(t))}catch{e||y(!0)}})(),()=>{e=!0}},[E,O,Y,Z]),(0,w.useEffect)(()=>{if(d(F))return;let e=new ne;return e.manageFormClearListener(i,F,()=>{Q({updateWidgetManager:!0,deleteFile:!1})}),()=>e.disconnect()},[F,Q,i]),(0,w.useEffect)(()=>()=>{j.current&&=(j.current.abort(),null),N.current&&=(cancelAnimationFrame(N.current),null),M.current&&=(URL.revokeObjectURL(M.current),null)},[]);let ye=(0,w.useCallback)(async()=>{try{if(B){let e=X();J(),S(K(e))}else z===`idle`&&E&&(X()<=100&&S(G),await q())}catch{y(!0)}},[B,X,J,q,E,z]),be=(0,w.useCallback)(async()=>{E&&await Q({updateWidgetManager:!1,deleteFile:!0});try{S(G),await V()}catch{}},[Q,E,V]),xe=(0,w.useCallback)(async()=>{try{let{blob:e}=await H();await U(e)}catch{y(!0)}},[U,H]),Se=le(E,`recording.wav`),Ce=(0,w.useCallback)(()=>{be()},[be]),we=(0,w.useCallback)(()=>{xe()},[xe]),Te=(0,w.useCallback)(()=>{Q({updateWidgetManager:!1,deleteFile:!0}),y(!1)},[Q]),Ee=(0,w.useCallback)(()=>{Se()},[Se]),De=(0,w.useCallback)(()=>{Q({updateWidgetManager:!0,deleteFile:!0})},[Q]),$=z===`recording`,Oe=B,ke=$?O:x,Ae=z===`idle`&&!p&&!E,je=p||Ae||_;return n(de,{className:`stAudioInput`,"data-testid":`stAudioInput`,children:[r(oe,{label:e.label,disabled:c,labelVisibility:o(e.labelVisibility?.value),children:e.help&&r(se,{content:e.help,placement:te.TOP,label:e.label})}),n(A,{disabled:c,children:[n(ae,{isFullScreen:!1,disableFullscreenMode:!0,target:A,children:[E&&r(b,{label:`Download as WAV`,icon:ie,onClick:Ee}),C&&r(b,{label:`Clear recording`,icon:re,onClick:De})]}),r(he,{isRecording:$,isPlaying:Oe,isUploading:h,isError:_,recordingUrlExists:!!E,startRecording:Ce,stopRecording:we,onClickPlayPause:()=>void ye(),onClear:Te,disabled:c||p}),n(fe,{children:[_&&r(ge,{}),Ae&&r(ve,{}),p&&r(_e,{}),r(pe,{"data-testid":`stAudioInputWaveSurfer`,ref:f,show:!je})]}),r(me,{isPlayingOrRecording:$||Oe,disabled:c,"data-testid":`stAudioInputWaveformTimeCode`,children:ke})]})]})});export{q as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/Autocomplete.D9k6mFCZ.js b/venv/Lib/site-packages/streamlit/static/static/js/Autocomplete.D9k6mFCZ.js new file mode 100644 index 0000000000000000000000000000000000000000..9c7963ef5653d1f0ebfa4a1d58d0e7c7b8736b4a --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/Autocomplete.D9k6mFCZ.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";var n=e(t(),1),r=(0,n.createContext)(null),i=(0,n.createContext)(null);export{r as n,i as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/Balloons.BQJiZ9SK.js b/venv/Lib/site-packages/streamlit/static/static/js/Balloons.BQJiZ9SK.js new file mode 100644 index 0000000000000000000000000000000000000000..e060bfcfc101c51b3cfb9e0a42b02dc836273008 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/Balloons.BQJiZ9SK.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{i as n,t as r}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{i}from"./emotion-react.browser.esm.B06RJmME.js";import{t as a}from"./UriUtil.olyUCSHN.js";import{n as o,t as s}from"./Particles.CD7975JF.js";var c=e(t(),1),l=``+new URL(`../media/balloon-0.Czj7AKwE.png`,import.meta.url).href,u=``+new URL(`../media/balloon-1.CNvFFrND.png`,import.meta.url).href,d=``+new URL(`../media/balloon-2.DTvC6B1t.png`,import.meta.url).href,f=``+new URL(`../media/balloon-3.CgSk4tbL.png`,import.meta.url).href,p=``+new URL(`../media/balloon-4.mbtFrzxf.png`,import.meta.url).href,m=``+new URL(`../media/balloon-5.CSwkUfRA.png`,import.meta.url).href,h=300,g=121,_=20,v=80,y=1e3,b=i(`from{transform:translateY(calc(100vh + `,h,`px));}to{transform:translateY(0);}`),x=r(`img`,{target:`e19msdho0`})(({theme:e})=>({position:`fixed`,top:`-300px`,marginLeft:`${-121/2}px`,zIndex:e.zIndices.balloons,left:`${Math.random()*(v-_)+_}vw`,animationDelay:`${Math.random()*y}ms`,height:`${h}px`,width:`${g}px`,pointerEvents:`none`,animationDuration:`750ms`,animationName:b,animationTimingFunction:`ease-in`,animationDirection:`normal`,animationIterationCount:1,opacity:1})),S=30,C=[l,u,d,f,p,m],w=C.length,T=({particleType:e,resourceCrossOriginMode:t})=>{let r=C[e];return n(x,{src:r,crossOrigin:a(t,r)})},E=(0,c.memo)(({scriptRunId:e})=>n(o,{children:n(s,{className:`stBalloons`,"data-testid":`stBalloons`,scriptRunId:e,numParticleTypes:w,numParticles:30,ParticleComponent:T})}));export{S as NUM_BALLOONS,E as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/BaseButton.DzUQ5vsa.js b/venv/Lib/site-packages/streamlit/static/static/js/BaseButton.DzUQ5vsa.js new file mode 100644 index 0000000000000000000000000000000000000000..d9c1353de6a646ea491ccfc84c76a1a3e13f3687 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/BaseButton.DzUQ5vsa.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{i as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{S as r,T as i,_ as a,b as o,d as s,f as c,h as l,i as u,l as d,m as f,n as p,p as m,r as h,t as g,u as _,v,w as y,x as b,y as x}from"./styled-components.B5oT30oI.js";var S=(0,e(t(),1).forwardRef)(function(e,t){let{kind:S,size:C,disabled:w,onClick:T,containerWidth:E,children:D,autoFocus:O}=e,k=a;return S===g.SECONDARY?k=x:S===g.TERTIARY?k=y:S===g.GHOST?k=_:S===g.PILLS?k=f:S===g.PILLS_ACTIVE?k=l:S===g.SEGMENTED_CONTROL?k=b:S===g.SEGMENTED_CONTROL_ACTIVE?k=r:S===g.BORDERLESS_ICON?k=h:S===g.BORDERLESS_ICON_ACTIVE?k=u:S===g.MINIMAL?k=m:S===g.PRIMARY_FORM_SUBMIT?k=v:S===g.SECONDARY_FORM_SUBMIT?k=o:S===g.TERTIARY_FORM_SUBMIT?k=i:S===g.HEADER_BUTTON?k=s:S===g.HEADER_NO_PADDING?k=c:S===g.ELEMENT_TOOLBAR&&(k=d),n(k,{ref:t,kind:S,size:C??p.MEDIUM,containerWidth:E||!1,disabled:w||!1,onClick:T||(()=>{}),autoFocus:O||!1,"data-testid":e[`data-testid`]??`stBaseButton-${S}`,"aria-label":e[`aria-label`]??``,"aria-haspopup":e[`aria-haspopup`],"aria-expanded":e[`aria-expanded`],children:D})});export{S as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/BaseButtonTooltip.DyFZqtoX.js b/venv/Lib/site-packages/streamlit/static/static/js/BaseButtonTooltip.DyFZqtoX.js new file mode 100644 index 0000000000000000000000000000000000000000..8ea2344046bb634973cc5a6b14fb6dc1c9b48ed2 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/BaseButtonTooltip.DyFZqtoX.js @@ -0,0 +1 @@ +import{a as e,i as t,r as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{u as r}from"./StreamlitMarkdown.DJLoxxnS.js";import{t as i}from"./Tooltip.PNC8NIZa.js";import{D as a,O as o}from"./styled-components.B5oT30oI.js";function s({children:s,help:c,placement:l,containerWidth:u}){return c?e(n,{children:[t(o,{children:t(r,{content:c,placement:l||i.TOP,containerWidth:u,children:s})}),t(a,{children:s})]}):s}export{s as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/BidiComponent.B_vvnuke.js b/venv/Lib/site-packages/streamlit/static/static/js/BidiComponent.B_vvnuke.js new file mode 100644 index 0000000000000000000000000000000000000000..34f4d4c157ffdb938ca6c7fd73b03747b7a0e12b --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/BidiComponent.B_vvnuke.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{i as n,t as r}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as i}from"./loglevel.BJBYxGId.js";import{t as a}from"./toString.tRXNBxtF.js";import{t as o}from"./_arrayReduce.CiwPAjrV.js";import{C as s}from"./getColors.DtAxY2Hd.js";import{t as c}from"./useCrossOriginAttribute.DBi7mGp8.js";import{t as l}from"./useEmotionTheme.D29Ufy6b.js";import{t as u}from"./ErrorElement.BWmlOcKX.js";import{t as d}from"./preload-helper.HclGiUj8.js";import{t as f}from"./useRequiredContext.F4hG38Ff.js";import{t as p}from"./serialization.yxLiAHgz.js";import{t as m}from"./v4.DDdyfk2q.js";import{t as h}from"./ErrorHandling.H5STbbYb.js";function g(e){return function(t){return e?.[t]}}var _=g({À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`s`}),v=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,y=RegExp(`[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]`,`g`);function b(e){return e=a(e),e&&e.replace(v,_).replace(y,``)}var x=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function S(e){return e.match(x)||[]}var C=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function w(e){return C.test(e)}var T=`\\ud800-\\udfff`,ee=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,E=`\\u2700-\\u27bf`,D=`a-z\\xdf-\\xf6\\xf8-\\xff`,te=`\\xac\\xb1\\xd7\\xf7`,ne=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,re=`\\u2000-\\u206f`,ie=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,O=`A-Z\\xc0-\\xd6\\xd8-\\xde`,ae=`\\ufe0e\\ufe0f`,k=te+ne+re+ie,A=`['’]`,j=`[`+k+`]`,oe=`[`+ee+`]`,M=`\\d+`,se=`[`+E+`]`,N=`[`+D+`]`,P=`[^`+T+k+M+E+D+O+`]`,ce=`(?:`+oe+`|\\ud83c[\\udffb-\\udfff])`,le=`[^`+T+`]`,F=`(?:\\ud83c[\\udde6-\\uddff]){2}`,I=`[\\ud800-\\udbff][\\udc00-\\udfff]`,L=`[`+O+`]`,ue=`\\u200d`,R=`(?:`+N+`|`+P+`)`,de=`(?:`+L+`|`+P+`)`,z=`(?:`+A+`(?:d|ll|m|re|s|t|ve))?`,B=`(?:`+A+`(?:D|LL|M|RE|S|T|VE))?`,V=ce+`?`,H=`[`+ae+`]?`,fe=`(?:`+ue+`(?:`+[le,F,I].join(`|`)+`)`+H+V+`)*`,pe=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,me=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,he=H+V+fe,ge=`(?:`+[se,F,I].join(`|`)+`)`+he,_e=RegExp([L+`?`+N+`+`+z+`(?=`+[j,L,`$`].join(`|`)+`)`,de+`+`+B+`(?=`+[j,L+R,`$`].join(`|`)+`)`,L+`?`+R+`+`+z,L+`+`+B,me,pe,M,ge].join(`|`),`g`);function ve(e){return e.match(_e)||[]}function ye(e,t,n){return e=a(e),t=n?void 0:t,t===void 0?w(e)?ve(e):S(e):e.match(t)||[]}var be=RegExp(`['’]`,`g`);function xe(e){return function(t){return o(ye(b(t).replace(be,``)),e,``)}}var Se=xe(function(e,t,n){return e+(n?`-`:``)+t.toLowerCase()}),U=e(t(),1),W=(0,U.createContext)(null);W.displayName=`BidiComponentContext`;var G=(0,e(i(),1).getLogger)(`BidiComponent`),K=`__streamlit_arrow_ref__`,Ce=`$$STREAMLIT_INTERNAL_KEY`,we=(e,t)=>{if(e&&typeof e==`object`&&!Array.isArray(e)){if(typeof e.__streamlit_arrow_ref__==`string`){let n=t[e[K]];if(n)try{return p(n)}catch{return null}return null}let n={};for(let[r,i]of Object.entries(e))if(i&&typeof i==`object`&&!Array.isArray(i)&&typeof i.__streamlit_arrow_ref__==`string`){let e=t[i[K]];if(e)try{n[r]=p(e)}catch{n[r]=null}else n[r]=null}else n[r]=i;return n}return e},Te=({arrowBlobs:e,arrowData:t,bytes:n,data:r,json:i,mixedJson:a})=>{switch(r){case`json`:return i?JSON.parse(i):null;case`arrowData`:return t??null;case`bytes`:return n??null;case`mixed`:if(a&&e){let t=JSON.parse(a),n={};return Object.entries(e).forEach(([e,t])=>{t?.data&&(n[e]=t.data)}),we(t,n)}return null;case`any`:case void 0:return null;default:s(r)}},Ee=(e,t=`--st`)=>{let n={};return Object.entries(e).forEach(([e,r])=>{let i=`${t}-${Se(e)}`;if(typeof r==`boolean`){n[i]=r?`1`:`0`;return}if(r==null){n[i]=`unset`;return}if(Array.isArray(r)){n[i]=r.join(`,`);return}if(typeof r==`number`||typeof r==`string`){n[i]=String(r);return}n[i]=`unset`}),n},De=e=>{let t=[e.fontSizes.h1FontSize,e.fontSizes.h2FontSize,e.fontSizes.h3FontSize,e.fontSizes.h4FontSize,e.fontSizes.h5FontSize,e.fontSizes.h6FontSize],n=[e.fontWeights.h1FontWeight,e.fontWeights.h2FontWeight,e.fontWeights.h3FontWeight,e.fontWeights.h4FontWeight,e.fontWeights.h5FontWeight,e.fontWeights.h6FontWeight];return{primaryColor:e.colors.primary,backgroundColor:e.colors.bgColor,secondaryBackgroundColor:e.colors.secondaryBg,textColor:e.colors.bodyText,linkColor:e.colors.link,linkUnderline:e.linkUnderline,headingFont:e.genericFonts.headingFont,codeFont:e.genericFonts.codeFont,baseRadius:e.radii.default,buttonRadius:e.radii.button,baseFontSize:typeof e.fontSizes.baseFontSize==`number`?`${e.fontSizes.baseFontSize}px`:String(e.fontSizes.baseFontSize),baseFontWeight:e.fontWeights.normal,codeFontWeight:e.fontWeights.code,codeFontSize:e.fontSizes.codeFontSize,headingFontSizes:t,headingFontSize1:t[0],headingFontSize2:t[1],headingFontSize3:t[2],headingFontSize4:t[3],headingFontSize5:t[4],headingFontSize6:t[5],headingFontWeights:n,headingFontWeight1:n[0],headingFontWeight2:n[1],headingFontWeight3:n[2],headingFontWeight4:n[3],headingFontWeight5:n[4],headingFontWeight6:n[5],borderColor:e.colors.borderColor,dataframeBorderColor:e.colors.dataframeBorderColor,dataframeHeaderBackgroundColor:e.colors.dataframeHeaderBackgroundColor,codeBackgroundColor:e.colors.codeBackgroundColor,font:e.genericFonts.bodyFont,chartCategoricalColors:e.colors.chartCategoricalColors,chartSequentialColors:e.colors.chartSequentialColors,chartDivergingColors:e.colors.chartDivergingColors,headingColor:e.colors.headingColor,borderColorLight:e.colors.borderColorLight,codeTextColor:e.colors.codeTextColor,widgetBorderColor:e.colors.widgetBorderColor||`transparent`,redColor:e.colors.redColor,orangeColor:e.colors.orangeColor,yellowColor:e.colors.yellowColor,blueColor:e.colors.blueColor,greenColor:e.colors.greenColor,violetColor:e.colors.violetColor,grayColor:e.colors.grayColor,redBackgroundColor:e.colors.redBackgroundColor,orangeBackgroundColor:e.colors.orangeBackgroundColor,yellowBackgroundColor:e.colors.yellowBackgroundColor,blueBackgroundColor:e.colors.blueBackgroundColor,greenBackgroundColor:e.colors.greenBackgroundColor,violetBackgroundColor:e.colors.violetBackgroundColor,grayBackgroundColor:e.colors.grayBackgroundColor,redTextColor:e.colors.redTextColor,orangeTextColor:e.colors.orangeTextColor,yellowTextColor:e.colors.yellowTextColor,blueTextColor:e.colors.blueTextColor,greenTextColor:e.colors.greenTextColor,violetTextColor:e.colors.violetTextColor,grayTextColor:e.colors.grayTextColor,metricValueFontSize:e.fontSizes.metricValueFontSize,metricValueFontWeight:e.fontWeights.metricValueFontWeight}},Oe=(0,U.memo)(({element:e,children:t,widgetMgr:r,fragmentId:i,componentRegistry:a})=>{let{arrowData:o,bytes:s,componentName:c,cssContent:u,cssSourcePath:d,data:f,htmlContent:p,id:m,jsContent:g,json:_,jsSourcePath:v,mixed:y}=e,b=(0,U.useMemo)(()=>({id:e.id,formId:e.formId}),[e.id,e.formId]),x=(0,U.useCallback)(()=>{let e=r.getJsonValue(b);if(!e)return{};try{return JSON.parse(e)}catch(e){let t=h(e);return G.warn(`Failed to parse widget JSON value; returning empty object.`,{widgetId:b.id,formId:b.formId,error:t.message}),{}}},[b,r]),S=(0,U.useMemo)(()=>Te({arrowBlobs:y?.arrowBlobs||void 0,arrowData:o?.data||void 0,bytes:s,data:f,json:_,mixedJson:y?.json||void 0}),[f,_,o?.data,s,y?.json,y?.arrowBlobs]),C=l(),w=(0,U.useMemo)(()=>De(C),[C]),T=(0,U.useMemo)(()=>({componentName:c,componentRegistry:a,cssContent:u?.trim(),cssSourcePath:d||void 0,data:S,fragmentId:i,getWidgetValue:x,htmlContent:p?.trim(),id:m,formId:e.formId||void 0,jsContent:g||void 0,jsSourcePath:v||void 0,theme:w,widgetMgr:r}),[c,a,u,d,i,x,p,m,e.formId,g,v,S,w,r]);return n(W.Provider,{value:T,children:t})}),q=(e,t)=>{if(e instanceof Error)return e;let n=t?`${t}: ${String(e)}`:String(e);return Error(n)},J=(e,t,n)=>{let r=q(e,n);G.error(`BidiComponent Error: ${r.message}`,e),t(r)},ke=(e,t)=>{try{let n=document.createRange().createContextualFragment(e);t.appendChild(n)}catch(n){G.warn(`createContextualFragment failed, falling back to innerHTML`,n),t.innerHTML=e}},Y=({containerRef:e,setError:t,skip:n=!1})=>{let r=(0,U.useRef)(null),{htmlContent:i,cssContent:a,cssSourcePath:o,componentName:s,componentRegistry:{getBidiComponentURL:l}}=f(W),u=(0,U.useMemo)(()=>{if(o)return l(s,o)},[s,o,l]),d=c(u);return(0,U.useEffect)(()=>{if(n)return;let o=e.current;if(o)try{if(r.current?.parentNode===o&&o.removeChild(r.current),r.current=document.createElement(`div`),i){let e=document.createElement(`div`);ke(i,e),r.current.appendChild(e)}if(a){let e=document.createElement(`style`);e.textContent=a,r.current.appendChild(e)}else if(u){let e=document.createElement(`link`);e.href=u,e.rel=`stylesheet`,d&&(e.crossOrigin=d),e.onerror=()=>{J(Error(`Failed to load CSS from ${u}`),t)},r.current.appendChild(e)}o.appendChild(r.current)}catch(e){J(e,t,`Failed to process HTML/CSS content`)}},[i,a,e,d,u,t,n]),r},Ae=new class{constructor(){this.hashSeed=2166136261,this.hashPrime=16777619,this.cache=new Map}computeHash(e){let t=this.hashSeed;for(let n=0;n>>0,this.hashPrime)>>>0;return(t>>>0).toString(16)}getOrCreateUrlForJs(e,t){let n=this.computeHash(e),r=this.cache.get(n);if(r)return{url:r,hash:n};let i=`${e}\n//# sourceURL=${t}-${n}.js`,a=new Blob([i],{type:`text/javascript`}),o=URL.createObjectURL(a);return this.cache.set(n,o),{url:o,hash:n}}},je=`events`;function X(e){if(e.includes(`__`))throw Error(`Base component id must not contain the delimiter sequence`);return`${Ce}_${e}__${je}`}var Z=async({componentId:e,componentIdForWidgetMgr:t,componentName:n,data:r,formId:i,fragmentId:a,getWidgetValue:o,moduleUrl:s,parentElement:c,widgetMgr:l})=>{let u=await d(()=>import(s),[],import.meta.url);if(!u)throw Error(`JS module does not exist.`);if(!u.default||typeof u.default!=`function`)throw Error(`JS module does not have a default export function.`);return u.default({name:n,data:r,key:e,parentElement:c,setStateValue:(e,n)=>{let r;try{r={...o(),[e]:n}}catch(t){G.error(`Failed to get existing value for ${e}`,t),r={[e]:n}}l.setJsonValue({id:t,formId:i},r,{fromUi:!0},a)},setTriggerValue:(e,n)=>{if(i){G.warn(`BidiComponent: setTriggerValue ignored inside st.form. Triggers are not allowed in forms; use setStateValue and form submit instead.`);return}let r=X(t);l.setTriggerValue({id:r,formId:i},{fromUi:!0},a,{event:e,value:n})}})},Q=({containerRef:e,setError:t,skip:n=!1})=>{let r=`st-bidi-component-${(0,U.useMemo)(()=>m(),[])}`,{componentName:i,data:a,formId:o,fragmentId:s,getWidgetValue:c,id:l,jsContent:u,jsSourcePath:d,theme:p,widgetMgr:h,componentRegistry:{getBidiComponentURL:g}}=f(W),_=(0,U.useMemo)(()=>{if(d)return g(i,d)},[i,d,g]),v=(0,U.useRef)(),y=(0,U.useRef)(),b=(0,U.useRef)(!1);(0,U.useEffect)(()=>{let{current:d}=e;n||!u&&!_||!d||(async()=>{try{if(u){let{url:e}=Ae.getOrCreateUrlForJs(u,`st-bidi-${i}`);v.current=await Z({componentId:r,componentIdForWidgetMgr:l,componentName:i,data:a,formId:o,fragmentId:s,getWidgetValue:c,moduleUrl:e,parentElement:d,widgetMgr:h})}else if(_){let e=_;try{await new Promise((t,n)=>{let r=document.createElement(`script`);r.type=`module`,r.src=e,r.async=!0,r.onload=()=>t(),r.onerror=()=>n(Error(`Failed to load script from ${_}`)),document.head.appendChild(r),y.current=r}),v.current=await Z({componentId:r,componentIdForWidgetMgr:l,componentName:i,data:a,formId:o,fragmentId:s,getWidgetValue:c,moduleUrl:e,parentElement:d,widgetMgr:h})}catch(e){throw q(e,`Failed to load or execute script from ${_}`)}}}catch(e){b.current||J(e,t)}})()},[r,i,e,a,o,s,c,l,u,_,t,n,h,p]),(0,U.useEffect)(()=>()=>{b.current=!0;let e=v.current;e&&Promise.resolve(e).then(e=>{e?.()}).catch(e=>{G.error(`Failed to run custom component cleanup`,e)});let t=y.current;t?.parentNode&&t.parentNode.removeChild(t)},[])},Me=r(`div`,{target:`epzkg1s0`})(({cssCustomProperties:e})=>({...e,display:`contents`})),$=r(`div`,{target:`epzkg1s1`})({width:`100%`,height:`100%`}),Ne=(0,U.memo)(()=>{let e=(0,U.useRef)(null),t=(0,U.useRef)(null),[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(null),{id:s}=f(W);(0,U.useEffect)(()=>{if(e.current)try{if(e.current.shadowRoot){t.current=e.current.shadowRoot,i(!0);return}t.current=e.current.attachShadow({mode:`open`}),i(!0)}catch(e){J(e,o,`Failed to create shadow DOM`)}},[s]);let c=!r||!!a;return Y({containerRef:t,setError:o,skip:c}),Q({containerRef:t,setError:o,skip:c}),a?n(u,{name:`BidiComponent Error`,message:a.message,stack:a.stack}):n($,{ref:e,"data-testid":`stBidiComponentIsolated`})}),Pe=(0,U.memo)(()=>{let e=(0,U.useRef)(null),[t,r]=(0,U.useState)(null),i=!!t;return Y({containerRef:e,setError:r,skip:i}),Q({containerRef:e,setError:r,skip:i}),t?n(u,{name:`BidiComponent Error`,message:t.message,stack:t.stack}):n($,{ref:e,"data-testid":`stBidiComponentRegular`})}),Fe=({children:e})=>{let{theme:t}=f(W);return n(Me,{cssCustomProperties:(0,U.useMemo)(()=>Ee(t),[t]),children:e})},Ie=(0,U.memo)(({element:e,widgetMgr:t,fragmentId:r,componentRegistry:i})=>{let{isolateStyles:a}=e;return n(Oe,{element:e,widgetMgr:t,fragmentId:r,componentRegistry:i,children:n($,{className:`stBidiComponent`,children:n(Fe,{children:n(a?Ne:Pe,{})})})})});export{Ie as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/Button.CGPLwGvS.js b/venv/Lib/site-packages/streamlit/static/static/js/Button.CGPLwGvS.js new file mode 100644 index 0000000000000000000000000000000000000000..425226a50cc774d2f14694cbe20db6c79200a11d --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/Button.CGPLwGvS.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{i as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{o as r}from"./Tooltip.PNC8NIZa.js";import{n as i,t as a}from"./styled-components.B5oT30oI.js";import{t as o}from"./BaseButton.DzUQ5vsa.js";import{t as s}from"./BaseButtonTooltip.DyFZqtoX.js";import{i as c,t as l}from"./DynamicButtonLabel.UT8nPWDL.js";import{t as u}from"./iconPosition.CHJpUZea.js";var d=e(t(),1);function f(e){let{disabled:t,element:f,widgetMgr:p,fragmentId:m}=e,h=f.shortcut?f.shortcut:void 0,g=a.SECONDARY;f.type===`primary`?g=a.PRIMARY:f.type===`tertiary`&&(g=a.TERTIARY);let _=(0,d.useCallback)(()=>{t||p.setTriggerValue(f,{fromUi:!0},m)},[t,p,f,m]);return c({shortcut:h,disabled:t,onActivate:_}),n(r,{className:`stButton`,"data-testid":`stButton`,children:n(s,{help:f.help,containerWidth:!0,children:n(o,{kind:g,size:i.SMALL,disabled:t,containerWidth:!0,onClick:_,children:n(l,{icon:f.icon,iconPosition:u(f.iconPosition),label:f.label,shortcut:h})})})})}var p=(0,d.memo)(f);export{p as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/ButtonGroup.DO6jL9SN.js b/venv/Lib/site-packages/streamlit/static/static/js/ButtonGroup.DO6jL9SN.js new file mode 100644 index 0000000000000000000000000000000000000000..cf95be1ab2bb3292e1c0dd9d2c5982ebc0e8ab2d --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/ButtonGroup.DO6jL9SN.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as n,i as r}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{Xt as i}from"./utils.94RcZhG4.js";import{S as a,o}from"./protobuf.DC2L68b9.js";import{a as s}from"./utils.BrY_0PXX.js";import{t as c}from"./Tooltip.PNC8NIZa.js";import{C as l,E as u,a as d,g as f}from"./styled-components.B5oT30oI.js";import{t as p}from"./DynamicButtonLabel.UT8nPWDL.js";import{t as m}from"./WidgetLabel.CVV1ys75.js";import{t as h}from"./WidgetLabelHelpIconInline.DB6cihzP.js";import{n as g}from"./useBasicWidgetState.CpWukz_T.js";var _=e(t(),1);function v(e){let t=e.contentIcon,n=e.content??``;return t?`${t} ${n}`.trim():n}function y(e,t){for(let n=e.length-1;n>=0;n--)if(v(e[n])===t)return n;return-1}function b(e,t){let n=[];for(let r of t){let t=y(e,r);t>=0&&n.push(t)}return n}function x(e,t){return e.getStringArrayValue(t)}function S(e){return(e.default??[]).map(t=>{let n=e.options[t];return n?v(n):``}).filter(e=>e!==``)}function C(e){return e.rawValues??[]}function w(e,t,n,r){t.setStringArrayValue(e,n.value,{fromUi:n.fromUi},r)}function T(e){let{disabled:t,element:y,fragmentId:T,widgetMgr:E,widthConfig:D}=e,{clickMode:O,options:k,style:A,label:j,labelVisibility:M,help:N,required:P}=y,[F,I]=g({getStateFromWidgetMgr:x,getDefaultStateFromProto:S,getCurrStateFromProto:C,updateWidgetMgrState:w,element:y,widgetMgr:E,fragmentId:T,formClearBehavior:`resetValueOnly`,queryParamBinding:y.queryParamKey?{paramKey:y.queryParamKey,valueType:`string_array_value`,clearable:!0,urlFormat:`repeated`}:void 0}),L=s(D),R=(0,_.useRef)(null);(0,_.useEffect)(()=>{R.current&&(P?R.current.setAttribute(`aria-required`,`true`):R.current.removeAttribute(`aria-required`))},[P]),(0,_.useEffect)(()=>{if(F.length===0||b(k,F).length>0)return;let e=C(y);I({value:e.length>0?e:S(y),fromUi:!1})},[k,F,I,y]);let z=O===o.ClickMode.MULTI_SELECT?`multiple`:`single`,B=(0,_.useCallback)(e=>`${y.id}-${e}`,[y.id]),V=(0,_.useMemo)(()=>new Set(b(k,F).map(e=>B(e))),[k,F,B]),H=(0,_.useCallback)(e=>{if(e===`all`)return;let t=`${y.id}-`,n=[...e].map(e=>v(k[Number(String(e).slice(t.length))])),r=new Set(F);n.length===F.length&&n.every(e=>r.has(e))||I({value:n,fromUi:!0})},[k,F,I,y.id]),U=A===o.Style.PILLS,W=(0,_.useMemo)(()=>{let e=U?f:l,t=U?`pills`:`segmented_control`;return k.map((n,i)=>r(e,{id:B(i),"data-variant":t,$containerWidth:L,children:r(p,{icon:n.contentIcon??void 0,label:n.content??``,iconSize:`base`})},`${v(n)}-${i}`))},[k,U,L,B]);return n(d,{className:`stButtonGroup`,"data-testid":`stButtonGroup`,containerWidth:L,children:[r(m,{label:j,disabled:t,labelVisibility:i(M?.value??a.LabelVisibilityOptions.COLLAPSED),children:N&&r(h,{content:N,placement:c.TOP,label:j})}),r(u,{ref:R,selectionMode:z,selectedKeys:V,onSelectionChange:H,isDisabled:t,disallowEmptySelection:P&&z===`single`,"aria-label":y.label,$isPills:U,$containerWidth:L,children:W})]})}var E=(0,_.memo)(T);export{E as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/CameraInput.BGpQNOjY.js b/venv/Lib/site-packages/streamlit/static/static/js/CameraInput.BGpQNOjY.js new file mode 100644 index 0000000000000000000000000000000000000000..3df4120ec2ed99e7be470de7c6ed923e570e9712 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/CameraInput.BGpQNOjY.js @@ -0,0 +1 @@ +import{o as e,t}from"./rolldown-runtime.DAXXjFlN.js";import{r as n}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as r,i,r as a,t as o,y as s}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as c}from"./loglevel.BJBYxGId.js";import{t as l}from"./react-dom.DZwq-Xzd.js";import{D as u,Xt as d,wt as f}from"./utils.94RcZhG4.js";import{_ as p,z as m}from"./protobuf.DC2L68b9.js";import{t as h}from"./types.cZoyy9Y-.js";import{t as g}from"./isEqual.CgNOpGTC.js";import{n as _}from"./Icon.RiOK8SDN.js";import{t as v}from"./useEmotionTheme.D29Ufy6b.js";import{n as y,t as b}from"./Tooltip.PNC8NIZa.js";import{t as x}from"./styled-components.B5oT30oI.js";import{t as S}from"./BaseButton.DzUQ5vsa.js";import{n as ee}from"./FormClearHelper.D0Yt6KG5.js";import{t as C}from"./useTimeout.CUauXJkz.js";import{t as te}from"./useCalculatedDimensions.BnLCBgVi.js";import{t as w}from"./index.esm.DCRlH4DP.js";import{t as ne}from"./WidgetLabel.CVV1ys75.js";import{t as re}from"./WidgetLabelHelpIcon.BmvkC-YW.js";import{t as T}from"./isMobile.ZOwND-6T.js";import{n as E,t as D}from"./ProgressBar.C0SD2GrQ.js";import{t as O}from"./urls.B0fCYwet.js";import{t as k}from"./UploadFileInfo.WAP1L8Dh.js";var A=e(n()),j=A.forwardRef(function(e,t){return A.createElement(w,s({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),A.createElement(`rect`,{width:24,height:24,fill:`none`}),A.createElement(`path`,{d:`M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z`}))});j.displayName=`SwitchCamera`;var M=A.forwardRef(function(e,t){return A.createElement(w,s({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 8 8`},e,{ref:t}),A.createElement(`path`,{d:`M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z`}))});M.displayName=`Video`;var N=A.forwardRef(function(e,t){return A.createElement(w,s({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 8 8`},e,{ref:t}),A.createElement(`path`,{d:`M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z`}))});N.displayName=`X`;var P=e(c(),1),ie=e(l(),1);function F(e,t){switch(e){case`xsmall`:return{padding:`${t.spacing.twoXS} ${t.spacing.sm}`,fontSize:t.fontSizes.sm};case`small`:return{padding:`${t.spacing.twoXS} ${t.spacing.md}`};case`large`:return{padding:`${t.spacing.md} ${t.spacing.md}`};default:return{padding:`${t.spacing.xs} ${t.spacing.md}`}}}var I=o(`div`,{target:`e1mup35a0`})({position:`relative`,overflow:`hidden`,width:`100%`,objectFit:`contain`}),L=o(`div`,{target:`e1mup35a1`})(({theme:e,width:t})=>({backgroundColor:e.colors.secondaryBg,borderRadius:`${e.radii.default} ${e.radii.default} 0 0`,width:`100%`,height:t*9/16,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`})),ae=o(`p`,{target:`e1mup35a2`})(({theme:e})=>({marginTop:e.spacing.sm,textAlign:`center`})),oe=o(`img`,{target:`e1mup35a3`})(({theme:e,opacity:t})=>({borderRadius:`${e.radii.default} ${e.radii.default} 0 0`,objectFit:`contain`,opacity:t})),R=o(`a`,{target:`e1mup35a4`})(({theme:e})=>({color:e.colors.link,textDecoration:e.linkUnderline?`underline`:`none`,display:`block`})),se=o(`span`,{target:`e1mup35a5`})({display:`flex`,alignItems:`center`}),z=o(`div`,{target:`e1mup35a6`})(({theme:e})=>({position:`absolute`,top:e.spacing.lg,right:e.spacing.lg,zIndex:e.zIndices.priority,color:e.colors.fadedText40,mixBlendMode:`difference`,opacity:e.opacities.secondary})),B=o(`div`,{target:`e1mup35a7`})({height:`fit-content`,width:`100%`,position:`absolute`,bottom:0}),V=o(`button`,{target:`e1mup35a8`})(({theme:e})=>({position:`relative`,display:`inline-flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,backgroundColor:e.colors.lightenedBg05,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:`0 0 ${e.radii.default} ${e.radii.default}`,"&:hover":{borderColor:e.colors.primary,color:e.colors.primary},"&:active":{color:e.colors.white,borderColor:e.colors.primary,backgroundColor:e.colors.primary},"&:focus:not(:active)":{borderColor:e.colors.primary,color:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:e.colors.fadedText40,borderColor:e.colors.borderColor,backgroundColor:e.colors.lightenedBg05,cursor:`not-allowed`},fontWeight:e.fontWeights.normal,padding:`${e.spacing.xs} ${e.spacing.md}`,margin:e.spacing.none,lineHeight:e.lineHeights.base,color:`inherit`,width:`100%`,userSelect:`none`,"&:focus":{outline:`none`},"&:focus-visible":{boxShadow:e.shadows.focusRing},...F(`medium`,e)}));function H({disabled:e,onClick:t,children:n,progress:a}){return r(V,{disabled:e||!1,onClick:t||(()=>{}),progress:a||null,"data-testid":`stCameraInputButton`,children:[n,a?i(B,{children:i(D,{value:a,size:E.EXTRASMALL,squareTopCorners:!0})}):null]})}var U=(0,A.memo)(H),W=function(e){return e.USER=`user`,e.ENVIRONMENT=`environment`,e}({}),G=(0,A.memo)(({switchFacingMode:e})=>i(z,{"data-testid":`stCameraInputSwitchButton`,children:i(y,{content:`Switch camera`,placement:b.TOP_RIGHT,children:i(S,{kind:x.MINIMAL,onClick:e,children:i(_,{content:j,size:`twoXL`,color:u.white})})})})),K=e(t(((e,t)=>{(function(r,i){typeof e==`object`&&typeof t==`object`?t.exports=i(n()):typeof define==`function`&&define.amd?define([`react`],i):typeof e==`object`?e.Webcam=i(n()):r.Webcam=i(r.React)})(e,function(e){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(t&1&&(e=n(e)),t&8||t&4&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),t&2&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=`./src/react-webcam.tsx`)})({"./src/react-webcam.tsx":(function(e,t,n){n.r(t);var r=n(`react`),i=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n`u`||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(e){var t=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return t?new Promise(function(n,r){t.call(navigator,e,n,r)}):Promise.reject(Error(`getUserMedia is not implemented in this browser`))}))})();function s(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}t.default=function(e){i(t,e);function t(t){var n=e.call(this,t)||this;return n.canvas=null,n.ctx=null,n.requestUserMediaId=0,n.unmounted=!1,n.state={hasUserMedia:!1},n}return t.prototype.componentDidMount=function(){var e=this,t=e.state,n=e.props;if(this.unmounted=!1,!s()){n.onUserMediaError(`getUserMedia not supported`);return}t.hasUserMedia||this.requestUserMedia(),n.children&&typeof n.children!=`function`&&console.warn(`children must be a function`)},t.prototype.componentDidUpdate=function(e){var t=this.props;if(!s()){t.onUserMediaError(`getUserMedia not supported`);return}var n=JSON.stringify(e.audioConstraints)!==JSON.stringify(t.audioConstraints),r=JSON.stringify(e.videoConstraints)!==JSON.stringify(t.videoConstraints),i=e.minScreenshotWidth!==t.minScreenshotWidth,a=e.minScreenshotHeight!==t.minScreenshotHeight;(r||i||a)&&(this.canvas=null,this.ctx=null),(n||r)&&(this.stopAndCleanup(),this.requestUserMedia())},t.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},t.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map(function(t){e.removeTrack(t),t.stop()}),e.getAudioTracks().map(function(t){e.removeTrack(t),t.stop()})):e.stop())},t.prototype.stopAndCleanup=function(){var e=this.state;e.hasUserMedia&&(t.stopMediaStream(this.stream),e.src&&window.URL.revokeObjectURL(e.src))},t.prototype.getScreenshot=function(e){var t=this,n=t.state,r=t.props;if(!n.hasUserMedia)return null;var i=this.getCanvas(e);return i&&i.toDataURL(r.screenshotFormat,r.screenshotQuality)},t.prototype.getCanvas=function(e){var t=this,n=t.state,r=t.props;if(!this.video||!n.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var i=this.video.videoWidth,a=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var o=i/a;i=r.minScreenshotWidth||this.video.clientWidth,a=i/o,r.minScreenshotHeight&&a0?t[0]:typeof t==`object`&&t.ideal?t.ideal:null};MediaStreamTrack.getSources(function(e){var t=null,o=null;e.forEach(function(e){e.kind===`audio`?t=e.id:e.kind===`video`&&(o=e.id)});var s=a(n.audioConstraints);s&&(t=s);var c=a(n.videoConstraints);c&&(o=c),r(i(t),i(o))})}},t.prototype.handleUserMedia=function(e,t){var n=this.props;if(e||!t){this.setState({hasUserMedia:!1}),n.onUserMediaError(e);return}this.stream=t;try{this.video&&(this.video.srcObject=t),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(t)})}n.onUserMedia(t)},t.prototype.render=function(){var e=this,t=this,n=t.state,i=t.props,s=i.audio;i.forceScreenshotSourceSize;var c=i.disablePictureInPicture;i.onUserMedia,i.onUserMediaError,i.screenshotFormat,i.screenshotQuality,i.minScreenshotWidth,i.minScreenshotHeight,i.audioConstraints,i.videoConstraints,i.imageSmoothing;var l=i.mirrored,u=i.style,d=u===void 0?{}:u,f=i.children,p=o(i,[`audio`,`forceScreenshotSourceSize`,`disablePictureInPicture`,`onUserMedia`,`onUserMediaError`,`screenshotFormat`,`screenshotQuality`,`minScreenshotWidth`,`minScreenshotHeight`,`audioConstraints`,`videoConstraints`,`imageSmoothing`,`mirrored`,`style`,`children`]),m=l?a(a({},d),{transform:(d.transform||``)+` scaleX(-1)`}):d,h={getScreenshot:this.getScreenshot.bind(this)};return r.createElement(r.Fragment,null,r.createElement(`video`,a({autoPlay:!0,disablePictureInPicture:c,src:n.src,muted:!s,playsInline:!0,ref:function(t){e.video=t},style:m},p)),f&&f(h))},t.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:`image/webp`,screenshotQuality:.92},t}(r.Component)}),react:(function(t,n){t.exports=e})}).default})}))(),1),q=({width:e})=>r(L,{width:e,children:[i(_,{size:`threeXL`,color:u.gray60,content:M}),r(ae,{children:[`This app would like to use your camera.`,i(R,{href:O,rel:`noopener noreferrer`,target:`_blank`,children:`Learn how to allow access.`})]})]}),ce=(0,A.memo)(({handleCapture:e,width:t,disabled:n,clearPhotoInProgress:a,setClearPhotoInProgress:o,facingMode:s,setFacingMode:c,resolutionHeight:l,testOverride:u})=>{let[d,p]=(0,A.useState)(u||`pending`),m=(0,A.useRef)(null),[g,_]=(0,A.useState)(t),y=(0,A.useCallback)(f(1e3,_),[]);(0,A.useEffect)(()=>{y(t)},[t,y]);function b(){m.current!==null&&e(m.current.getScreenshot())}let x=v(),S=(0,A.useMemo)(()=>({height:{ideal:l},facingMode:s}),[l,s]),ee=(0,A.useMemo)(()=>({width:{ideal:g},facingMode:s}),[g,s]),C=h(l)?ee:S;return r(I,{"data-testid":`stCameraInputWebcamComponent`,children:[d!==`success`&&!n&&!a?i(q,{width:g}):T()&&i(G,{switchFacingMode:c}),i(L,{"data-testid":`stCameraInputWebcamStyledBox`,hidden:d!==`success`&&!n&&!a,width:g,children:!n&&i(K.default,{audio:!1,ref:m,screenshotFormat:`image/jpeg`,screenshotQuality:1,width:g,height:g*9/16,style:{borderRadius:`${x.radii.default} ${x.radii.default} 0 0`},onUserMediaError:()=>{p(`error`)},onUserMedia:()=>{p(`success`),o(!1)},videoConstraints:C,forceScreenshotSourceSize:!h(l)})}),i(U,{onClick:b,disabled:d!==`success`||n||a,children:`Take Photo`})]})}),J=`RESTORED_FROM_WIDGET`,le=150,ue=(0,P.getLogger)(`CameraInput`),Y=e=>new p({uploadedFileInfo:e.filter(e=>e.status.type===`uploaded`).map(e=>{let{name:t,size:n,status:r}=e,{fileId:i,fileUrls:a}=r;return new m({fileId:i,fileUrls:a,name:t,size:n})})}),de=(e,t)=>{let n=t.getFileUploaderStateValue(e);if(h(n))return{files:[],nextLocalId:1,imgSrc:null};let{uploadedFileInfo:r}=n;if(h(r)||r.length===0)return{files:[],nextLocalId:1,imgSrc:null};let i=1,a=r.map(e=>{let t=e.name,n=e.size,r=e.fileId,a=e.fileUrls,o=new k(t,n,i,{type:`uploaded`,fileId:r,fileUrls:a});return i+=1,o});return{files:a,nextLocalId:i,imgSrc:a.length>0?J:null}};function fe(e,t){return fetch(e).then(e=>e.arrayBuffer()).then(e=>new File([e],t,{type:`image/jpeg`}))}var X=(0,A.memo)(({element:e,widgetMgr:t,uploadClient:n,disabled:o,fragmentId:s,testOverride:c})=>{let{width:l,elementRef:u}=te(),f=(0,A.useRef)(null);f.current===null&&(f.current=de(e,t));let{files:p,nextLocalId:m,imgSrc:v}=f.current,y=(0,A.useRef)(m),[b,x]=(0,A.useState)(()=>p),S=(0,A.useRef)(b);(0,A.useLayoutEffect)(()=>{S.current=b},[b]);let[w,T]=(0,A.useState)(()=>v),[E,D]=(0,A.useState)(!1),[O,j]=(0,A.useState)(!0),[M,P]=(0,A.useState)(!1),[F,ae]=(0,A.useState)(W.USER),R=(0,A.useRef)([]),z=(0,A.useRef)(null),B=(0,A.useCallback)(()=>{R.current.length!==0&&(R.current.forEach(e=>e()),R.current=[])},[]),{clear:V,restart:H}=C(()=>{B()},le,{autoStart:!1}),G=(0,A.useCallback)(()=>new Promise(e=>{R.current.push(e),H()}),[H]);(0,A.useEffect)(()=>()=>{V(),B(),z.current=null},[V,B]);let K=(0,A.useCallback)(()=>{let e=y.current;return y.current+=1,e},[]),q=(0,A.useMemo)(()=>b.some(e=>e.status.type===`uploading`)?`updating`:`ready`,[b]),X=(0,A.useMemo)(()=>{if(b.length>0&&b[b.length-1].status.type===`uploading`)return b[b.length-1].status.progress},[b]),pe=(0,A.useCallback)(()=>{ae(e=>e===W.USER?W.ENVIRONMENT:W.USER)},[]),Z=(0,A.useCallback)(e=>S.current.find(t=>t.id===e),[]),me=(0,A.useCallback)(e=>{(0,ie.flushSync)(()=>{x(t=>[...t,e])})},[]),he=(0,A.useCallback)(e=>{x(t=>t.filter(t=>t.id!==e))},[]),Q=(0,A.useCallback)((e,t)=>{x(n=>n.map(n=>n.id===e?t:n))},[]),ge=(0,A.useCallback)((e,t)=>{D(!1);let n=Z(e);h(n)||n.status.type!==`uploading`||Q(n.id,n.setStatus({type:`uploaded`,fileId:t.fileId,fileUrls:t}))},[Z,Q]),$=(0,A.useCallback)((e,t)=>{let n=Z(t);if(h(n)||n.status.type!==`uploading`)return;let r=e.total?Math.round(e.loaded*100/e.total):0;n.status.progress!==r&&Q(t,n.setStatus({type:`uploading`,abortController:n.status.abortController,progress:r}))},[Z,Q]),_e=(0,A.useCallback)((t,r)=>{let i=new AbortController,a=new k(r.name,r.size,K(),{type:`uploading`,abortController:i,progress:1});me(a),n.uploadFile(e,t.uploadUrl,r,e=>$(e,a.id),i.signal).then(()=>ge(a.id,t)).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||Q(a.id,a.setStatus({type:`error`,errorMessage:e?e.toString():`Unknown error`}))})},[me,e,K,ge,$,Q,n]),ve=(0,A.useCallback)(e=>{let t=Z(e);h(t)||(t.status.type===`uploading`&&t.status.abortController.abort(),t.status.type===`uploaded`&&t.status.fileUrls.deleteUrl&&n.deleteFile(t.status.fileUrls.deleteUrl),he(e))},[Z,he,n]),ye=(0,A.useCallback)(e=>{if(e===null)return Promise.resolve();if(z.current)return z.current;T(e),D(!0),j(!1);let t=fe(e,`camera-input-${new Date().toISOString().replace(/:/g,`_`)}.jpg`).then(e=>n.fetchFileURLs([e]).then(t=>({file:e,fileUrls:t[0]}))).then(({file:e,fileUrls:t})=>_e(t,e)).then(G).then(()=>{j(!0)}).catch(e=>{ue.error(e)}).finally(()=>{z.current=null});return z.current=t,t},[n,_e,G]),be=(0,A.useCallback)(e=>{ye(e)},[ye]),xe=(0,A.useCallback)(()=>{b.length!==0&&(b.forEach(e=>ve(e.id)),T(null),P(!0))},[b,ve]);return(0,A.useEffect)(()=>{t.getFileUploaderStateValue(e)===void 0&&t.setFileUploaderStateValue(e,Y(b),{fromUi:!1},s)},[]),(0,A.useEffect)(()=>{if(q!==`ready`)return;let n=Y(b);g(n,t.getFileUploaderStateValue(e))||t.setFileUploaderStateValue(e,n,{fromUi:!0},s)},[q,b,t,e,s]),ee({element:e,widgetMgr:t,onFormCleared:(0,A.useCallback)(()=>{x([]),T(null);let n=Y([]);t.setFileUploaderStateValue(e,n,{fromUi:!0},s)},[e,s,t])}),r(I,{className:`stCameraInput`,"data-testid":`stCameraInput`,ref:u,children:[i(ne,{label:e.label,disabled:o,labelVisibility:d(e.labelVisibility?.value),children:e.help&&i(re,{content:e.help,label:e.label})}),w?r(a,{children:[i(L,{width:l,children:w!==J&&i(oe,{src:w,alt:`Snapshot`,opacity:E||!O?`50%`:`100%`,width:l,height:l*9/16})}),i(U,{onClick:xe,progress:X,disabled:!!X||o,children:X?`Uploading...`:r(se,{children:[i(_,{content:N,margin:`0 xs 0 0`,size:`sm`}),` Clear photo`]})})]}):i(ce,{handleCapture:be,width:l,disabled:o,clearPhotoInProgress:M,setClearPhotoInProgress:P,facingMode:F,setFacingMode:pe,resolutionHeight:e.resolutionHeight??void 0,testOverride:c})]})});export{X as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/Cancel.esm.CTWwYXdL.js b/venv/Lib/site-packages/streamlit/static/static/js/Cancel.esm.CTWwYXdL.js new file mode 100644 index 0000000000000000000000000000000000000000..9fe7aabc0d86160097ee6897ab39918d78070c9b --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/Cancel.esm.CTWwYXdL.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{y as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as r}from"./index.esm.DCRlH4DP.js";var i=e(t()),a=i.forwardRef(function(e,t){return i.createElement(r,n({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),i.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),i.createElement(`path`,{d:`M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm4.29 12.89a.996.996 0 11-1.41 1.41L12 13.41 9.11 16.3a.996.996 0 11-1.41-1.41L10.59 12 7.71 9.11A.996.996 0 119.12 7.7L12 10.59l2.89-2.89a.996.996 0 111.41 1.41L13.41 12l2.88 2.89z`}))});a.displayName=`Cancel`;export{a as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/ChatInput.DJI0M0Iq.js b/venv/Lib/site-packages/streamlit/static/static/js/ChatInput.DJI0M0Iq.js new file mode 100644 index 0000000000000000000000000000000000000000..81102ecad5d79140264e1cabdb7de7ce27c1b92e --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/ChatInput.DJI0M0Iq.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as n,i as r,r as i,t as a,y as o}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as s}from"./loglevel.BJBYxGId.js";import{Ct as c,bt as l,c as u}from"./utils.94RcZhG4.js";import{_ as d,s as f,z as ee}from"./protobuf.DC2L68b9.js";import{t as te}from"./types.cZoyy9Y-.js";import{t as p}from"./zip.DLtjLZjW.js";import{C as m}from"./getColors.DtAxY2Hd.js";import{i as h,r as ne,t as re}from"./Close.esm.DiV9yyug.js";import{n as g}from"./Icon.RiOK8SDN.js";import{t as ie}from"./DynamicIcon.44zobID_.js";import{t as ae}from"./useEmotionTheme.D29Ufy6b.js";import{n as oe,t as se}from"./Tooltip.PNC8NIZa.js";import{t as ce}from"./useWidgetManagerElementState.CbF0sesb.js";import{t as le}from"./useCalculatedDimensions.BnLCBgVi.js";import{t as _}from"./index.esm.DCRlH4DP.js";import{a as v,c as ue,h as de,i as fe,m as y,n as pe,r as me,s as he,t as ge}from"./utils.Ca1sxtey.js";import{t as _e}from"./useWindowDimensionsContext.HIxtcWyF.js";import"./src.ChOBTULJ.js";import{t as ve}from"./useWaveformController.By203ydw.js";import{t as b}from"./UploadFileInfo.WAP1L8Dh.js";import{t as ye}from"./InputInstructions.D7oNXsUt.js";import{t as be}from"./useTextInputAutoExpand.By9qSO8B.js";import{t as xe}from"./inputUtils.CD44xxT-.js";var x=e(t()),Se=x.forwardRef(function(e,t){return x.createElement(_,o({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),x.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),x.createElement(`path`,{d:`M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm-1-9c0-.55.45-1 1-1s1 .45 1 1v6c0 .55-.45 1-1 1s-1-.45-1-1V5zm6 6c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z`}))});Se.displayName=`MicNone`;var S=x.forwardRef(function(e,t){return x.createElement(_,o({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),x.createElement(`rect`,{width:24,height:24,fill:`none`}),x.createElement(`path`,{d:`M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z`}))});S.displayName=`Add`;var Ce=x.forwardRef(function(e,t){return x.createElement(_,o({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),x.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),x.createElement(`path`,{d:`M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0a.996.996 0 000-1.41l-6.59-6.59a.996.996 0 00-1.41 0l-6.6 6.58a.996.996 0 101.41 1.41L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1z`}))});Ce.displayName=`ArrowUpward`;var we=x.forwardRef(function(e,t){return x.createElement(_,o({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),x.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),x.createElement(`path`,{d:`M18 6.7l-8.48 8.48-3.54-3.54a.996.996 0 10-1.41 1.41l4.24 4.24c.39.39 1.02.39 1.41 0l9.18-9.18a.999.999 0 00-.01-1.42c-.37-.38-1-.38-1.39.01z`}))});we.displayName=`Check`;var Te=x.forwardRef(function(e,t){return x.createElement(_,o({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),x.createElement(`rect`,{width:24,height:24,fill:`none`}),x.createElement(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 11c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm0 4c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z`}))});Te.displayName=`ErrorOutline`;var Ee=x.forwardRef(function(e,t){return x.createElement(_,o({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),x.createElement(`rect`,{width:24,height:24,fill:`none`}),x.createElement(`path`,{d:`M8 6h8c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2H8c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2z`}))});Ee.displayName=`Stop`;var C=(0,e(s(),1).getLogger)(`ChatInput`),De=a(`div`,{target:`e1p9v2yr0`})(({isStretchHeight:e})=>({position:`relative`,display:`flex`,flexDirection:`column`,...e&&{height:`100%`}})),Oe=a(`div`,{target:`e1p9v2yr1`})(({theme:e,isStretchHeight:t})=>({backgroundColor:e.colors.secondaryBg,border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.widgetBorderColor??e.colors.transparent,position:`relative`,display:`flex`,flexDirection:`column`,alignItems:`stretch`,flex:1,paddingTop:e.spacing.md,paddingBottom:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg,gap:e.spacing.sm,borderRadius:e.radii.default,boxSizing:`border-box`,...t&&{height:`100%`},":focus-within":{borderColor:e.colors.primary}})),ke=a(`div`,{target:`e1p9v2yr2`})(({theme:e})=>({display:`flex`,flexWrap:`wrap`,gap:e.spacing.sm})),Ae=a(`div`,{target:`e1p9v2yr3`})(({theme:e,isStacked:t,hasExpandedHeight:n})=>({display:`flex`,flexDirection:n?`column`:`row`,alignItems:n?`stretch`:`center`,justifyContent:n?`flex-start`:`space-between`,width:`100%`,gap:e.spacing.sm,flexWrap:!n&&t?`wrap`:`nowrap`,...n&&{flex:1}})),je=a(`div`,{target:`e1p9v2yr4`})(({isStacked:e,hasExpandedHeight:t})=>({flex:e&&!t?`none`:1,width:e||t?`100%`:`auto`,order:e&&!t?-1:0,display:`flex`,alignItems:t?`stretch`:`center`,minWidth:0})),Me=a(`div`,{target:`e1p9v2yr5`})(({theme:e,hasExpandedHeight:t})=>({display:`flex`,flexDirection:`row`,flexShrink:0,gap:e.spacing.sm,alignItems:`center`,order:t?0:-1})),Ne=a(`div`,{target:`e1p9v2yr6`})(({theme:e})=>({display:`flex`,flexDirection:`row`,gap:e.spacing.sm,alignItems:`center`})),Pe=a(`div`,{target:`e1p9v2yr7`})(({theme:e})=>({display:`flex`,flexDirection:`row`,justifyContent:`space-between`,alignItems:`center`,width:`100%`,gap:e.spacing.sm})),Fe=a(`div`,{target:`e1p9v2yr8`})(({theme:e})=>({color:e.colors.fadedText60,fontSize:e.fontSizes.twoSm,textAlign:`right`,whiteSpace:`nowrap`,pointerEvents:`auto`,cursor:`text`,"& .stChatInputInstructions":{position:`static`}})),w=a(`button`,{target:`e1p9v2yr9`})(({theme:e,disabled:t,hasError:n,primary:r})=>r?{border:`none`,backgroundColor:t?e.colors.darkenedBgMix15:e.colors.primary,borderRadius:e.radii.button,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.xs,width:e.sizes.chatInputPrimaryButtonSize,height:e.sizes.chatInputPrimaryButtonSize,color:t?e.colors.fadedText40:e.colors.white,cursor:t?`not-allowed`:`pointer`,transition:`background-color 200ms ease`,"&:focus":{outline:`none`},":focus":{outline:`none`},"&:focus-visible":{boxShadow:e.shadows.focusRing},"&:hover":{backgroundColor:t?e.colors.darkenedBgMix15:e.colors.primary}}:{border:`none`,backgroundColor:e.colors.transparent,borderRadius:e.radii.default,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.none,color:n?e.colors.redTextColor:t?e.colors.fadedText40:e.colors.fadedText60,pointerEvents:`auto`,"&:focus":{outline:`none`},":focus":{outline:`none`},"&:focus-visible":{boxShadow:e.shadows.focusRing},"&:hover":{color:n?e.colors.redColor:e.colors.bodyText},"&:active":{color:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.fadedText40,cursor:`not-allowed`},"& svg":{width:e.iconSizes.lg,height:e.iconSizes.lg}}),Ie=a(`div`,{target:`e1p9v2yr10`})(({isRecording:e})=>({display:e?`flex`:`none`,flex:1,alignItems:`center`,minWidth:0})),Le=a(`div`,{target:`e1p9v2yr11`})(({theme:e})=>({position:`relative`,width:`100%`,height:e.sizes.chatInputPrimaryButtonSize,borderRadius:e.radii.default,overflow:`hidden`,"& > div":{position:`absolute`,inset:0}})),Re=a(`textarea`,{target:`e1p9v2yr12`})(({theme:e,$height:t,$maxHeight:n,$minHeight:r})=>({fontWeight:e.fontWeights.normal,lineHeight:e.lineHeights.inputWidget,height:t,maxHeight:n,minHeight:r,overflowY:`auto`,padding:`${e.spacing.twoXS} 0`,width:`100%`,border:`none`,outline:`none`,backgroundColor:`transparent`,fontFamily:`inherit`,fontSize:e.fontSizes.sm,color:`inherit`,boxSizing:`border-box`,resize:`none`,display:`block`,"&::placeholder":{color:e.colors.fadedText60},"&:disabled":{color:e.colors.fadedText40,WebkitTextFillColor:e.colors.fadedText40,cursor:`not-allowed`}})),T=(e,t)=>t===l.Directory?{...e,webkitdirectory:``,multiple:!0}:e,ze=(e,t)=>he(e,t)?{isValid:!0}:{isValid:!1,errorMessage:`${e.type||`This type of`} files are not allowed.`},Be=e=>{let t=Array.from(e.files);return t.length>0?t:Array.from(e.items).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null)},E=e=>{switch(e){case l.None:return`a file`;case l.Single:return`a file`;case l.Multiple:return`files`;case l.Directory:return`a directory`;default:return m(e),`a file`}},Ve=a(`div`,{target:`e1rizuwn0`})(({theme:e})=>({backgroundColor:e.colors.transparent,position:`absolute`,inset:0,zIndex:e.zIndices.priority,borderRadius:e.radii.chatInput})),D=a(`div`,{target:`e1rizuwn1`})(({theme:e})=>({position:`absolute`,inset:0,border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.primary,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,color:e.colors.primary,display:`flex`,alignItems:`center`,justifyContent:`center`,fontWeight:e.fontWeights.bold,pointerEvents:`none`,zIndex:e.zIndices.priority})),O=a(`div`,{target:`e1rizuwn2`})(({disabled:e})=>({pointerEvents:e?`none`:`auto`})),He=(0,x.memo)(({onDrop:e,multiple:t,accept:i,maxSize:a,acceptFile:o,disabled:s,fileTypes:c})=>{let{getRootProps:l,getInputProps:u}=de({onDrop:e,multiple:t,accept:i,maxSize:a,useFsAccessApi:!1}),d=T(u(),o),f=l({tabIndex:-1}),ee=()=>{let e=`Upload or drag and drop ${E(o)}`;return c&&c.length>0?`${e} (${fe(c)})`:e};return n(O,{"data-testid":`stChatInputFileUploadButton`,disabled:s,...f,children:[r(`input`,{...d}),r(oe,{content:ee(),placement:se.TOP,onMouseEnterDelay:500,children:r(w,{type:`button`,disabled:s,"aria-label":`Upload ${E(o)}`,children:r(g,{content:S,size:`xl`,color:`inherit`})})})]})}),Ue=(0,x.memo)(({getRootProps:e,getInputProps:t,acceptFile:a})=>{let o=T(t(),a);return n(i,{children:[r(Ve,{...e(),children:r(`input`,{...o})}),r(D,{children:`Drag and drop ${E(a)} here`})]})}),k=(e,t,n)=>{let r=[],i=[];return e.forEach(e=>{if(e.size>n){i.push({file:e,errors:[{code:y.FileTooLarge,message:`File is too large. Maximum size is ${n} bytes.`}]});return}let a=ze(e,t.fileType);if(!a.isValid){i.push({file:e,errors:[{code:y.FileInvalidType,message:a.errorMessage||`File type not allowed.`}]});return}r.push(e)}),{accepted:r,rejected:i}},We=({acceptMultipleFiles:e,maxFileSize:t,uploadClient:n,uploadFile:r,addFiles:i,getNextLocalFileId:a,deleteExistingFiles:o,onUploadComplete:s,element:c})=>(l,u)=>{if(l.length>0){let{accepted:e,rejected:n}=k(l,c,t);l=e,u=[...u,...n]}if(!e&&l.length===0&&u.length>1){let e=u.findIndex(e=>e.errors?.[0].code===y.TooManyFiles);e>=0&&(l.push(u[e].file),u.splice(e,1))}if(!e&&l.length>1){let[e,...t]=l;l=[e],u=[...u,...t.map(e=>({file:e,errors:[{code:y.TooManyFiles,message:`Only one file is allowed.`}]}))]}!e&&l.length>0&&o(),n.fetchFileURLs(l).then(e=>{p(e,l).forEach(([e,t])=>{r(e,t)})}).catch(e=>{i(l.map(t=>new b(t.name,t.size,a(),{type:`error`,errorMessage:e},t)))}),u.length>0&&i(u.map(e=>v(e,a(),t))),s()},Ge=({getNextLocalFileId:e,addFiles:t,updateFile:n,uploadClient:r,element:i,onUploadProgress:a,onUploadComplete:o})=>(s,c)=>{let l=c.webkitRelativePath||c.name,u=new AbortController,d=new b(l,c.size,e(),{type:`uploading`,abortController:u,progress:1},c);t([d]),r.uploadFile({formId:``,...i},s.uploadUrl,c,e=>a(e,d.id),u.signal).then(()=>o(d.id,s)).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||n(d.id,d.setStatus({type:`error`,errorMessage:e?e.toString():`Unknown error`}))})},Ke=(e,t,n)=>n.map(n=>n.id===e?t:n),qe=(e,t)=>t.find(t=>t.id===e);function A({disabled:e,element:t,widgetMgr:a,fragmentId:o,uploadClient:s,heightConfig:p}){let m=ae(),{placeholder:_,maxChars:v}=t,fe=(0,x.useRef)(0),y=(0,x.useRef)(null),he=(0,x.useRef)(!1),b=(0,x.useRef)(null),S=(0,x.useRef)(null),{width:T,elementRef:ze}=le(),{innerWidth:E,innerHeight:Ve}=_e(),[D,O]=(0,x.useState)(t.default),[k,A]=(0,x.useState)([]),[j,Je]=(0,x.useState)(!1),[M,Ye]=(0,x.useState)(!1),[N,P]=(0,x.useState)(null),[F,Xe]=(0,x.useState)(!1),[Ze,Qe]=(0,x.useState)(0),I=t.acceptAudio??!1,{scriptRunFinishedFragmentIds:$e,scriptRunFinishedSequence:L,scriptRunId:R,scriptRunState:z,stopScript:B}=(0,x.useContext)(ne),[V,H]=ce({widgetMgr:a,id:t.id,key:`submittedRunScope`,defaultValue:void 0}),U=t.submitMode;(0,x.useEffect)(()=>()=>{S.current&&S.current.abort()},[]);let et=(0,x.useRef)(!1),W=be({textareaRef:y,dependencies:[_,F]}),{updateScrollHeight:tt}=W;(0,x.useLayoutEffect)(()=>{T>0&&!et.current&&(et.current=!0,tt())},[T,tt]);let G=(0,x.useRef)(``),K=(0,x.useRef)(0),nt=(0,x.useRef)(null),rt=(0,x.useRef)(null),q=(0,x.useCallback)(e=>{let t=getComputedStyle(e);G.current=`${t.fontWeight} ${t.fontSize} ${t.fontFamily}`;let n=parseFloat(t.paddingLeft)||0,r=parseFloat(t.paddingRight)||0;K.current=e.clientWidth-n-r},[]);(0,x.useLayoutEffect)(()=>{let e=y.current;if(!e)return;q(e);let t=new ResizeObserver(()=>q(e));return t.observe(e),()=>t.disconnect()},[q,F]),(0,x.useEffect)(()=>{if(D===``){Xe(!1);return}if(F)return;let e=y.current;if(!e||((K.current<=0||!G.current)&&q(e),K.current<=0||!G.current))return;nt.current||(nt.current=document.createElement(`canvas`),rt.current=nt.current.getContext(`2d`));let t=rt.current;t&&(t.font=G.current,t.measureText(D).width>K.current-10&&Xe(!0))},[D,F,q]);let J=(0,x.useMemo)(()=>k.some(e=>e.status.type===`uploading`)?!1:D!==``||k.length>0,[k,D]),Y=c(t.acceptFile),X=ue(t.maxUploadSizeMb,me.Megabyte,me.Byte),it=(0,x.useCallback)(e=>A(t=>[...t,...e]),[]),at=(0,x.useCallback)(e=>{e.status.type===`uploading`&&e.status.abortController.abort(),e.status.type===`uploaded`&&e.status.fileUrls.deleteUrl&&s.deleteFile(e.status.fileUrls.deleteUrl).catch(e=>{C.error(`Failed to delete file from server:`,e)})},[s]),ot=(0,x.useCallback)(e=>{A(t=>{let n=qe(e,t);if(te(n))return t;at(n);let r=t.filter(t=>t.id!==e);return r.length===0&&Qe(e=>e+1),r})},[at]),st=(0,x.useRef)(null),ct=(0,x.useCallback)(e=>V===void 0?!1:V.fragmentId===null?e.length===0:e.includes(V.fragmentId),[V]);(0,x.useEffect)(()=>{V===void 0||L<=V.scriptRunFinishedSequence||R===V.scriptRunIdAtSubmit||(ct($e)||$e.length===0)&&H(void 0)},[$e,L,R,ct,V,H]);let lt=z===h.STOP_REQUESTED,ut=!e&&V!==void 0&&U!==f.SubmitMode.SUBMIT_MODE_SUBMIT,dt=ut&&U===f.SubmitMode.SUBMIT_MODE_STOP&&!lt,Z=ut,ft=(0,x.useRef)(!1);(0,x.useEffect)(()=>{ft.current&&!Z&&!e&&y.current?.focus(),ft.current=Z},[Z,e]);let pt=(0,x.useRef)(!1),mt=(0,x.useCallback)(()=>{if(z===h.RUNNING||z===h.RERUN_REQUESTED){B();return}pt.current=!0},[z,B]);(0,x.useEffect)(()=>{pt.current&&(z===h.RUNNING||z===h.RERUN_REQUESTED)&&(pt.current=!1,B())},[z,B]);let ht=(0,x.useCallback)(e=>{!e.file||e.status.type!==`error`||(A(t=>t.filter(t=>t.id!==e.id)),st.current&&st.current([e.file],[]))},[]),gt=(0,x.useCallback)(()=>new d({uploadedFileInfo:k.filter(e=>e.status.type===`uploaded`).map(e=>{let{name:t,size:n,status:r}=e,{fileId:i,fileUrls:a}=r;return new ee({fileId:i,fileUrls:a,name:t,size:n})})}),[k]),_t=()=>fe.current++,vt=We({acceptMultipleFiles:Y===l.Multiple||Y===l.Directory,maxFileSize:X,uploadClient:s,uploadFile:Ge({getNextLocalFileId:_t,addFiles:it,updateFile:(e,t)=>{A(n=>Ke(e,t,n))},uploadClient:s,element:t,onUploadProgress:(e,t)=>{A(n=>{let r=qe(t,n);if(te(r)||r.status.type!==`uploading`)return n;let i=e.total?Math.round(e.loaded*100/e.total):0;return r.status.progress===i?n:Ke(t,r.setStatus({type:`uploading`,abortController:r.status.abortController,progress:i}),n)})},onUploadComplete:(e,t)=>{A(n=>{let r=qe(e,n);return te(r)||r.status.type!==`uploading`?n:Ke(r.id,r.setStatus({type:`uploaded`,fileId:t.fileId,fileUrls:t}),n)})}}),addFiles:it,getNextLocalFileId:_t,deleteExistingFiles:()=>k.forEach(e=>ot(e.id)),onUploadComplete:()=>{y.current&&y.current.focus()},element:t});st.current=vt;let yt=(0,x.useCallback)(t=>{if(e||Z||Y===l.None||!t.clipboardData)return;let n=Be(t.clipboardData);n.length!==0&&(t.preventDefault(),st.current?.(n,[]))},[Y,e,Z]),{getRootProps:bt,getInputProps:xt}=de({onDrop:vt,multiple:Y===l.Multiple||Y===l.Directory,accept:ge(t.fileType),maxSize:X,disabled:e||Z,useFsAccessApi:!1}),St=(0,x.useCallback)(n=>{if(y.current&&y.current.focus(),!J&&!n||e||Z)return;let r=gt(),i={data:D,fileUploaderState:r,audioFileInfo:n};a.setChatInputValue(t,i,{fromUi:!0},o),U!==f.SubmitMode.SUBMIT_MODE_SUBMIT&&(pt.current=!1,H({fragmentId:o||null,scriptRunIdAtSubmit:R,scriptRunFinishedSequence:L})),k.length>0&&Qe(e=>e+1),A([]),O(``),Xe(!1),W.clearScrollHeight()},[J,e,Z,D,k.length,gt,a,t,o,W,U,R,L,H]),Ct=(0,x.useCallback)(async e=>{let n=new Date().toISOString().replace(/[:.]/g,`-`),r=new File([e],`audio-${n}.wav`,{type:`audio/wav`});try{Ye(!0);let e=await s.fetchFileURLs([r]);if(e.length===0)throw Error(`Failed to get upload URL for audio file`);let n=e[0];S.current=new AbortController,await s.uploadFile({formId:``,...t},n.uploadUrl,r,()=>{},S.current.signal);let i=new ee({fileId:n.fileId,fileUrls:n,name:r.name,size:r.size});St(i)}catch(e){C.error(`Audio upload failed:`,e),P(`Recording failed`),y.current&&y.current.focus()}finally{Ye(!1)}},[s,t,St]),wt=(0,x.useMemo)(()=>({onApprove:Ct,onPermissionDenied:()=>{let e=`Microphone access denied`;P(e),C.error(`Permission denied:`,e)},onError:e=>{P(`Recording failed`),C.error(`Recording error:`,e)},onRecordStart:()=>{P(null)}}),[Ct]),Q=ve({containerRef:b,sampleRate:t.audioSampleRate??void 0,events:wt}),Tt=(0,x.useCallback)(()=>{St()},[St]),Et=e=>{let{metaKey:t,ctrlKey:n,shiftKey:r}=e;xe(e)&&!r&&!n&&!t&&(e.preventDefault(),Tt())},Dt=e=>{let{value:t}=e.target;v!==0&&t.length>v||(O(t),tt(),N&&P(null))},Ot=(0,x.useCallback)(async t=>{t.preventDefault(),t.stopPropagation(),!(!I||e||Z||Q.state===`recording`)&&await Q.start()},[I,e,Z,Q]),kt=(0,x.useCallback)(()=>{Q.cancel(),y.current&&y.current.focus()},[Q]),At=(0,x.useCallback)(async()=>{let{blob:e}=await Q.stop();await Q.approve(e)},[Q]),jt=(0,x.useCallback)(e=>{Ot(e)},[Ot]),Mt=(0,x.useCallback)(()=>{At()},[At]),Nt=(0,x.useCallback)(()=>{y.current&&y.current.focus()},[]);(0,x.useEffect)(()=>{if(t.setValue&&!he.current){he.current=!0;let e=t.value||``;O(e)}},[t.setValue,t.value]),(0,x.useEffect)(()=>{he.current=!1},[t]),(0,x.useEffect)(()=>{let e=e=>{e.preventDefault(),e.stopPropagation(),!j&&e.dataTransfer?.types.includes(`Files`)&&Je(!0)},t=e=>{e.preventDefault(),e.stopPropagation(),j&&(e.clientX<=0&&e.clientY<=0||e.clientX>=E&&e.clientY>=Ve)&&Je(!1)},n=e=>{e.preventDefault(),e.stopPropagation(),j&&Je(!1)};return window.addEventListener(`dragover`,e),window.addEventListener(`drop`,n),window.addEventListener(`dragleave`,t),()=>{window.removeEventListener(`dragover`,e),window.removeEventListener(`drop`,n),window.removeEventListener(`dragleave`,t)}},[j,E,Ve]);let Pt=()=>dt?r(w,{onClick:mt,disabled:e,"data-testid":`stChatInputStopButton`,"aria-label":`Stop script`,primary:!0,children:r(g,{content:Ee,size:`lg`,color:`inherit`})}):r(w,{onClick:Tt,disabled:!J||e||Z||M,"data-testid":`stChatInputSubmitButton`,"aria-label":`Send message`,primary:!0,children:r(g,{content:Ce,size:`lg`,color:`inherit`})}),Ft=Y!==l.None&&j,$=Q.state===`recording`,It=!$&&T>u(m.breakpoints.hideWidgetDetails)&&v>0,Lt=(0,x.useMemo)(()=>{if(!(!p||p.useContent)){if(p.useStretch)return`100%`;if(p.pixelHeight&&p.pixelHeight>0){let e=parseInt(m.sizes.borderWidth,10)||1,t=u(m.spacing.md)*2+e*2;return`${Math.max(0,p.pixelHeight-t)}px`}}},[p,m.sizes.borderWidth,m.spacing.md]),Rt=p?.useStretch??!1,zt=Rt||(p?.pixelHeight??0)>0,Bt=zt||W.isExtended;return r(De,{className:`stChatInput`,"data-testid":`stChatInput`,ref:ze,isStretchHeight:Rt,children:n(Oe,{isStretchHeight:Rt,children:[Ft&&r(Ue,{getRootProps:bt,getInputProps:xt,acceptFile:Y}),Y!==l.None&&k.length>0&&r(ke,{children:r(pe,{items:[...k],onDelete:ot,onRetry:ht})}),n(Ae,{isStacked:F,hasExpandedHeight:Bt&&!$,children:[!$&&r(je,{isStacked:F,hasExpandedHeight:Bt,children:r(Re,{"data-testid":`stChatInputTextArea`,ref:y,value:D,placeholder:_,onChange:Dt,onKeyDown:Et,onPaste:yt,"aria-label":_,disabled:e||Z,rows:1,"aria-describedby":It?`stChatInputInstructions`:void 0,$minHeight:Lt??m.sizes.chatInputTextareaMinHeight,$height:zt?`100%`:W.isExtended?W.height:`auto`,$maxHeight:zt?`none`:W.maxHeight})}),Bt&&!$?n(Pe,{children:[r(Me,{hasExpandedHeight:!0,children:Y!==l.None&&r(He,{onDrop:vt,multiple:Y===l.Multiple||Y===l.Directory,accept:ge(t.fileType),maxSize:X,acceptFile:Y,disabled:e||Z,fileTypes:t.fileType},Ze)}),n(Ne,{children:[It&&r(Fe,{onClick:Nt,id:`stChatInputInstructions`,children:r(ye,{dirty:J,value:D,maxLength:v,type:`chat`,inForm:!1,className:`stChatInputInstructions`})}),I&&r(i,{children:N?r(oe,{content:N,placement:se.TOP,error:!0,children:r(w,{onClick:jt,disabled:e||Z||M,hasError:!0,"data-testid":`stChatInputMicButton`,"aria-label":`Start recording`,children:r(g,{content:Te,size:`xl`,color:`inherit`})})}):r(w,{onClick:jt,disabled:e||Z||M,"data-testid":`stChatInputMicButton`,"aria-label":`Start recording`,children:r(g,{content:Se,size:`xl`,color:`inherit`})})}),Pt()]})]}):n(i,{children:[r(Me,{hasExpandedHeight:!1,children:Y!==l.None&&!$&&r(He,{onDrop:vt,multiple:Y===l.Multiple||Y===l.Directory,accept:ge(t.fileType),maxSize:X,acceptFile:Y,disabled:e||Z,fileTypes:t.fileType},Ze)}),r(Ie,{isRecording:$,children:r(Le,{ref:b})}),r(Ne,{children:$?n(i,{children:[r(w,{onClick:kt,disabled:e||Z,"data-testid":`stChatInputCancelButton`,"aria-label":`Cancel recording`,children:r(g,{content:re,size:`lg`,color:`inherit`})}),r(w,{onClick:Mt,disabled:e||Z||M,"data-testid":`stChatInputApproveButton`,"aria-label":`Submit recording`,children:M?r(ie,{size:`lg`,iconValue:`spinner`}):r(g,{content:we,size:`lg`,color:`inherit`})})]}):n(i,{children:[It&&r(Fe,{onClick:Nt,id:`stChatInputInstructions`,children:r(ye,{dirty:J,value:D,maxLength:v,type:`chat`,inForm:!1,className:`stChatInputInstructions`})}),I&&r(i,{children:N?r(oe,{content:N,placement:se.TOP,error:!0,children:r(w,{onClick:jt,disabled:e||Z||M,hasError:!0,"data-testid":`stChatInputMicButton`,"aria-label":`Start recording`,children:r(g,{content:Te,size:`xl`,color:`inherit`})})}):r(w,{onClick:jt,disabled:e||Z||M,"data-testid":`stChatInputMicButton`,"aria-label":`Start recording`,children:r(g,{content:Se,size:`xl`,color:`inherit`})})}),Pt()]})})]})]})]})})}var j=(0,x.memo)(A);export{j as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/Check.esm.B4TBPV6z.js b/venv/Lib/site-packages/streamlit/static/static/js/Check.esm.B4TBPV6z.js new file mode 100644 index 0000000000000000000000000000000000000000..fd3d1db7005f887089659c0aed0c14b0004ca34b --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/Check.esm.B4TBPV6z.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{y as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as r}from"./index.esm.DCRlH4DP.js";var i=e(t()),a=i.forwardRef(function(e,t){return i.createElement(r,n({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),i.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),i.createElement(`path`,{d:`M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z`}))});a.displayName=`Check`;export{a as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/Checkbox.CrcA6N0j.js b/venv/Lib/site-packages/streamlit/static/static/js/Checkbox.CrcA6N0j.js new file mode 100644 index 0000000000000000000000000000000000000000..6ce564c3628a00bb970da6dce2823296fc4146bc --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/Checkbox.CrcA6N0j.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as n,i as r,r as i}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{Xt as a}from"./utils.94RcZhG4.js";import{l as o}from"./protobuf.DC2L68b9.js";import{r as s}from"./StreamlitMarkdown.DJLoxxnS.js";import{t as c}from"./Tooltip.PNC8NIZa.js";import{a as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./styled-components.BwagcMZe.js";import{t as g}from"./WidgetLabelHelpIconInline.DB6cihzP.js";import{n as _}from"./useBasicWidgetState.CpWukz_T.js";var v=e(t(),1);function y({element:e,disabled:t,widgetMgr:y,fragmentId:w}){let[T,E]=_({getStateFromWidgetMgr:b,getDefaultStateFromProto:x,getCurrStateFromProto:S,updateWidgetMgrState:C,element:e,widgetMgr:y,fragmentId:w,formClearBehavior:`resetValueOnly`,queryParamBinding:e.queryParamKey?{paramKey:e.queryParamKey,valueType:`bool_value`,clearable:!1}:void 0}),D=(0,v.useCallback)(e=>{E({value:e,fromUi:!0})},[E]),O=e.type===o.StyleType.TOGGLE,k=n(u,{visibility:a(e.labelVisibility?.value),"data-testid":`stWidgetLabel`,children:[r(s,{source:e.label,allowHTML:!1,isLabel:!0}),e.help&&r(g,{content:e.help,placement:c.TOP_RIGHT,label:e.label})]});return O?r(h,{className:`row-widget stCheckbox`,"data-testid":`stCheckbox`,children:r(l,{isSelected:T,isDisabled:t,onChange:D,"aria-label":e.label,children:({isSelected:e,isHovered:t,isDisabled:a})=>n(i,{children:[r(m,{$isSelected:e,$isHovered:t,$isDisabled:a,children:r(f,{$isSelected:e,$isDisabled:a})}),k]})})}):r(h,{className:`row-widget stCheckbox`,"data-testid":`stCheckbox`,children:r(p,{isSelected:T,isDisabled:t,onChange:D,"aria-label":e.label,children:({isSelected:e,isFocusVisible:t,isDisabled:a})=>n(i,{children:[r(d,{$isSelected:e,$isFocusVisible:t,$isDisabled:a,children:e&&r(`svg`,{viewBox:`0 0 10 8`,"aria-hidden":`true`,children:r(`polyline`,{points:`1 4 4 7 9 1`})})}),k]})})})}function b(e,t){return e.getBoolValue(t)}function x(e){return e.default??!1}function S(e){return e.value??!1}function C(e,t,n,r){t.setBoolValue(e,n.value,{fromUi:n.fromUi},r)}var w=(0,v.memo)(y);export{w as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/Close.esm.DiV9yyug.js b/venv/Lib/site-packages/streamlit/static/static/js/Close.esm.DiV9yyug.js new file mode 100644 index 0000000000000000000000000000000000000000..abd3e924ee9121dc201c0a7df0ce961277437b97 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/Close.esm.DiV9yyug.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{y as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as r}from"./index.esm.DCRlH4DP.js";var i=e(t(),1),a=function(e){return e.NOT_RUNNING=`notRunning`,e.RUNNING=`running`,e.RERUN_REQUESTED=`rerunRequested`,e.STOP_REQUESTED=`stopRequested`,e.COMPILATION_ERROR=`compilationError`,e}({}),o=``,s=(0,i.createContext)({scriptRunState:a.NOT_RUNNING,scriptRunId:o,fragmentIdsThisRun:[],scriptRunFinishedSequence:0,scriptRunFinishedFragmentIds:[],stopScript:()=>{}});s.displayName=`ScriptRunContext`;var c=i.forwardRef(function(e,t){return i.createElement(r,n({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),i.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),i.createElement(`path`,{d:`M18.3 5.71a.996.996 0 00-1.41 0L12 10.59 7.11 5.7A.996.996 0 105.7 7.11L10.59 12 5.7 16.89a.996.996 0 101.41 1.41L12 13.41l4.89 4.89a.996.996 0 101.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z`}))});c.displayName=`Close`;export{a as i,o as n,s as r,c as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/CodeBlockCopyToolbar.D57Zh6DT.js b/venv/Lib/site-packages/streamlit/static/static/js/CodeBlockCopyToolbar.D57Zh6DT.js new file mode 100644 index 0000000000000000000000000000000000000000..a1d0b3329e5a8d008b76febad30c5f2a17edb9d3 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/CodeBlockCopyToolbar.D57Zh6DT.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{i as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{c as r,s as i}from"./ErrorElement.BWmlOcKX.js";import{t as a}from"./Check.esm.B4TBPV6z.js";import{t as o}from"./ContentCopy.esm.Dq-fIx3A.js";import{n as s}from"./Toolbar.BynU-Hbw.js";import{t as c}from"./useCopyToClipboard.31Hpj0n3.js";var l=e(t(),1);function u({text:e}){let{isCopied:t,copyToClipboard:u,label:d}=c(),f=(0,l.useCallback)(()=>{u(e)},[u,e]);return n(r,{children:n(i,{children:n(s,{label:d,icon:t?a:o,onClick:f})})})}var d=(0,l.memo)(u);export{d as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/ColorPicker.C_qg1qMx.js b/venv/Lib/site-packages/streamlit/static/static/js/ColorPicker.C_qg1qMx.js new file mode 100644 index 0000000000000000000000000000000000000000..dc2d6dd15f1c5f59f4789958289ddddd3cbbef56 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/ColorPicker.C_qg1qMx.js @@ -0,0 +1,27 @@ +import{o as e,t}from"./rolldown-runtime.DAXXjFlN.js";import{r as n}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as r,i,t as a}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{Xt as o,c as s}from"./utils.94RcZhG4.js";import{r as c}from"./_isIterateeCall.BUStsXAd.js";import{o as l}from"./isArrayLike.Crw2F5li.js";import{t as u}from"./merge.CkO-ckia.js";import{C as d}from"./StreamlitMarkdown.DJLoxxnS.js";import{t as f}from"./now.BzMxC3T_.js";import{n as p,t as m}from"./isUndefined.Dk8JX1dj.js";import{t as h}from"./map.CsK82nE3.js";import{t as g}from"./useEmotionTheme.D29Ufy6b.js";import{c as _,l as v,t as ee}from"./Tooltip.PNC8NIZa.js";import{n as y,r as te,t as ne}from"./useFloatingOverlay.DlcdWSVH.js";import{n as re}from"./useExecuteWhenChanged.CJi0fna4.js";import{S as b,b as x,d as S,f as C,m as w,v as T,x as E,y as D}from"./_hasPath.BAJp1Wyr.js";import{C as O,S as k,T as A,_ as ie,b as ae,c as oe,f as se,g as ce,h as j,i as le,l as ue,n as de,o as fe,r as pe,s as me,t as he,u as ge,v as _e,w as ve,x as ye,y as be}from"./_baseAssignValue.D38XrOT1.js";import{t as xe}from"./WidgetLabel.CVV1ys75.js";import{t as Se}from"./WidgetLabelHelpIconInline.DB6cihzP.js";import{n as Ce}from"./useBasicWidgetState.CpWukz_T.js";var M=e(n()),we=`Expected a function`,Te=Math.max,Ee=Math.min;function N(e,t,n){var r,i,a,o,s,u,d=0,p=!1,m=!1,h=!0;if(typeof e!=`function`)throw TypeError(we);t=c(t)||0,l(n)&&(p=!!n.leading,m=`maxWait`in n,a=m?Te(c(n.maxWait)||0,t):a,h=`trailing`in n?!!n.trailing:h);function g(t){var n=r,a=i;return r=i=void 0,d=t,o=e.apply(a,n),o}function _(e){return d=e,s=setTimeout(y,t),p?g(e):o}function v(e){var n=e-u,r=e-d,i=t-n;return m?Ee(i,a-r):i}function ee(e){var n=e-u,r=e-d;return u===void 0||n>=t||n<0||m&&r>=a}function y(){var e=f();if(ee(e))return te(e);s=setTimeout(y,v(e))}function te(e){return s=void 0,h&&r?g(e):(r=i=void 0,o)}function ne(){s!==void 0&&clearTimeout(s),d=0,r=u=i=s=void 0}function re(){return s===void 0?o:te(f())}function b(){var e=f(),n=ee(e);if(r=arguments,i=this,u=e,n){if(s===void 0)return _(u);if(m)return clearTimeout(s),s=setTimeout(y,t),g(u)}return s===void 0&&(s=setTimeout(y,t)),o}return b.cancel=ne,b.flush=re,b}var De=`Expected a function`;function Oe(e,t,n){var r=!0,i=!0;if(typeof e!=`function`)throw TypeError(De);return l(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),N(e,t,{leading:r,maxWait:t,trailing:i})}var ke=t(((e,t)=>{var n=x(),r=D(),i=T(),a=`[object String]`;function o(e){return typeof e==`string`||!r(e)&&i(e)&&n(e)==a}t.exports=o})),Ae=t(((e,t)=>{var n=ce();function r(e){return typeof e==`function`?e:n}t.exports=r})),je=t(((e,t)=>{var n=ie(),r=Ae();function i(e,t){return e&&n(e,r(t))}t.exports=i})),Me=t(((e,t)=>{t.exports=ae()(Object.getPrototypeOf,Object)})),Ne=t(((e,t)=>{var n=x(),r=Me(),i=T(),a=`[object Object]`,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=c.call(Object);function d(e){if(!i(e)||n(e)!=a)return!1;var t=r(e);if(t===null)return!0;var o=l.call(t,`constructor`)&&t.constructor;return typeof o==`function`&&o instanceof o&&c.call(o)==u}t.exports=d})),Pe=t(((e,t)=>{var n=de(),r=be();function i(e,t){var i=-1,a=r(e)?Array(e.length):[];return n(e,function(e,n,r){a[++i]=t(e,n,r)}),a}t.exports=i})),Fe=t(((e,t)=>{var n=C(),r=pe(),i=Pe(),a=D();function o(e,t){return(a(e)?n:i)(e,r(t,3))}t.exports=o})),Ie=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.flattenNames=void 0;var t=a(ke()),n=a(je()),r=a(Ne()),i=a(Fe());function a(e){return e&&e.__esModule?e:{default:e}}e.default=e.flattenNames=function e(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=[];return(0,i.default)(a,function(i){Array.isArray(i)?e(i).map(function(e){return o.push(e)}):(0,r.default)(i)?(0,n.default)(i,function(e,t){e===!0&&o.push(t),o.push(t+`-`+e)}):(0,t.default)(i)&&o.push(i)}),o}})),Le=t(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n{var n=he(),r=S(),i=Object.prototype.hasOwnProperty;function a(e,t,a){var o=e[t];(!(i.call(e,t)&&r(o,a))||a===void 0&&!(t in e))&&n(e,t,a)}t.exports=a})),ze=t(((e,t)=>{var n=Re(),r=he();function i(e,t,i,a){var o=!i;i||={};for(var s=-1,c=t.length;++s{var n=ze(),r=_e();function i(e,t){return e&&n(t,r(t),e)}t.exports=i})),Ve=t(((e,t)=>{function n(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}t.exports=n})),He=t(((e,t)=>{var n=w(),r=ye(),i=Ve(),a=Object.prototype.hasOwnProperty;function o(e){if(!n(e))return i(e);var t=r(e),o=[];for(var s in e)s==`constructor`&&(t||!a.call(e,s))||o.push(s);return o}t.exports=o})),Ue=t(((e,t)=>{var n=k(),r=He(),i=be();function a(e){return i(e)?n(e,!0):r(e)}t.exports=a})),We=t(((e,t)=>{var n=ze(),r=Ue();function i(e,t){return e&&n(t,r(t),e)}t.exports=i})),Ge=t(((e,t)=>{var n=b(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r?n.Buffer:void 0,o=a?a.allocUnsafe:void 0;function s(e,t){if(t)return e.slice();var n=e.length,r=o?o(n):new e.constructor(n);return e.copy(r),r}t.exports=s})),Ke=t(((e,t)=>{function n(e,t){var n=-1,r=e.length;for(t||=Array(r);++n{var n=ze(),r=me();function i(e,t){return n(e,r(e),t)}t.exports=i})),Je=t(((e,t)=>{var n=ge(),r=Me(),i=me(),a=oe();t.exports=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,i(e)),e=r(e);return t}:a})),Ye=t(((e,t)=>{var n=ze(),r=Je();function i(e,t){return n(e,r(e),t)}t.exports=i})),Xe=t(((e,t)=>{var n=ue(),r=Je(),i=Ue();function a(e){return n(e,i,r)}t.exports=a})),Ze=t(((e,t)=>{var n=Object.prototype.hasOwnProperty;function r(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]==`string`&&n.call(e,`index`)&&(r.index=e.index,r.input=e.input),r}t.exports=r})),Qe=t(((e,t)=>{var n=se();function r(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}t.exports=r})),$e=t(((e,t)=>{var n=Qe();function r(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}t.exports=r})),et=t(((e,t)=>{var n=/\w*$/;function r(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}t.exports=r})),tt=t(((e,t)=>{var n=E(),r=n?n.prototype:void 0,i=r?r.valueOf:void 0;function a(e){return i?Object(i.call(e)):{}}t.exports=a})),nt=t(((e,t)=>{var n=Qe();function r(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}t.exports=r})),rt=t(((e,t)=>{var n=Qe(),r=$e(),i=et(),a=tt(),o=nt(),s=`[object Boolean]`,c=`[object Date]`,l=`[object Map]`,u=`[object Number]`,d=`[object RegExp]`,f=`[object Set]`,p=`[object String]`,m=`[object Symbol]`,h=`[object ArrayBuffer]`,g=`[object DataView]`,_=`[object Float32Array]`,v=`[object Float64Array]`,ee=`[object Int8Array]`,y=`[object Int16Array]`,te=`[object Int32Array]`,ne=`[object Uint8Array]`,re=`[object Uint8ClampedArray]`,b=`[object Uint16Array]`,x=`[object Uint32Array]`;function S(e,t,S){var C=e.constructor;switch(t){case h:return n(e);case s:case c:return new C(+e);case g:return r(e,S);case _:case v:case ee:case y:case te:case ne:case re:case b:case x:return o(e,S);case l:return new C;case u:case p:return new C(e);case d:return i(e);case f:return new C;case m:return a(e)}}t.exports=S})),it=t(((e,t)=>{var n=w(),r=Object.create;t.exports=function(){function e(){}return function(t){if(!n(t))return{};if(r)return r(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}()})),at=t(((e,t)=>{var n=it(),r=Me(),i=ye();function a(e){return typeof e.constructor==`function`&&!i(e)?n(r(e)):{}}t.exports=a})),ot=t(((e,t)=>{var n=le(),r=T(),i=`[object Map]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),st=t(((e,t)=>{var n=ot(),r=ve(),i=O(),a=i&&i.isMap;t.exports=a?r(a):n})),ct=t(((e,t)=>{var n=le(),r=T(),i=`[object Set]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),lt=t(((e,t)=>{var n=ct(),r=ve(),i=O(),a=i&&i.isSet;t.exports=a?r(a):n})),ut=t(((e,t)=>{var n=j(),r=Le(),i=Re(),a=Be(),o=We(),s=Ge(),c=Ke(),l=qe(),u=Ye(),d=fe(),f=Xe(),p=le(),m=Ze(),h=rt(),g=at(),_=D(),v=A(),ee=st(),y=w(),te=lt(),ne=_e(),re=Ue(),b=1,x=2,S=4,C=`[object Arguments]`,T=`[object Array]`,E=`[object Boolean]`,O=`[object Date]`,k=`[object Error]`,ie=`[object Function]`,ae=`[object GeneratorFunction]`,oe=`[object Map]`,se=`[object Number]`,ce=`[object Object]`,ue=`[object RegExp]`,de=`[object Set]`,pe=`[object String]`,me=`[object Symbol]`,he=`[object WeakMap]`,ge=`[object ArrayBuffer]`,ve=`[object DataView]`,ye=`[object Float32Array]`,be=`[object Float64Array]`,xe=`[object Int8Array]`,Se=`[object Int16Array]`,Ce=`[object Int32Array]`,M=`[object Uint8Array]`,we=`[object Uint8ClampedArray]`,Te=`[object Uint16Array]`,Ee=`[object Uint32Array]`,N={};N[C]=N[T]=N[ge]=N[ve]=N[E]=N[O]=N[ye]=N[be]=N[xe]=N[Se]=N[Ce]=N[oe]=N[se]=N[ce]=N[ue]=N[de]=N[pe]=N[me]=N[M]=N[we]=N[Te]=N[Ee]=!0,N[k]=N[ie]=N[he]=!1;function De(e,t,w,T,E,D){var O,k=t&b,A=t&x,oe=t&S;if(w&&(O=E?w(e,T,E,D):w(e)),O!==void 0)return O;if(!y(e))return e;var se=_(e);if(se){if(O=m(e),!k)return c(e,O)}else{var j=p(e),le=j==ie||j==ae;if(v(e))return s(e,k);if(j==ce||j==C||le&&!E){if(O=A||le?{}:g(e),!k)return A?u(e,o(O,e)):l(e,a(O,e))}else{if(!N[j])return E?e:{};O=h(e,j,k)}}D||=new n;var ue=D.get(e);if(ue)return ue;D.set(e,O),te(e)?e.forEach(function(n){O.add(De(n,t,w,n,e,D))}):ee(e)&&e.forEach(function(n,r){O.set(r,De(n,t,w,r,e,D))});var de=se?void 0:(oe?A?f:d:A?re:ne)(e);return r(de||e,function(n,r){de&&(r=n,n=e[r]),i(O,r,De(n,t,w,r,e,D))}),O}t.exports=De})),dt=t(((e,t)=>{var n=ut(),r=1,i=4;function a(e){return n(e,r|i)}t.exports=a})),ft=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mergeClasses=void 0;var t=i(je()),n=i(dt()),r=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:[],a=e.default&&(0,n.default)(e.default)||{};return i.map(function(n){var i=e[n];return i&&(0,t.default)(i,function(e,t){a[t]||(a[t]={}),a[t]=r({},a[t],i[t])}),n}),a}})),pt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.autoprefix=void 0;var t=r(je()),n=Object.assign||function(e){for(var t=1;t{Object.defineProperty(e,"__esModule",{value:!0}),e.hover=void 0;var t=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:`span`;return function(i){s(c,i);function c(){var i,s,l,u;a(this,c);var d=[...arguments];return u=(s=(l=o(this,(i=c.__proto__||Object.getPrototypeOf(c)).call.apply(i,[this].concat(d))),l),l.state={hover:!1},l.handleMouseOver=function(){return l.setState({hover:!0})},l.handleMouseOut=function(){return l.setState({hover:!1})},l.render=function(){return r.default.createElement(n,{onMouseOver:l.handleMouseOver,onMouseOut:l.handleMouseOut},r.default.createElement(e,t({},l.props,l.state)))},s),o(l,u)}return c}(r.default.Component)}})),ht=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.active=void 0;var t=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:`span`;return function(i){s(c,i);function c(){var i,s,l,u;a(this,c);var d=[...arguments];return u=(s=(l=o(this,(i=c.__proto__||Object.getPrototypeOf(c)).call.apply(i,[this].concat(d))),l),l.state={active:!1},l.handleMouseDown=function(){return l.setState({active:!0})},l.handleMouseUp=function(){return l.setState({active:!1})},l.render=function(){return r.default.createElement(n,{onMouseDown:l.handleMouseDown,onMouseUp:l.handleMouseUp},r.default.createElement(e,t({},l.props,l.state)))},s),o(l,u)}return c}(r.default.Component)}})),gt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){var n={},r=function(e){n[e]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0};return e===0&&r(`first-child`),e===t-1&&r(`last-child`),(e===0||e%2==0)&&r(`even`),Math.abs(e%2)===1&&r(`odd`),r(`nth-child`,e),n}})),P=e(t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReactCSS=e.loop=e.handleActive=e.handleHover=e.hover=void 0;var t=s(Ie()),n=s(ft()),r=s(pt()),i=s(mt()),a=s(ht()),o=s(gt());function s(e){return e&&e.__esModule?e:{default:e}}e.hover=i.default,e.handleHover=i.default,e.handleActive=a.default,e.loop=o.default,e.default=e.ReactCSS=function(e){var i=[...arguments].slice(1),a=(0,t.default)(i),o=(0,n.default)(e,a);return(0,r.default)(o)}}))()),_t=function(e,t,n,r,i){var a=i.clientWidth,o=i.clientHeight,s=typeof e.pageX==`number`?e.pageX:e.touches[0].pageX,c=typeof e.pageY==`number`?e.pageY:e.touches[0].pageY,l=s-(i.getBoundingClientRect().left+window.pageXOffset),u=c-(i.getBoundingClientRect().top+window.pageYOffset);if(n===`vertical`){var d=void 0;if(d=u<0?0:u>o?1:Math.round(u*100/o)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:`rgb`}}else{var f=void 0;if(f=l<0?0:l>a?1:Math.round(l*100/a)/100,r!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:`rgb`}}return null},vt={},yt=function(e,t,n,r){if(typeof document>`u`&&!r)return null;var i=r?new r:document.createElement(`canvas`);i.width=n*2,i.height=n*2;var a=i.getContext(`2d`);return a?(a.fillStyle=e,a.fillRect(0,0,i.width,i.height),a.fillStyle=t,a.fillRect(0,0,n,n),a.translate(n,n),a.fillRect(0,0,n,n),i.toDataURL()):null},bt=function(e,t,n,r){var i=e+`-`+t+`-`+n+(r?`-server`:``);if(vt[i])return vt[i];var a=yt(e,t,n,r);return vt[i]=a,a},xt=Object.assign||function(e){for(var t=1;t-1},Lt=function(e){return Number(String(e).replace(/%/g,``))},Rt=1,I=function(e){Mt(t,e);function t(e){At(this,t);var n=jt(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.handleBlur=function(){n.state.blurValue&&n.setState({value:n.state.blurValue,blurValue:null})},n.handleChange=function(e){n.setUpdatedValue(e.target.value,e)},n.handleKeyDown=function(e){var t=Lt(e.target.value);if(!isNaN(t)&&It(e.keyCode)){var r=n.getArrowOffset(),i=e.keyCode===Pt?t+r:t-r;n.setUpdatedValue(i,e)}},n.handleDrag=function(e){if(n.props.dragLabel){var t=Math.round(n.props.value+e.movementX);t>=0&&t<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(t),e)}},n.handleMouseDown=function(e){n.props.dragLabel&&(e.preventDefault(),n.handleDrag(e),window.addEventListener(`mousemove`,n.handleDrag),window.addEventListener(`mouseup`,n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener(`mousemove`,n.handleDrag),window.removeEventListener(`mouseup`,n.handleMouseUp)},n.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},n.inputId=`rc-editable-input-`+Rt++,n}return Ot(t,[{key:`componentDidUpdate`,value:function(e,t){this.props.value!==this.state.value&&(e.value!==this.props.value||t.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:`componentWillUnmount`,value:function(){this.unbindEventListeners()}},{key:`getValueObjectWithLabel`,value:function(e){return kt({},this.props.label,e)}},{key:`getArrowOffset`,value:function(){return this.props.arrowOffset||Nt}},{key:`setUpdatedValue`,value:function(e,t){var n=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(n,t),this.setState({value:e})}},{key:`render`,value:function(){var e=this,t=(0,P.default)({default:{wrap:{position:`relative`}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:`ew-resize`}}},{"user-override":!0},this.props);return M.createElement(`div`,{style:t.wrap},M.createElement(`input`,{id:this.inputId,style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:`false`}),this.props.label&&!this.props.hideLabel?M.createElement(`label`,{htmlFor:this.inputId,style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(M.PureComponent||M.Component),zt=function(e,t,n,r){var i=r.clientWidth,a=r.clientHeight,o=typeof e.pageX==`number`?e.pageX:e.touches[0].pageX,s=typeof e.pageY==`number`?e.pageY:e.touches[0].pageY,c=o-(r.getBoundingClientRect().left+window.pageXOffset),l=s-(r.getBoundingClientRect().top+window.pageYOffset);if(t===`vertical`){var u=void 0;if(u=l<0?359:l>a?0:360*(-(l*100/a)+100)/100,n.h!==u)return{h:u,s:n.s,l:n.l,a:n.a,source:`hsl`}}else{var d=void 0;if(d=c<0?0:c>i?359:360*(c*100/i)/100,n.h!==d)return{h:d,s:n.s,l:n.l,a:n.a,source:`hsl`}}return null},Bt=function(){function e(e,t){for(var n=0;ni&&(c=i),l<0?l=0:l>a&&(l=a);var u=c/i,d=1-l/a;return{h:t.h,s:u,v:d,a:t.a,source:`hsv`}},Kt=function(){function e(e,t){for(var n=0;n=0;return!t&&r&&(e===`hex`||e===`hex6`||e===`hex3`||e===`hex4`||e===`hex8`||e===`name`)?e===`name`&&this._a===0?this.toName():this.toRgbString():(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return z(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(pn,arguments)},brighten:function(){return this._applyModification(mn,arguments)},darken:function(){return this._applyModification(hn,arguments)},desaturate:function(){return this._applyModification(un,arguments)},saturate:function(){return this._applyModification(dn,arguments)},greyscale:function(){return this._applyModification(fn,arguments)},spin:function(){return this._applyModification(gn,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(bn,arguments)},complement:function(){return this._applyCombination(_n,arguments)},monochromatic:function(){return this._applyCombination(xn,arguments)},splitcomplement:function(){return this._applyCombination(yn,arguments)},triad:function(){return this._applyCombination(vn,[3])},tetrad:function(){return this._applyCombination(vn,[4])}},z.fromRatio=function(e,t){if(Zt(e)==`object`){var n={};for(var r in e)e.hasOwnProperty(r)&&(r===`a`?n[r]=e[r]:n[r]=kn(e[r]));e=n}return z(e,t)};function en(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;return typeof e==`string`&&(e=Mn(e)),Zt(e)==`object`&&(W(e.r)&&W(e.g)&&W(e.b)?(t=tn(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):W(e.h)&&W(e.s)&&W(e.v)?(r=kn(e.s),i=kn(e.v),t=on(e.h,r,i),o=!0,s=`hsv`):W(e.h)&&W(e.s)&&W(e.l)&&(r=kn(e.s),a=kn(e.l),t=rn(e.h,r,a),o=!0,s=`hsl`),e.hasOwnProperty(`a`)&&(n=e.a)),n=Tn(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function tn(e,t,n){return{r:B(e,255)*255,g:B(t,255)*255,b:B(n,255)*255}}function nn(e,t,n){e=B(e,255),t=B(t,255),n=B(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=(r+i)/2;if(r==i)a=o=0;else{var c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(t===0)r=i=a=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),i=o(c,s,e),a=o(c,s,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function an(e,t,n){e=B(e,255),t=B(t,255),n=B(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=r,c=r-i;if(o=r===0?0:c/r,r==i)a=0;else{switch(r){case e:a=(t-n)/c+(t>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(z(r));return a}function xn(e,t){t||=6;for(var n=z(e).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(z({h:r,s:i,v:a})),a=(a+s)%1;return o}z.mix=function(e,t,n){n=n===0?0:n||50;var r=z(e).toRgb(),i=z(t).toRgb(),a=n/100;return z({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},z.readability=function(e,t){var n=z(e),r=z(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},z.isReadable=function(e,t,n){var r=z.readability(e,t),i,a=!1;switch(i=Nn(n),i.level+i.size){case`AAsmall`:case`AAAlarge`:a=r>=4.5;break;case`AAlarge`:a=r>=3;break;case`AAAsmall`:a=r>=7;break}return a},z.mostReadable=function(e,t,n){var r=null,i=0,a,o,s,c;n||={},o=n.includeFallbackColors,s=n.level,c=n.size;for(var l=0;li&&(i=a,r=z(t[l]));return z.isReadable(e,r,{level:s,size:c})||!o?r:(n.includeFallbackColors=!1,z.mostReadable(e,[`#fff`,`#000`],n))};var Sn=z.names={aliceblue:`f0f8ff`,antiquewhite:`faebd7`,aqua:`0ff`,aquamarine:`7fffd4`,azure:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`000`,blanchedalmond:`ffebcd`,blue:`00f`,blueviolet:`8a2be2`,brown:`a52a2a`,burlywood:`deb887`,burntsienna:`ea7e5d`,cadetblue:`5f9ea0`,chartreuse:`7fff00`,chocolate:`d2691e`,coral:`ff7f50`,cornflowerblue:`6495ed`,cornsilk:`fff8dc`,crimson:`dc143c`,cyan:`0ff`,darkblue:`00008b`,darkcyan:`008b8b`,darkgoldenrod:`b8860b`,darkgray:`a9a9a9`,darkgreen:`006400`,darkgrey:`a9a9a9`,darkkhaki:`bdb76b`,darkmagenta:`8b008b`,darkolivegreen:`556b2f`,darkorange:`ff8c00`,darkorchid:`9932cc`,darkred:`8b0000`,darksalmon:`e9967a`,darkseagreen:`8fbc8f`,darkslateblue:`483d8b`,darkslategray:`2f4f4f`,darkslategrey:`2f4f4f`,darkturquoise:`00ced1`,darkviolet:`9400d3`,deeppink:`ff1493`,deepskyblue:`00bfff`,dimgray:`696969`,dimgrey:`696969`,dodgerblue:`1e90ff`,firebrick:`b22222`,floralwhite:`fffaf0`,forestgreen:`228b22`,fuchsia:`f0f`,gainsboro:`dcdcdc`,ghostwhite:`f8f8ff`,gold:`ffd700`,goldenrod:`daa520`,gray:`808080`,green:`008000`,greenyellow:`adff2f`,grey:`808080`,honeydew:`f0fff0`,hotpink:`ff69b4`,indianred:`cd5c5c`,indigo:`4b0082`,ivory:`fffff0`,khaki:`f0e68c`,lavender:`e6e6fa`,lavenderblush:`fff0f5`,lawngreen:`7cfc00`,lemonchiffon:`fffacd`,lightblue:`add8e6`,lightcoral:`f08080`,lightcyan:`e0ffff`,lightgoldenrodyellow:`fafad2`,lightgray:`d3d3d3`,lightgreen:`90ee90`,lightgrey:`d3d3d3`,lightpink:`ffb6c1`,lightsalmon:`ffa07a`,lightseagreen:`20b2aa`,lightskyblue:`87cefa`,lightslategray:`789`,lightslategrey:`789`,lightsteelblue:`b0c4de`,lightyellow:`ffffe0`,lime:`0f0`,limegreen:`32cd32`,linen:`faf0e6`,magenta:`f0f`,maroon:`800000`,mediumaquamarine:`66cdaa`,mediumblue:`0000cd`,mediumorchid:`ba55d3`,mediumpurple:`9370db`,mediumseagreen:`3cb371`,mediumslateblue:`7b68ee`,mediumspringgreen:`00fa9a`,mediumturquoise:`48d1cc`,mediumvioletred:`c71585`,midnightblue:`191970`,mintcream:`f5fffa`,mistyrose:`ffe4e1`,moccasin:`ffe4b5`,navajowhite:`ffdead`,navy:`000080`,oldlace:`fdf5e6`,olive:`808000`,olivedrab:`6b8e23`,orange:`ffa500`,orangered:`ff4500`,orchid:`da70d6`,palegoldenrod:`eee8aa`,palegreen:`98fb98`,paleturquoise:`afeeee`,palevioletred:`db7093`,papayawhip:`ffefd5`,peachpuff:`ffdab9`,peru:`cd853f`,pink:`ffc0cb`,plum:`dda0dd`,powderblue:`b0e0e6`,purple:`800080`,rebeccapurple:`663399`,red:`f00`,rosybrown:`bc8f8f`,royalblue:`4169e1`,saddlebrown:`8b4513`,salmon:`fa8072`,sandybrown:`f4a460`,seagreen:`2e8b57`,seashell:`fff5ee`,sienna:`a0522d`,silver:`c0c0c0`,skyblue:`87ceeb`,slateblue:`6a5acd`,slategray:`708090`,slategrey:`708090`,snow:`fffafa`,springgreen:`00ff7f`,steelblue:`4682b4`,tan:`d2b48c`,teal:`008080`,thistle:`d8bfd8`,tomato:`ff6347`,turquoise:`40e0d0`,violet:`ee82ee`,wheat:`f5deb3`,white:`fff`,whitesmoke:`f5f5f5`,yellow:`ff0`,yellowgreen:`9acd32`},Cn=z.hexNames=wn(Sn);function wn(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function Tn(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function B(e,t){Dn(e)&&(e=`100%`);var n=On(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function En(e){return Math.min(1,Math.max(0,e))}function V(e){return parseInt(e,16)}function Dn(e){return typeof e==`string`&&e.indexOf(`.`)!=-1&&parseFloat(e)===1}function On(e){return typeof e==`string`&&e.indexOf(`%`)!=-1}function H(e){return e.length==1?`0`+e:``+e}function kn(e){return e<=1&&(e=e*100+`%`),e}function An(e){return Math.round(parseFloat(e)*255).toString(16)}function jn(e){return V(e)/255}var U=function(){var e=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,t=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`,n=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`;return{CSS_UNIT:new RegExp(e),rgb:RegExp(`rgb`+t),rgba:RegExp(`rgba`+n),hsl:RegExp(`hsl`+t),hsla:RegExp(`hsla`+n),hsv:RegExp(`hsv`+t),hsva:RegExp(`hsva`+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function W(e){return!!U.CSS_UNIT.exec(e)}function Mn(e){e=e.replace(Qt,``).replace($t,``).toLowerCase();var t=!1;if(Sn[e])e=Sn[e],t=!0;else if(e==`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};var n;return(n=U.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=U.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=U.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=U.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=U.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=U.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=U.hex8.exec(e))?{r:V(n[1]),g:V(n[2]),b:V(n[3]),a:jn(n[4]),format:t?`name`:`hex8`}:(n=U.hex6.exec(e))?{r:V(n[1]),g:V(n[2]),b:V(n[3]),format:t?`name`:`hex`}:(n=U.hex4.exec(e))?{r:V(n[1]+``+n[1]),g:V(n[2]+``+n[2]),b:V(n[3]+``+n[3]),a:jn(n[4]+``+n[4]),format:t?`name`:`hex8`}:(n=U.hex3.exec(e))?{r:V(n[1]+``+n[1]),g:V(n[2]+``+n[2]),b:V(n[3]+``+n[3]),format:t?`name`:`hex`}:!1}function Nn(e){var t,n;return e||={level:`AA`,size:`small`},t=(e.level||`AA`).toUpperCase(),n=(e.size||`small`).toLowerCase(),t!==`AA`&&t!==`AAA`&&(t=`AA`),n!==`small`&&n!==`large`&&(n=`small`),{level:t,size:n}}var Pn=function(e){var t=[`r`,`g`,`b`,`a`,`h`,`s`,`l`,`v`],n=0,r=0;return p(t,function(t){e[t]&&(n+=1,isNaN(e[t])||(r+=1),(t===`s`||t===`l`)&&/^\d+%$/.test(e[t])&&(r+=1))}),n===r&&e},Fn=function(e,t){var n=e.hex?z(e.hex):z(e),r=n.toHsl(),i=n.toHsv(),a=n.toRgb(),o=n.toHex();return r.s===0&&(r.h=t||0,i.h=t||0),{hsl:r,hex:o===`000000`&&a.a===0?`transparent`:`#`+o,rgb:a,hsv:i,oldHue:e.h||t||r.h,source:e.source}},G=function(e){if(e===`transparent`)return!0;var t=+(String(e).charAt(0)===`#`);return e.length!==4+t&&e.length<7+t&&z(e).isValid()},In=function(e){if(!e)return`#fff`;var t=Fn(e);return t.hex===`transparent`?`rgba(0,0,0,0.4)`:(t.rgb.r*299+t.rgb.g*587+t.rgb.b*114)/1e3>=128?`#000`:`#fff`},Ln=function(e,t){var n=e.replace(`°`,``);return z(t+` (`+n+`)`)._ok},Rn=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:`span`;return function(n){qn(r,n);function r(){var e,t,n,i;Gn(this,r);var a=[...arguments];return i=(t=(n=Kn(this,(e=r.__proto__||Object.getPrototypeOf(r)).call.apply(e,[this].concat(a))),n),n.state={focus:!1},n.handleFocus=function(){return n.setState({focus:!0})},n.handleBlur=function(){return n.setState({focus:!1})},t),Kn(n,i)}return Wn(r,[{key:`render`,value:function(){return M.createElement(t,{onFocus:this.handleFocus,onBlur:this.handleBlur},M.createElement(e,Un({},this.props,this.state)))}}]),r}(M.Component)},Yn=Object.assign||function(e){for(var t=1;t{Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var o=24;e.default=function(e){var n=e.fill,i=n===void 0?`currentColor`:n,s=e.width,c=s===void 0?o:s,l=e.height,u=l===void 0?o:l,d=e.style,f=d===void 0?{}:d,p=a(e,[`fill`,`width`,`height`,`style`]);return r.default.createElement(`svg`,t({viewBox:`0 0 `+o+` `+o,style:t({fill:i,width:c,height:u},f)},p),r.default.createElement(`path`,{d:`M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z`}))}}))()),vr=function(){function e(e,t){for(var n=0;n1&&(e.a=1),n.props.onChange({h:n.props.hsl.h,s:n.props.hsl.s,l:n.props.hsl.l,a:Math.round(e.a*100)/100,source:`rgb`},t)):(e.h||e.s||e.l)&&(typeof e.s==`string`&&e.s.includes(`%`)&&(e.s=e.s.replace(`%`,``)),typeof e.l==`string`&&e.l.includes(`%`)&&(e.l=e.l.replace(`%`,``)),e.s==1?e.s=.01:e.l==1&&(e.l=.01),n.props.onChange({h:e.h||n.props.hsl.h,s:Number(m(e.s)?n.props.hsl.s:e.s),l:Number(m(e.l)?n.props.hsl.l:e.l),source:`hsl`},t))},n.showHighlight=function(e){e.currentTarget.style.background=`#eee`},n.hideHighlight=function(e){e.currentTarget.style.background=`transparent`},e.hsl.a!==1&&e.view===`hex`?n.state={view:`rgb`}:n.state={view:e.view},n}return vr(t,[{key:`render`,value:function(){var e=this,t=(0,P.default)({default:{wrap:{paddingTop:`16px`,display:`flex`},fields:{flex:`1`,display:`flex`,marginLeft:`-6px`},field:{paddingLeft:`6px`,width:`100%`},alpha:{paddingLeft:`6px`,width:`100%`},toggle:{width:`32px`,textAlign:`right`,position:`relative`},icon:{marginRight:`-4px`,marginTop:`12px`,cursor:`pointer`,position:`relative`},iconHighlight:{position:`absolute`,width:`24px`,height:`28px`,background:`#eee`,borderRadius:`4px`,top:`10px`,left:`12px`,display:`none`},input:{fontSize:`11px`,color:`#333`,width:`100%`,borderRadius:`2px`,border:`none`,boxShadow:`inset 0 0 0 1px #dadada`,height:`21px`,textAlign:`center`},label:{textTransform:`uppercase`,fontSize:`11px`,lineHeight:`11px`,color:`#969696`,textAlign:`center`,display:`block`,marginTop:`12px`},svg:{fill:`#333`,width:`24px`,height:`24px`,border:`1px transparent solid`,borderRadius:`5px`}},disableAlpha:{alpha:{display:`none`}}},this.props,this.state),n=void 0;return this.state.view===`hex`?n=M.createElement(`div`,{style:t.fields,className:`flexbox-fix`},M.createElement(`div`,{style:t.field},M.createElement(I,{style:{input:t.input,label:t.label},label:`hex`,value:this.props.hex,onChange:this.handleChange}))):this.state.view===`rgb`?n=M.createElement(`div`,{style:t.fields,className:`flexbox-fix`},M.createElement(`div`,{style:t.field},M.createElement(I,{style:{input:t.input,label:t.label},label:`r`,value:this.props.rgb.r,onChange:this.handleChange})),M.createElement(`div`,{style:t.field},M.createElement(I,{style:{input:t.input,label:t.label},label:`g`,value:this.props.rgb.g,onChange:this.handleChange})),M.createElement(`div`,{style:t.field},M.createElement(I,{style:{input:t.input,label:t.label},label:`b`,value:this.props.rgb.b,onChange:this.handleChange})),M.createElement(`div`,{style:t.alpha},M.createElement(I,{style:{input:t.input,label:t.label},label:`a`,value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view===`hsl`&&(n=M.createElement(`div`,{style:t.fields,className:`flexbox-fix`},M.createElement(`div`,{style:t.field},M.createElement(I,{style:{input:t.input,label:t.label},label:`h`,value:Math.round(this.props.hsl.h),onChange:this.handleChange})),M.createElement(`div`,{style:t.field},M.createElement(I,{style:{input:t.input,label:t.label},label:`s`,value:Math.round(this.props.hsl.s*100)+`%`,onChange:this.handleChange})),M.createElement(`div`,{style:t.field},M.createElement(I,{style:{input:t.input,label:t.label},label:`l`,value:Math.round(this.props.hsl.l*100)+`%`,onChange:this.handleChange})),M.createElement(`div`,{style:t.alpha},M.createElement(I,{style:{input:t.input,label:t.label},label:`a`,value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),M.createElement(`div`,{style:t.wrap,className:`flexbox-fix`},n,M.createElement(`div`,{style:t.toggle},M.createElement(`div`,{style:t.icon,onClick:this.toggleViews,ref:function(t){return e.icon=t}},M.createElement(_r.default,{style:t.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return e.hsl.a!==1&&t.view===`hex`?{view:`rgb`}:null}}]),t}(M.Component);Sr.defaultProps={view:`hex`};var Cr=function(){var e=(0,P.default)({default:{picker:{width:`12px`,height:`12px`,borderRadius:`6px`,transform:`translate(-6px, -1px)`,backgroundColor:`rgb(248, 248, 248)`,boxShadow:`0 1px 4px 0 rgba(0, 0, 0, 0.37)`}}});return M.createElement(`div`,{style:e.picker})},wr=function(){var e=(0,P.default)({default:{picker:{width:`12px`,height:`12px`,borderRadius:`6px`,boxShadow:`inset 0 0 0 1px #fff`,transform:`translate(-6px, -6px)`}}});return M.createElement(`div`,{style:e.picker})},Tr=function(e){var t=e.width,n=e.onChange,r=e.disableAlpha,i=e.rgb,a=e.hsl,o=e.hsv,s=e.hex,c=e.renderers,l=e.styles,d=l===void 0?{}:l,f=e.className,p=f===void 0?``:f,m=e.defaultView,h=(0,P.default)(u({default:{picker:{width:t,background:`#fff`,borderRadius:`2px`,boxShadow:`0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)`,boxSizing:`initial`,fontFamily:`Menlo`},saturation:{width:`100%`,paddingBottom:`55%`,position:`relative`,borderRadius:`2px 2px 0 0`,overflow:`hidden`},Saturation:{radius:`2px 2px 0 0`},body:{padding:`16px 16px 12px`},controls:{display:`flex`},color:{width:`32px`},swatch:{marginTop:`6px`,width:`16px`,height:`16px`,borderRadius:`8px`,position:`relative`,overflow:`hidden`},active:{absolute:`0px 0px 0px 0px`,borderRadius:`8px`,boxShadow:`inset 0 0 0 1px rgba(0,0,0,.1)`,background:`rgba(`+i.r+`, `+i.g+`, `+i.b+`, `+i.a+`)`,zIndex:`2`},toggles:{flex:`1`},hue:{height:`10px`,position:`relative`,marginBottom:`8px`},Hue:{radius:`2px`},alpha:{height:`10px`,position:`relative`},Alpha:{radius:`2px`}},disableAlpha:{color:{width:`22px`},alpha:{display:`none`},hue:{marginBottom:`0px`},swatch:{width:`10px`,height:`10px`,marginTop:`0px`}}},d),{disableAlpha:r});return M.createElement(`div`,{style:h.picker,className:`chrome-picker `+p},M.createElement(`div`,{style:h.saturation},M.createElement(Xt,{style:h.Saturation,hsl:a,hsv:o,pointer:wr,onChange:n})),M.createElement(`div`,{style:h.body},M.createElement(`div`,{style:h.controls,className:`flexbox-fix`},M.createElement(`div`,{style:h.color},M.createElement(`div`,{style:h.swatch},M.createElement(`div`,{style:h.active}),M.createElement(F,{renderers:c}))),M.createElement(`div`,{style:h.toggles},M.createElement(`div`,{style:h.hue},M.createElement(L,{style:h.Hue,hsl:a,pointer:Cr,onChange:n})),M.createElement(`div`,{style:h.alpha},M.createElement(Dt,{style:h.Alpha,rgb:i,hsl:a,pointer:Cr,renderers:c,onChange:n})))),M.createElement(Sr,{rgb:i,hsl:a,hex:s,view:m,onChange:n,disableAlpha:r})))};Tr.propTypes={width:R.default.oneOfType([R.default.string,R.default.number]),disableAlpha:R.default.bool,styles:R.default.object,defaultView:R.default.oneOf([`hex`,`rgb`,`hsl`])},Tr.defaultProps={width:225,disableAlpha:!1,styles:{}};var Er=K(Tr),Dr=function(e){var t=e.color,n=e.onClick,r=n===void 0?function(){}:n,i=e.onSwatchHover,a=e.active,o=(0,P.default)({default:{color:{background:t,width:`15px`,height:`15px`,float:`left`,marginRight:`5px`,marginBottom:`5px`,position:`relative`,cursor:`pointer`},dot:{absolute:`5px 5px 5px 5px`,background:In(t),borderRadius:`50%`,opacity:`0`}},active:{dot:{opacity:`1`}},"color-#FFFFFF":{color:{boxShadow:`inset 0 0 0 1px #ddd`},dot:{background:`#000`}},transparent:{dot:{background:`#000`}}},{active:a,"color-#FFFFFF":t===`#FFFFFF`,transparent:t===`transparent`});return M.createElement(q,{style:o.color,color:t,onClick:r,onHover:i,focusStyle:{boxShadow:`0 0 4px `+t}},M.createElement(`div`,{style:o.dot}))},Or=function(e){var t=e.hex,n=e.rgb,r=e.onChange,i=(0,P.default)({default:{fields:{display:`flex`,paddingBottom:`6px`,paddingRight:`5px`,position:`relative`},active:{position:`absolute`,top:`6px`,left:`5px`,height:`9px`,width:`9px`,background:t},HEXwrap:{flex:`6`,position:`relative`},HEXinput:{width:`80%`,padding:`0px`,paddingLeft:`20%`,border:`none`,outline:`none`,background:`none`,fontSize:`12px`,color:`#333`,height:`16px`},HEXlabel:{display:`none`},RGBwrap:{flex:`3`,position:`relative`},RGBinput:{width:`70%`,padding:`0px`,paddingLeft:`30%`,border:`none`,outline:`none`,background:`none`,fontSize:`12px`,color:`#333`,height:`16px`},RGBlabel:{position:`absolute`,top:`3px`,left:`0px`,lineHeight:`16px`,textTransform:`uppercase`,fontSize:`12px`,color:`#999`}}}),a=function(e,t){e.r||e.g||e.b?r({r:e.r||n.r,g:e.g||n.g,b:e.b||n.b,source:`rgb`},t):r({hex:e.hex,source:`hex`},t)};return M.createElement(`div`,{style:i.fields,className:`flexbox-fix`},M.createElement(`div`,{style:i.active}),M.createElement(I,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:`hex`,value:t,onChange:a}),M.createElement(I,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:`r`,value:n.r,onChange:a}),M.createElement(I,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:`g`,value:n.g,onChange:a}),M.createElement(I,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:`b`,value:n.b,onChange:a}))},kr=function(e){var t=e.onChange,n=e.onSwatchHover,r=e.colors,i=e.hex,a=e.rgb,o=e.styles,s=o===void 0?{}:o,c=e.className,l=c===void 0?``:c,d=(0,P.default)(u({default:{Compact:{background:`#f6f6f6`,radius:`4px`},compact:{paddingTop:`5px`,paddingLeft:`5px`,boxSizing:`initial`,width:`240px`},clear:{clear:`both`}}},s)),f=function(e,n){e.hex?G(e.hex)&&t({hex:e.hex,source:`hex`},n):t(e,n)};return M.createElement(Wt,{style:d.Compact,styles:s},M.createElement(`div`,{style:d.compact,className:`compact-picker `+l},M.createElement(`div`,null,h(r,function(e){return M.createElement(Dr,{key:e,color:e,active:e.toLowerCase()===i,onClick:f,onSwatchHover:n})}),M.createElement(`div`,{style:d.clear})),M.createElement(Or,{hex:i,rgb:a,onChange:f})))};kr.propTypes={colors:R.default.arrayOf(R.default.string),styles:R.default.object},kr.defaultProps={colors:`#4D4D4D.#999999.#FFFFFF.#F44E3B.#FE9200.#FCDC00.#DBDF00.#A4DD00.#68CCCA.#73D8FF.#AEA1FF.#FDA1FF.#333333.#808080.#cccccc.#D33115.#E27300.#FCC400.#B0BC00.#68BC00.#16A5A5.#009CE0.#7B64FF.#FA28FF.#000000.#666666.#B3B3B3.#9F0500.#C45100.#FB9E00.#808900.#194D33.#0C797D.#0062B1.#653294.#AB149E`.split(`.`),styles:{}},K(kr);var Ar=(0,P.handleHover)(function(e){var t=e.hover,n=e.color,r=e.onClick,i=e.onSwatchHover,a={position:`relative`,zIndex:`2`,outline:`2px solid #fff`,boxShadow:`0 0 5px 2px rgba(0,0,0,0.25)`},o=(0,P.default)({default:{swatch:{width:`25px`,height:`25px`,fontSize:`0`}},hover:{swatch:a}},{hover:t});return M.createElement(`div`,{style:o.swatch},M.createElement(q,{color:n,onClick:r,onHover:i,focusStyle:a}))}),jr=function(e){var t=e.width,n=e.colors,r=e.onChange,i=e.onSwatchHover,a=e.triangle,o=e.styles,s=o===void 0?{}:o,c=e.className,l=c===void 0?``:c,d=(0,P.default)(u({default:{card:{width:t,background:`#fff`,border:`1px solid rgba(0,0,0,0.2)`,boxShadow:`0 3px 12px rgba(0,0,0,0.15)`,borderRadius:`4px`,position:`relative`,padding:`5px`,display:`flex`,flexWrap:`wrap`},triangle:{position:`absolute`,border:`7px solid transparent`,borderBottomColor:`#fff`},triangleShadow:{position:`absolute`,border:`8px solid transparent`,borderBottomColor:`rgba(0,0,0,0.15)`}},"hide-triangle":{triangle:{display:`none`},triangleShadow:{display:`none`}},"top-left-triangle":{triangle:{top:`-14px`,left:`10px`},triangleShadow:{top:`-16px`,left:`9px`}},"top-right-triangle":{triangle:{top:`-14px`,right:`10px`},triangleShadow:{top:`-16px`,right:`9px`}},"bottom-left-triangle":{triangle:{top:`35px`,left:`10px`,transform:`rotate(180deg)`},triangleShadow:{top:`37px`,left:`9px`,transform:`rotate(180deg)`}},"bottom-right-triangle":{triangle:{top:`35px`,right:`10px`,transform:`rotate(180deg)`},triangleShadow:{top:`37px`,right:`9px`,transform:`rotate(180deg)`}}},s),{"hide-triangle":a===`hide`,"top-left-triangle":a===`top-left`,"top-right-triangle":a===`top-right`,"bottom-left-triangle":a===`bottom-left`,"bottom-right-triangle":a===`bottom-right`}),f=function(e,t){return r({hex:e,source:`hex`},t)};return M.createElement(`div`,{style:d.card,className:`github-picker `+l},M.createElement(`div`,{style:d.triangleShadow}),M.createElement(`div`,{style:d.triangle}),h(n,function(e){return M.createElement(Ar,{color:e,key:e,onClick:f,onSwatchHover:i})}))};jr.propTypes={width:R.default.oneOfType([R.default.string,R.default.number]),colors:R.default.arrayOf(R.default.string),triangle:R.default.oneOf([`hide`,`top-left`,`top-right`,`bottom-left`,`bottom-right`]),styles:R.default.object},jr.defaultProps={width:200,colors:[`#B80000`,`#DB3E00`,`#FCCB00`,`#008B02`,`#006B76`,`#1273DE`,`#004DCF`,`#5300EB`,`#EB9694`,`#FAD0C3`,`#FEF3BD`,`#C1E1C5`,`#BEDADC`,`#C4DEF6`,`#BED3F3`,`#D4C4FB`],triangle:`top-left`,styles:{}},K(jr);var Mr=function(e){var t=e.direction,n=(0,P.default)({default:{picker:{width:`18px`,height:`18px`,borderRadius:`50%`,transform:`translate(-9px, -1px)`,backgroundColor:`rgb(248, 248, 248)`,boxShadow:`0 1px 4px 0 rgba(0, 0, 0, 0.37)`}},vertical:{picker:{transform:`translate(-3px, -9px)`}}},{vertical:t===`vertical`});return M.createElement(`div`,{style:n.picker})},Nr=Object.assign||function(e){for(var t=1;t.5});return M.createElement(`div`,{style:n.picker})},Lr=function(){var e=(0,P.default)({default:{triangle:{width:0,height:0,borderStyle:`solid`,borderWidth:`4px 0 4px 6px`,borderColor:`transparent transparent transparent #fff`,position:`absolute`,top:`1px`,left:`1px`},triangleBorder:{width:0,height:0,borderStyle:`solid`,borderWidth:`5px 0 5px 8px`,borderColor:`transparent transparent transparent #555`},left:{Extend:`triangleBorder`,transform:`translate(-13px, -4px)`},leftInside:{Extend:`triangle`,transform:`translate(-8px, -5px)`},right:{Extend:`triangleBorder`,transform:`translate(20px, -14px) rotate(180deg)`},rightInside:{Extend:`triangle`,transform:`translate(-8px, -5px)`}}});return M.createElement(`div`,{style:e.pointer},M.createElement(`div`,{style:e.left},M.createElement(`div`,{style:e.leftInside})),M.createElement(`div`,{style:e.right},M.createElement(`div`,{style:e.rightInside})))},Rr=function(e){var t=e.onClick,n=e.label,r=e.children,i=e.active,a=(0,P.default)({default:{button:{backgroundImage:`linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)`,border:`1px solid #878787`,borderRadius:`2px`,height:`20px`,boxShadow:`0 1px 0 0 #EAEAEA`,fontSize:`14px`,color:`#000`,lineHeight:`20px`,textAlign:`center`,marginBottom:`10px`,cursor:`pointer`}},active:{button:{boxShadow:`0 0 0 1px #878787`}}},{active:i});return M.createElement(`div`,{style:a.button,onClick:t},n||r)},zr=function(e){var t=e.rgb,n=e.currentColor,r=(0,P.default)({default:{swatches:{border:`1px solid #B3B3B3`,borderBottom:`1px solid #F0F0F0`,marginBottom:`2px`,marginTop:`1px`},new:{height:`34px`,background:`rgb(`+t.r+`,`+t.g+`, `+t.b+`)`,boxShadow:`inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000`},current:{height:`34px`,background:n,boxShadow:`inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000`},label:{fontSize:`14px`,color:`#000`,textAlign:`center`}}});return M.createElement(`div`,null,M.createElement(`div`,{style:r.label},`new`),M.createElement(`div`,{style:r.swatches},M.createElement(`div`,{style:r.new}),M.createElement(`div`,{style:r.current})),M.createElement(`div`,{style:r.label},`current`))},Br=function(){function e(e,t){for(var n=0;n100&&(e.a=100),e.a/=100,t({h:r.h,s:r.s,l:r.l,a:e.a,source:`rgb`},i))};return M.createElement(`div`,{style:o.fields,className:`flexbox-fix`},M.createElement(`div`,{style:o.double},M.createElement(I,{style:{input:o.input,label:o.label},label:`hex`,value:i.replace(`#`,``),onChange:s})),M.createElement(`div`,{style:o.single},M.createElement(I,{style:{input:o.input,label:o.label},label:`r`,value:n.r,onChange:s,dragLabel:`true`,dragMax:`255`})),M.createElement(`div`,{style:o.single},M.createElement(I,{style:{input:o.input,label:o.label},label:`g`,value:n.g,onChange:s,dragLabel:`true`,dragMax:`255`})),M.createElement(`div`,{style:o.single},M.createElement(I,{style:{input:o.input,label:o.label},label:`b`,value:n.b,onChange:s,dragLabel:`true`,dragMax:`255`})),M.createElement(`div`,{style:o.alpha},M.createElement(I,{style:{input:o.input,label:o.label},label:`a`,value:Math.round(n.a*100),onChange:s,dragLabel:`true`,dragMax:`100`})))},Kr=Object.assign||function(e){for(var t=1;t{Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var o=24;e.default=function(e){var n=e.fill,i=n===void 0?`currentColor`:n,s=e.width,c=s===void 0?o:s,l=e.height,u=l===void 0?o:l,d=e.style,f=d===void 0?{}:d,p=a(e,[`fill`,`width`,`height`,`style`]);return r.default.createElement(`svg`,t({viewBox:`0 0 `+o+` `+o,style:t({fill:i,width:c,height:u},f)},p),r.default.createElement(`path`,{d:`M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z`}))}}))()),ti=function(e){var t=e.color,n=e.onClick,r=n===void 0?function(){}:n,i=e.onSwatchHover,a=e.first,o=e.last,s=e.active,c=(0,P.default)({default:{color:{width:`40px`,height:`24px`,cursor:`pointer`,background:t,marginBottom:`1px`},check:{color:In(t),marginLeft:`8px`,display:`none`}},first:{color:{overflow:`hidden`,borderRadius:`2px 2px 0 0`}},last:{color:{overflow:`hidden`,borderRadius:`0 0 2px 2px`}},active:{check:{display:`block`}},"color-#FFFFFF":{color:{boxShadow:`inset 0 0 0 1px #ddd`},check:{color:`#333`}},transparent:{check:{color:`#333`}}},{first:a,last:o,active:s,"color-#FFFFFF":t===`#FFFFFF`,transparent:t===`transparent`});return M.createElement(q,{color:t,style:c.color,onClick:r,onHover:i,focusStyle:{boxShadow:`0 0 4px `+t}},M.createElement(`div`,{style:c.check},M.createElement(ei.default,null)))},ni=function(e){var t=e.onClick,n=e.onSwatchHover,r=e.group,i=e.active,a=(0,P.default)({default:{group:{paddingBottom:`10px`,width:`40px`,float:`left`,marginRight:`10px`}}});return M.createElement(`div`,{style:a.group},h(r,function(e,a){return M.createElement(ti,{key:e,color:e,active:e.toLowerCase()===i,first:a===0,last:a===r.length-1,onClick:t,onSwatchHover:n})}))},ri=function(e){var t=e.width,n=e.height,r=e.onChange,i=e.onSwatchHover,a=e.colors,o=e.hex,s=e.styles,c=s===void 0?{}:s,l=e.className,d=l===void 0?``:l,f=(0,P.default)(u({default:{picker:{width:t,height:n},overflow:{height:n,overflowY:`scroll`},body:{padding:`16px 0 6px 16px`},clear:{clear:`both`}}},c)),p=function(e,t){return r({hex:e,source:`hex`},t)};return M.createElement(`div`,{style:f.picker,className:`swatches-picker `+d},M.createElement(Wt,null,M.createElement(`div`,{style:f.overflow},M.createElement(`div`,{style:f.body},h(a,function(e){return M.createElement(ni,{key:e.toString(),group:e,active:o,onClick:p,onSwatchHover:i})}),M.createElement(`div`,{style:f.clear})))))};ri.propTypes={width:R.default.oneOfType([R.default.string,R.default.number]),height:R.default.oneOfType([R.default.string,R.default.number]),colors:R.default.arrayOf(R.default.arrayOf(R.default.string)),styles:R.default.object},ri.defaultProps={width:320,height:240,colors:[[J[900],J[700],J[500],J[300],J[100]],[Y[900],Y[700],Y[500],Y[300],Y[100]],[X[900],X[700],X[500],X[300],X[100]],[Z[900],Z[700],Z[500],Z[300],Z[100]],[Q[900],Q[700],Q[500],Q[300],Q[100]],[$[900],$[700],$[500],$[300],$[100]],[nr[900],nr[700],nr[500],nr[300],nr[100]],[rr[900],rr[700],rr[500],rr[300],rr[100]],[ir[900],ir[700],ir[500],ir[300],ir[100]],[`#194D33`,ar[700],ar[500],ar[300],ar[100]],[or[900],or[700],or[500],or[300],or[100]],[sr[900],sr[700],sr[500],sr[300],sr[100]],[cr[900],cr[700],cr[500],cr[300],cr[100]],[lr[900],lr[700],lr[500],lr[300],lr[100]],[ur[900],ur[700],ur[500],ur[300],ur[100]],[dr[900],dr[700],dr[500],dr[300],dr[100]],[fr[900],fr[700],fr[500],fr[300],fr[100]],[pr[900],pr[700],pr[500],pr[300],pr[100]],[`#000000`,`#525252`,`#969696`,`#D9D9D9`,`#FFFFFF`]],styles:{}},K(ri);var ii=function(e){var t=e.onChange,n=e.onSwatchHover,r=e.hex,i=e.colors,a=e.width,o=e.triangle,s=e.styles,c=s===void 0?{}:s,l=e.className,d=l===void 0?``:l,f=(0,P.default)(u({default:{card:{width:a,background:`#fff`,border:`0 solid rgba(0,0,0,0.25)`,boxShadow:`0 1px 4px rgba(0,0,0,0.25)`,borderRadius:`4px`,position:`relative`},body:{padding:`15px 9px 9px 15px`},label:{fontSize:`18px`,color:`#fff`},triangle:{width:`0px`,height:`0px`,borderStyle:`solid`,borderWidth:`0 9px 10px 9px`,borderColor:`transparent transparent #fff transparent`,position:`absolute`},triangleShadow:{width:`0px`,height:`0px`,borderStyle:`solid`,borderWidth:`0 9px 10px 9px`,borderColor:`transparent transparent rgba(0,0,0,.1) transparent`,position:`absolute`},hash:{background:`#F0F0F0`,height:`30px`,width:`30px`,borderRadius:`4px 0 0 4px`,float:`left`,color:`#98A1A4`,display:`flex`,alignItems:`center`,justifyContent:`center`},input:{width:`100px`,fontSize:`14px`,color:`#666`,border:`0px`,outline:`none`,height:`28px`,boxShadow:`inset 0 0 0 1px #F0F0F0`,boxSizing:`content-box`,borderRadius:`0 4px 4px 0`,float:`left`,paddingLeft:`8px`},swatch:{width:`30px`,height:`30px`,float:`left`,borderRadius:`4px`,margin:`0 6px 6px 0`},clear:{clear:`both`}},"hide-triangle":{triangle:{display:`none`},triangleShadow:{display:`none`}},"top-left-triangle":{triangle:{top:`-10px`,left:`12px`},triangleShadow:{top:`-11px`,left:`12px`}},"top-right-triangle":{triangle:{top:`-10px`,right:`12px`},triangleShadow:{top:`-11px`,right:`12px`}}},c),{"hide-triangle":o===`hide`,"top-left-triangle":o===`top-left`,"top-right-triangle":o===`top-right`}),p=function(e,n){G(e)&&t({hex:e,source:`hex`},n)};return M.createElement(`div`,{style:f.card,className:`twitter-picker `+d},M.createElement(`div`,{style:f.triangleShadow}),M.createElement(`div`,{style:f.triangle}),M.createElement(`div`,{style:f.body},h(i,function(e,t){return M.createElement(q,{key:t,color:e,hex:e,style:f.swatch,onClick:p,onHover:n,focusStyle:{boxShadow:`0 0 4px `+e}})}),M.createElement(`div`,{style:f.hash},`#`),M.createElement(I,{label:null,style:{input:f.input},value:r.replace(`#`,``),onChange:p}),M.createElement(`div`,{style:f.clear})))};ii.propTypes={width:R.default.oneOfType([R.default.string,R.default.number]),triangle:R.default.oneOf([`hide`,`top-left`,`top-right`]),colors:R.default.arrayOf(R.default.string),styles:R.default.object},ii.defaultProps={width:276,colors:[`#FF6900`,`#FCB900`,`#7BDCB5`,`#00D084`,`#8ED1FC`,`#0693E3`,`#ABB8C3`,`#EB144C`,`#F78DA7`,`#9900EF`],triangle:`top-left`,styles:{}},K(ii);var ai=function(e){var t=(0,P.default)({default:{picker:{width:`20px`,height:`20px`,borderRadius:`22px`,border:`2px #fff solid`,transform:`translate(-12px, -13px)`,background:`hsl(`+Math.round(e.hsl.h)+`, `+Math.round(e.hsl.s*100)+`%, `+Math.round(e.hsl.l*100)+`%)`}}});return M.createElement(`div`,{style:t.picker})};ai.propTypes={hsl:R.default.shape({h:R.default.number,s:R.default.number,l:R.default.number,a:R.default.number})},ai.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var oi=function(e){var t=(0,P.default)({default:{picker:{width:`20px`,height:`20px`,borderRadius:`22px`,transform:`translate(-10px, -7px)`,background:`hsl(`+Math.round(e.hsl.h)+`, 100%, 50%)`,border:`2px white solid`}}});return M.createElement(`div`,{style:t.picker})};oi.propTypes={hsl:R.default.shape({h:R.default.number,s:R.default.number,l:R.default.number,a:R.default.number})},oi.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var si=function(e){var t=e.onChange,n=e.rgb,r=e.hsl,i=e.hex,a=e.hsv,o=function(e,n){if(e.hex)G(e.hex)&&t({hex:e.hex,source:`hex`},n);else if(e.rgb){var r=e.rgb.split(`,`);Ln(e.rgb,`rgb`)&&t({r:r[0],g:r[1],b:r[2],a:1,source:`rgb`},n)}else if(e.hsv){var i=e.hsv.split(`,`);Ln(e.hsv,`hsv`)&&(i[2]=i[2].replace(`%`,``),i[1]=i[1].replace(`%`,``),i[0]=i[0].replace(`°`,``),i[1]==1?i[1]=.01:i[2]==1&&(i[2]=.01),t({h:Number(i[0]),s:Number(i[1]),v:Number(i[2]),source:`hsv`},n))}else if(e.hsl){var a=e.hsl.split(`,`);Ln(e.hsl,`hsl`)&&(a[2]=a[2].replace(`%`,``),a[1]=a[1].replace(`%`,``),a[0]=a[0].replace(`°`,``),u[1]==1?u[1]=.01:u[2]==1&&(u[2]=.01),t({h:Number(a[0]),s:Number(a[1]),v:Number(a[2]),source:`hsl`},n))}},s=(0,P.default)({default:{wrap:{display:`flex`,height:`100px`,marginTop:`4px`},fields:{width:`100%`},column:{paddingTop:`10px`,display:`flex`,justifyContent:`space-between`},double:{padding:`0px 4.4px`,boxSizing:`border-box`},input:{width:`100%`,height:`38px`,boxSizing:`border-box`,padding:`4px 10% 3px`,textAlign:`center`,border:`1px solid #dadce0`,fontSize:`11px`,textTransform:`lowercase`,borderRadius:`5px`,outline:`none`,fontFamily:`Roboto,Arial,sans-serif`},input2:{height:`38px`,width:`100%`,border:`1px solid #dadce0`,boxSizing:`border-box`,fontSize:`11px`,textTransform:`lowercase`,borderRadius:`5px`,outline:`none`,paddingLeft:`10px`,fontFamily:`Roboto,Arial,sans-serif`},label:{textAlign:`center`,fontSize:`12px`,background:`#fff`,position:`absolute`,textTransform:`uppercase`,color:`#3c4043`,width:`35px`,top:`-6px`,left:`0`,right:`0`,marginLeft:`auto`,marginRight:`auto`,fontFamily:`Roboto,Arial,sans-serif`},label2:{left:`10px`,textAlign:`center`,fontSize:`12px`,background:`#fff`,position:`absolute`,textTransform:`uppercase`,color:`#3c4043`,width:`32px`,top:`-6px`,fontFamily:`Roboto,Arial,sans-serif`},single:{flexGrow:`1`,margin:`0px 4.4px`}}}),c=n.r+`, `+n.g+`, `+n.b,l=Math.round(r.h)+`°, `+Math.round(r.s*100)+`%, `+Math.round(r.l*100)+`%`,u=Math.round(a.h)+`°, `+Math.round(a.s*100)+`%, `+Math.round(a.v*100)+`%`;return M.createElement(`div`,{style:s.wrap,className:`flexbox-fix`},M.createElement(`div`,{style:s.fields},M.createElement(`div`,{style:s.double},M.createElement(I,{style:{input:s.input,label:s.label},label:`hex`,value:i,onChange:o})),M.createElement(`div`,{style:s.column},M.createElement(`div`,{style:s.single},M.createElement(I,{style:{input:s.input2,label:s.label2},label:`rgb`,value:c,onChange:o})),M.createElement(`div`,{style:s.single},M.createElement(I,{style:{input:s.input2,label:s.label2},label:`hsv`,value:u,onChange:o})),M.createElement(`div`,{style:s.single},M.createElement(I,{style:{input:s.input2,label:s.label2},label:`hsl`,value:l,onChange:o})))))},ci=function(e){var t=e.width,n=e.onChange,r=e.rgb,i=e.hsl,a=e.hsv,o=e.hex,s=e.header,c=e.styles,l=c===void 0?{}:c,d=e.className,f=d===void 0?``:d,p=(0,P.default)(u({default:{picker:{width:t,background:`#fff`,border:`1px solid #dfe1e5`,boxSizing:`initial`,display:`flex`,flexWrap:`wrap`,borderRadius:`8px 8px 0px 0px`},head:{height:`57px`,width:`100%`,paddingTop:`16px`,paddingBottom:`16px`,paddingLeft:`16px`,fontSize:`20px`,boxSizing:`border-box`,fontFamily:`Roboto-Regular,HelveticaNeue,Arial,sans-serif`},saturation:{width:`70%`,padding:`0px`,position:`relative`,overflow:`hidden`},swatch:{width:`30%`,height:`228px`,padding:`0px`,background:`rgba(`+r.r+`, `+r.g+`, `+r.b+`, 1)`,position:`relative`,overflow:`hidden`},body:{margin:`auto`,width:`95%`},controls:{display:`flex`,boxSizing:`border-box`,height:`52px`,paddingTop:`22px`},color:{width:`32px`},hue:{height:`8px`,position:`relative`,margin:`0px 16px 0px 16px`,width:`100%`},Hue:{radius:`2px`}}},l));return M.createElement(`div`,{style:p.picker,className:`google-picker `+f},M.createElement(`div`,{style:p.head},s),M.createElement(`div`,{style:p.swatch}),M.createElement(`div`,{style:p.saturation},M.createElement(Xt,{hsl:i,hsv:a,pointer:ai,onChange:n})),M.createElement(`div`,{style:p.body},M.createElement(`div`,{style:p.controls,className:`flexbox-fix`},M.createElement(`div`,{style:p.hue},M.createElement(L,{style:p.Hue,hsl:i,radius:`4px`,pointer:oi,onChange:n}))),M.createElement(si,{rgb:r,hsl:i,hex:o,hsv:a,onChange:n})))};ci.propTypes={width:R.default.oneOfType([R.default.string,R.default.number]),styles:R.default.object,header:R.default.string},ci.defaultProps={width:652,styles:{},header:`Color picker`},K(ci);var li=a(`div`,{target:`eqdn5n10`})(({disabled:e,theme:t})=>({fontFamily:t.genericFonts.bodyFont,display:`flex`,flexDirection:`column`,alignItems:`flex-start`,cursor:e?`not-allowed`:`default`,minWidth:t.sizes.minElementHeight})),ui=a(`div`,{target:`eqdn5n11`})(({theme:e})=>({...v(e),zIndex:_(e)})),di=a(`div`,{target:`eqdn5n12`})(({theme:e})=>({div:{fontFamily:`${e.genericFonts.bodyFont} !important`},label:{fontSize:`${e.fontSizes.sm} !important`,color:`${e.colors.bodyText} !important`},input:{fontSize:`${e.fontSizes.sm} !important`,height:`${e.sizes.minElementHeight} !important`,backgroundColor:`${e.colors.secondaryBg} !important`,color:`${e.colors.bodyText} !important`,borderRadius:`${e.radii.default} !important`,boxShadow:`none !important`,"&:focus-visible":{outline:`${e.sizes.borderWidth} solid ${e.colors.primary} !important`}},svg:{fill:`${e.colors.bodyText} !important`}})),fi=a(`button`,{target:`eqdn5n13`})(({disabled:e,theme:t})=>({appearance:`none`,background:`none`,border:`none`,padding:0,margin:0,font:`inherit`,display:`flex`,height:t.sizes.minElementHeight,borderRadius:t.radii.default,boxShadow:`none`,lineHeight:t.lineHeights.base,gap:t.spacing.md,cursor:e?`not-allowed`:`pointer`,"&:focus-visible":{outline:`none`,boxShadow:t.shadows.focusRing}})),pi=a(`div`,{target:`eqdn5n14`})(({backgroundColor:e,disabled:t,theme:n})=>({width:n.sizes.minElementHeight,height:n.sizes.minElementHeight,borderRadius:n.radii.default,borderColor:n.colors.borderColor,borderWidth:n.sizes.borderWidth,opacity:t?`0.4`:``,backgroundColor:e,borderStyle:`solid`,cursor:`pointer`,lineHeight:n.lineHeights.base,"&:focus":{outline:`none`}})),mi=a(`div`,{target:`eqdn5n15`})({display:`flex`,alignItems:`center`});Xt.prototype.getContainerRenderWindow=function(){let e=this.container,t=window,n=window;try{for(;!t.document.contains(e)&&t.parent!==t;)n=t,t=t.parent}catch{t=n}return t};var hi=(0,M.memo)(e=>{let{disabled:t,value:n,showValue:a,label:o,labelVisibility:c,onChange:l,help:u}=e,[d,f]=(0,M.useState)(n),[p,m]=(0,M.useState)(!1),h=(0,M.useRef)(0),_=(0,M.useRef)(null),v=(0,M.useRef)(null),b=(0,M.useRef)(!1),x=(0,M.useRef)(d);x.current=d;let S=g();re(()=>f(n),[n]);let{refs:{setFloating:C,setReference:w},floatingStyles:T,context:E}=ne({open:p,placement:`bottom-start`,offsetPx:s(S.spacing.twoXS)}),D=(0,M.useCallback)(e=>{f(e.hex)},[]),O=(0,M.useCallback)(()=>{l(x.current)},[l]),k=(0,M.useCallback)(()=>{t||(p?(m(!1),O()):(h.current=Date.now(),m(!0)))},[t,p,O]);(0,M.useEffect)(()=>{if(!p)return;let e=e=>{if(Date.now()-h.current<50)return;let t=e.target;!_.current?.contains(t)&&!v.current?.contains(t)&&(m(!1),O())},t=e=>{e.key===`Escape`?(e.stopPropagation(),m(!1),O(),_.current?.focus()):e.key===`Tab`&&(b.current=!0)},n=e=>{b.current&&(b.current=!1,v.current?.contains(e.target)||(m(!1),O()))};return document.addEventListener(`click`,e),document.addEventListener(`keydown`,t,!0),document.addEventListener(`focusin`,n),()=>{document.removeEventListener(`click`,e),document.removeEventListener(`keydown`,t,!0),document.removeEventListener(`focusin`,n)}},[p,O]);let A=(0,M.useCallback)(e=>{C(e),v.current=e},[C]),ie=(0,M.useCallback)(e=>{w(e),_.current=e},[w]),ae={default:{picker:{borderRadius:S.radii.default,boxShadow:`none`,backgroundColor:S.colors.bgColor},saturation:{borderRadius:`${S.radii.default} ${S.radii.default} 0 0`,userSelect:`none`},body:{padding:S.spacing.xl}}};return r(li,{className:`stColorPicker`,"data-testid":`stColorPicker`,disabled:t,children:[i(xe,{label:o,disabled:t,labelVisibility:c,children:u&&i(Se,{content:u,placement:ee.TOP_RIGHT,label:o})}),r(fi,{ref:ie,type:`button`,disabled:t,onClick:k,"aria-label":`${o} color picker`,"aria-expanded":p,"aria-haspopup":`dialog`,children:[i(pi,{"data-testid":`stColorPickerBlock`,backgroundColor:d,disabled:t}),a&&i(mi,{children:d.toUpperCase()})]}),p&&i(te,{children:i(y,{context:E,modal:!1,closeOnFocusOut:!1,children:i(ui,{ref:A,style:T,role:`dialog`,"aria-label":`${o} color picker`,children:i(di,{"data-testid":`stColorPickerPopover`,children:i(Er,{color:d,onChange:D,disableAlpha:!0,styles:ae})})})})})]})}),gi=(e,t)=>e.getStringValue(t),_i=e=>e.default??`#000000`,vi=e=>e.value??e.default??`#000000`,yi=(e,t,n,r)=>{t.setStringValue(e,n.value,{fromUi:n.fromUi},r)},bi=(0,M.memo)(({element:e,disabled:t,widgetMgr:n,fragmentId:r})=>{let[a,s]=Ce({getStateFromWidgetMgr:gi,getDefaultStateFromProto:_i,getCurrStateFromProto:vi,updateWidgetMgrState:yi,element:e,widgetMgr:n,fragmentId:r,formClearBehavior:`resetValueOnly`,queryParamBinding:e.queryParamKey?{paramKey:e.queryParamKey,valueType:`string_value`,clearable:!1}:void 0}),c=(0,M.useCallback)(e=>{s({value:e,fromUi:!0})},[s]);return i(hi,{label:e.label,labelVisibility:o(e.labelVisibility?.value),help:e.help,onChange:c,disabled:t,value:a})});export{bi as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/ComponentInstance.DhPDHW9t.js b/venv/Lib/site-packages/streamlit/static/static/js/ComponentInstance.DhPDHW9t.js new file mode 100644 index 0000000000000000000000000000000000000000..d00b447878d384bd27cbeaa2bdce955eb22f9777 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/ComponentInstance.DhPDHW9t.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as n,i as r,r as i,t as a}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as o}from"./loglevel.BJBYxGId.js";import{t as s}from"./react-dom.DZwq-Xzd.js";import{C as c}from"./utils.94RcZhG4.js";import{Z as l,n as u}from"./protobuf.DC2L68b9.js";import{n as d,t as f}from"./types.cZoyy9Y-.js";import{h as p}from"./StreamlitMarkdown.DJLoxxnS.js";import{t as m}from"./useEmotionTheme.D29Ufy6b.js";import{i as h,t as g}from"./ErrorElement.BWmlOcKX.js";import{t as _}from"./useTimeout.CUauXJkz.js";import{t as v}from"./AlertElement.BAyMiYwt.js";import{t as y}from"./ErrorHandling.H5STbbYb.js";import{t as b}from"./query-string.aaJx2e0Y.js";import{n as x,t as S}from"./IFrameUtil.PlC_b34Z.js";import{n as C,r as w}from"./urls.B0fCYwet.js";import{t as T}from"./withCalculatedWidth.DClbrdOz.js";var E=e(t(),1),D=e(o(),1),O=e(s(),1),k=function(e){return e.COMPONENT_READY=`streamlit:componentReady`,e.SET_COMPONENT_VALUE=`streamlit:setComponentValue`,e.SET_FRAME_HEIGHT=`streamlit:setFrameHeight`,e}({}),A=function(e){return e.RENDER=`streamlit:render`,e}({}),j=(0,D.getLogger)(`componentUtils`);function M(e){return(t,n)=>{if(!e.current)return;let{isReady:r,element:i,widgetMgr:a,setComponentError:o,componentReadyCallback:s,frameHeightCallback:c,fragmentId:l}=e.current,u=r();switch(t){case k.COMPONENT_READY:{let{apiVersion:e}=n;e===1?s():o(Error(`Unrecognized component API version: '${e}'`));break}case k.SET_COMPONENT_VALUE:u?F(I(n,`value`),n.dataType,{fromUi:!0},i,a,l):j.warn(`Got ${t} before ${k.COMPONENT_READY}!`);break;case k.SET_FRAME_HEIGHT:u?c(I(n,`height`)):j.warn(`Got ${t} before ${k.COMPONENT_READY}!`);break;default:j.warn(`Unrecognized ComponentBackMsgType: ${t}`)}}}function N(e,t){let n=JSON.parse(e),r=[];for(let e of t){let{key:t}=e;switch(e.value?.toLowerCase()){case`arrowdataframe`:r.push({key:t,value:u.toObject(e.arrowDataframe)});break;case`bytes`:n[t]=e.bytes;break;default:throw Error(`Unrecognized SpecialArg type: ${e.value}`)}}return[n,r]}function P(e,t,n,r,i){if(!i){j.warn(`Can't send ForwardMsg; missing our iframe!`);return}if(f(i.contentWindow)){j.warn(`Can't send ForwardMsg; iframe has no contentWindow!`);return}i.contentWindow.postMessage({type:A.RENDER,args:e,dfs:t,disabled:n,theme:{...c(r),font:r.genericFonts.bodyFont}},`*`)}function F(e,t,n,r,i,a){if(e===void 0){j.warn(`handleSetComponentValue: missing 'value' prop`);return}switch(t){case`dataframe`:i.setArrowValue(r,e,n,a);break;case`bytes`:i.setBytesValue(r,e,n,a);break;default:i.setJsonValue(r,e,n,a)}}function I(e,t,n=void 0){return Object.hasOwn(e,t)?e[t]:n}var L=a(`iframe`,{target:`edxyb2x0`})(({theme:e,componentReady:t})=>({colorScheme:`normal`,border:`none`,padding:e.spacing.none,margin:e.spacing.none,display:t?`initial`:`none`})),R=(0,D.getLogger)(`ComponentInstance`),z=6e4;function B(e,t,n){let r;r=d(n)&&n!==``?n:t.getComponentURL(e,`index.html`);let i=l.CUSTOM_COMPONENT_CLIENT_ID,a=new URL(window.location.href);return r=b.stringifyUrl({url:r,query:{streamlitUrl:a.origin+a.pathname,...i&&{__streamlit_parent_client_id:i}}}),r}function V(e,t){let n;return n=t&&t!==``?`Your app is having trouble loading the **${e}** component.\nThe app is attempting to load the component from **${t}**,\nand hasn't received its \`Streamlit.setComponentReady()\` message.\n\nIf this is a development build, have you started the dev server?\n\nFor more troubleshooting help, please see the [Streamlit Component docs](${w}) or visit our [forums](${C}).`:`Your app is having trouble loading the **${e}** component.\n\nIf this is an installed component that works locally, the app may be having trouble accessing the component frontend assets due to network latency or proxy settings in your app deployment.\n\nFor more troubleshooting help, please see the [Streamlit Component docs](${w}) or visit our [forums](${C}).`,n}function H(e,t,n,r){if(!r)try{return N(e,t)}catch(e){n(y(e))}return[{},[]]}function U(e,t){return e===t||e.length===t.length&&e.every((e,n)=>{let r=t[n];return e.key===r.key&&e.value===r.value})}function W(e){let t=m(),[a,o]=(0,E.useState)(),{disabled:s,element:c,widgetMgr:l,width:u,fragmentId:d,componentRegistry:y}=e,{componentName:b,jsonArgs:C,specialArgs:w,url:T}=c,[D,k]=H(C,w,o,a),A=(0,E.useMemo)(()=>B(b,y,T),[b,y,T]),j=(0,E.useRef)({args:{},dataframeArgs:[]}),N=U(j.current.dataframeArgs,k);j.current.args=D,j.current.dataframeArgs=k;let[F,I]=(0,E.useState)(),[W,G]=(0,E.useState)(()=>{let e=D.height;return e===void 0||isNaN(e)?void 0:e}),K=(0,E.useRef)(!1),q=(0,E.useRef)(null),J=(0,E.useRef)(),{clear:Y}=_(()=>R.warn(V(b,T)),z/4),{clear:X}=_(()=>{(0,O.flushSync)(()=>{I(!0)})},z);return(0,E.useEffect)(()=>{y.checkSourceUrlResponse(A,b)},[A,b,y]),(0,E.useEffect)(()=>{F&&!K.current&&(R.error(`Client Error: Custom Component ${b} timeout error`),y.sendTimeoutError(A,b))},[F,A,b,y]),(0,E.useEffect)(()=>{K.current&&P(j.current.args,j.current.dataframeArgs,s,t,q.current??void 0)},[s,W,N,C,t,u]),(0,E.useEffect)(()=>{J.current={isReady:()=>K.current,element:c,widgetMgr:l,setComponentError:o,componentReadyCallback:()=>{P(j.current.args,j.current.dataframeArgs,s,t,q.current??void 0),Y(),X(),K.current=!0,(0,O.flushSync)(()=>{I(!1)})},frameHeightCallback:e=>{if(e===void 0){R.warn(`handleSetFrameHeight: missing 'height' prop`);return}if(e!==W){if(f(q.current)){R.warn(`handleSetFrameHeight: missing our iframeRef!`);return}q.current.height=e.toString(),(0,O.flushSync)(()=>{G(e)})}},fragmentId:d}},[b,s,c,W,N,F,C,t,l,X,Y,d]),(0,E.useEffect)(()=>{let e=q.current?.contentWindow??void 0;if(e)return y.registerListener(e,M(J)),()=>{e&&y.deregisterListener(e)}},[y,b]),a?r(g,{name:a.name,message:a.message}):n(i,{children:[!K.current&&!F&&W!==0&&r(p,{"data-testid":`stSkeleton`,height:W?`${W}px`:void 0,"aria-hidden":`true`}),!K.current&&F?r(v,{body:V(b,T),kind:h.WARNING}):null,r(L,{className:`stCustomComponentV1`,"data-testid":`stCustomComponentV1`,allow:S,ref:q,src:A,width:u,height:W??0,scrolling:`no`,sandbox:x,title:b,componentReady:K.current,tabIndex:c.tabIndex??void 0})]})}var G=T((0,E.memo)(W));export{z as COMPONENT_READY_WARNING_TIME_MS,G as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/ContentCopy.esm.Dq-fIx3A.js b/venv/Lib/site-packages/streamlit/static/static/js/ContentCopy.esm.Dq-fIx3A.js new file mode 100644 index 0000000000000000000000000000000000000000..6a67ca6e2bce7a92b91e3a1528139da3fdd82087 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/ContentCopy.esm.Dq-fIx3A.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{y as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as r}from"./index.esm.DCRlH4DP.js";var i=e(t()),a=i.forwardRef(function(e,t){return i.createElement(r,n({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),i.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),i.createElement(`path`,{d:`M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z`}))});a.displayName=`ContentCopy`;export{a as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/DataFrame.Wny8mRut.js b/venv/Lib/site-packages/streamlit/static/static/js/DataFrame.Wny8mRut.js new file mode 100644 index 0000000000000000000000000000000000000000..0d92d8d35d9d1936cdaebffdced752f8bb5fff4b --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/DataFrame.Wny8mRut.js @@ -0,0 +1,172 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.Cl0FibMX.js","./rolldown-runtime.DAXXjFlN.js","./emotion-is-prop-valid.esm.CygBv61C.js","./react-dom.DZwq-Xzd.js","./click-outside-container.Ci0KWfiz.js","./_hasPath.BAJp1Wyr.js","./dist.Bp4fj7nv.js","./number-overlay-editor.B2gNG5Q4.js","./es6.CiwTgjbX.js","./preload-helper.HclGiUj8.js","./FileSystemHandle.CFTLjada.js","./FileSystemDirectoryHandle.p7DJujU-.js","./util.D5poj9OK.js","./FileSystemFileHandle.CU3-lWxj.js","./config.Mbx-WYSj.js"])))=>i.map(i=>d[i]); +import{a as e,o as t,r as n,t as r}from"./rolldown-runtime.DAXXjFlN.js";import{r as i}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a,i as o,r as s,t as c,y as l}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as u}from"./loglevel.BJBYxGId.js";import{t as d}from"./react-dom.DZwq-Xzd.js";import{A as f,Bt as p,c as m,in as h,k as g,o as _}from"./utils.94RcZhG4.js";import{i as v,n as y,r as b,t as x}from"./emotion-react.browser.esm.B06RJmME.js";import{f as S}from"./protobuf.DC2L68b9.js";import{n as C,t as w}from"./types.cZoyy9Y-.js";import{r as T,t as E}from"./toString.tRXNBxtF.js";import{t as D}from"./merge.CkO-ckia.js";import{C as O,r as k}from"./StreamlitMarkdown.DJLoxxnS.js";import{C as A,S as j,T as ee,_ as te,a as ne,b as re,c as ie,d as ae,f as oe,g as M,h as N,i as se,l as P,m as ce,o as le,p as ue,r as de,s as fe,t as pe,u as me,v as he,w as ge,x as _e,y as ve}from"./pandasStylerUtils.CpHtlemx.js";import{t as ye}from"./isEmpty.DjruDP6v.js";import{t as F}from"./isEqual.CgNOpGTC.js";import{S as be,_ as xe,f as Se,g as I,m as Ce,p as L,v as we,y as R}from"./getColors.DtAxY2Hd.js";import{t as Te}from"./classnames.B69Vzagp.js";import{a as z,n as B,r as Ee,t as De}from"./lib.CzPO8p6E.js";import{a as Oe,n as V,r as ke,t as Ae}from"./DynamicIcon.44zobID_.js";import{i as je}from"./UriUtil.olyUCSHN.js";import{t as H}from"./useEmotionTheme.D29Ufy6b.js";import{c as Me,i as Ne,l as Pe}from"./Tooltip.PNC8NIZa.js";import{d as Fe}from"./ErrorElement.BWmlOcKX.js";import{a as Ie,n as Le,r as Re,t as ze}from"./useFloatingOverlay.DlcdWSVH.js";import{t as Be}from"./preload-helper.HclGiUj8.js";import{n as Ve}from"./useExecuteWhenChanged.CJi0fna4.js";import{n as He}from"./FormClearHelper.D0Yt6KG5.js";import{t as Ue}from"./useTimeout.CUauXJkz.js";import{t as We}from"./useCalculatedDimensions.BnLCBgVi.js";import{i as Ge,n as Ke}from"./objectWithoutPropertiesLoose.DkqnLJVA.js";import{n as qe,t as Je}from"./index.esm.DCRlH4DP.js";import{t as Ye}from"./Check.esm.B4TBPV6z.js";import{n as Xe,t as Ze}from"./toConsumableArray.BxvvZSIl.js";import{t as Qe}from"./Delete.esm.CDosXh7J.js";import{t as $e}from"./FileDownload.esm.BM_tuzhj.js";import{n as et,t as tt}from"./Toolbar.BynU-Hbw.js";import{t as nt}from"./useCopyToClipboard.31Hpj0n3.js";import{t as rt}from"./useRequiredContext.F4hG38Ff.js";import{S as it,_ as at,a as ot,d as st,g as ct,m as lt,x as ut,y as dt}from"./_hasPath.BAJp1Wyr.js";import{a as ft,d as pt,m as mt,n as ht,p as gt,r as _t,t as vt,u as yt,y as bt}from"./_baseAssignValue.D38XrOT1.js";import{F as xt,l as St,s as Ct}from"./recordbatch.BmKVw6jF.js";import{t as wt}from"./useOverlayDismissal.DB4_ko2H.js";import{t as Tt}from"./useScrollbarGutterSize.B_VG1Wad.js";import{t as Et}from"./slicedToArray.624-tfZX.js";import{a as Dt,i as Ot,r as kt}from"./possibleConstructorReturn.DlxXudXd.js";import{t as At}from"./createSuper.CUU0SpoM.js";import{n as jt,t as Mt}from"./withFullScreenWrapper.DjqP6oFO.js";import{C as Nt,D as Pt,E as Ft,S as It,T as Lt,_ as Rt,a as zt,b as Bt,c as Vt,d as Ht,f as Ut,g as Wt,h as Gt,i as Kt,l as qt,m as U,n as Jt,o as Yt,p as Xt,r as Zt,s as W,t as Qt,u as $t,v as en,w as tn,x as nn,y as rn}from"./click-outside-container.Ci0KWfiz.js";import{t as an}from"./dist.Bp4fj7nv.js";import{n as on,r as sn,t as cn}from"./moment.CaJaEtMO.js";import{t as ln}from"./numbro.-0LqK-W4.js";import{t as un}from"./dist.CETvsizV.js";import{t as dn}from"./reactJsonViewCompat.nQHHQTSK.js";import{t as fn}from"./formatNumber.D1UJmEyL.js";import{t as pn}from"./formatMoment.CtdYuS92.js";import{t as mn}from"./createDownloadLinkElement.CV8DGZx1.js";import{a as G,n as hn,o as gn,r as _n}from"./styled-components.CuxloOeN.js";var K=t(i()),vn=K.forwardRef(function(e,t){return K.createElement(Je,l({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),K.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),K.createElement(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`}))});vn.displayName=`Add`;var yn=K.forwardRef(function(e,t){return K.createElement(Je,l({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),K.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),K.createElement(`path`,{d:`M14.06 9.02l.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83a.996.996 0 000-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z`}))});yn.displayName=`Edit`;var bn=K.forwardRef(function(e,t){return K.createElement(Je,l({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),K.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),K.createElement(`path`,{d:`M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z`}))});bn.displayName=`Search`;var q=K.forwardRef(function(e,t){return K.createElement(Je,l({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),K.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),K.createElement(`path`,{d:`M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z`}))});q.displayName=`Visibility`;var xn=t(u(),1),Sn=t(d());function Cn({isOpen:e,onOpenChange:t,enabled:n,delayMs:r=150,placement:i=`right`,offsetPx:a=2}){let o=(0,K.useRef)(null),s=(0,K.useRef)(null),{refs:c,floatingStyles:l}=ze({open:e,placement:i,offsetPx:a}),u=(0,K.useCallback)(e=>{o.current=e,c.setReference(e)},[c]),d=(0,K.useCallback)(e=>{s.current=e,c.setFloating(e)},[c]),{clear:f,restart:p}=Ue(()=>t(!1),r,{autoStart:!1});return(0,K.useEffect)(()=>{if(n===!1)return;let r=n=>{let r=n.target;o.current?.contains(r)?(f(),t(!0)):e&&s.current?.contains(r)?f():e&&p()};return document.addEventListener(`mouseover`,r),()=>document.removeEventListener(`mouseover`,r)},[e,n,f,t,p]),{floatingStyles:l,setAnchorRef:u,setFloatingRef:d}}var wn=an(`div`)({name:`ImageOverlayEditorStyle`,class:`gdg-i2iowwq`,propsAsIs:!1}),Tn=r((e=>{(function(t,n){if(typeof define==`function`&&define.amd)define([`exports`,`react`,`prop-types`],n);else if(e!==void 0)n(e,i(),O());else{var r={exports:{}};n(r.exports,t.react,t.propTypes),t.reactSwipe=r.exports}})(e,function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.setHasSupportToCaptureOption=p;var r=a(t),i=a(n);function a(e){return e&&e.__esModule?e:{default:e}}var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var l=function(){function e(e,t){for(var n=0;n0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?e:e.capture}function h(e){if(`touches`in e){var t=e.touches[0];return{x:t.pageX,y:t.pageY}}return{x:e.screenX,y:e.screenY}}var g=function(e){d(t,e);function t(){var e;c(this,t);var n=[...arguments],r=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(n)));return r._handleSwipeStart=r._handleSwipeStart.bind(r),r._handleSwipeMove=r._handleSwipeMove.bind(r),r._handleSwipeEnd=r._handleSwipeEnd.bind(r),r._onMouseDown=r._onMouseDown.bind(r),r._onMouseMove=r._onMouseMove.bind(r),r._onMouseUp=r._onMouseUp.bind(r),r._setSwiperRef=r._setSwiperRef.bind(r),r}return l(t,[{key:`componentDidMount`,value:function(){this.swiper&&this.swiper.addEventListener(`touchmove`,this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:`componentWillUnmount`,value:function(){this.swiper&&this.swiper.removeEventListener(`touchmove`,this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:`_onMouseDown`,value:function(e){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener(`mouseup`,this._onMouseUp),document.addEventListener(`mousemove`,this._onMouseMove),this._handleSwipeStart(e))}},{key:`_onMouseMove`,value:function(e){this.mouseDown&&this._handleSwipeMove(e)}},{key:`_onMouseUp`,value:function(e){this.mouseDown=!1,document.removeEventListener(`mouseup`,this._onMouseUp),document.removeEventListener(`mousemove`,this._onMouseMove),this._handleSwipeEnd(e)}},{key:`_handleSwipeStart`,value:function(e){var t=h(e),n=t.x,r=t.y;this.moveStart={x:n,y:r},this.props.onSwipeStart(e)}},{key:`_handleSwipeMove`,value:function(e){if(this.moveStart){var t=h(e),n=t.x,r=t.y,i=n-this.moveStart.x,a=r-this.moveStart.y;this.moving=!0,this.props.onSwipeMove({x:i,y:a},e)&&e.cancelable&&e.preventDefault(),this.movePosition={deltaX:i,deltaY:a}}}},{key:`_handleSwipeEnd`,value:function(e){this.props.onSwipeEnd(e);var t=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-t?this.props.onSwipeLeft(1,e):this.movePosition.deltaX>t&&this.props.onSwipeRight(1,e),this.movePosition.deltaY<-t?this.props.onSwipeUp(1,e):this.movePosition.deltaY>t&&this.props.onSwipeDown(1,e)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:`_setSwiperRef`,value:function(e){this.swiper=e,this.props.innerRef(e)}},{key:`render`,value:function(){var e=this.props;e.tagName;var t=e.className,n=e.style,i=e.children;e.allowMouseEvents,e.onSwipeUp,e.onSwipeDown,e.onSwipeLeft,e.onSwipeRight,e.onSwipeStart,e.onSwipeMove,e.onSwipeEnd,e.innerRef,e.tolerance;var a=s(e,[`tagName`,`className`,`style`,`children`,`allowMouseEvents`,`onSwipeUp`,`onSwipeDown`,`onSwipeLeft`,`onSwipeRight`,`onSwipeStart`,`onSwipeMove`,`onSwipeEnd`,`innerRef`,`tolerance`]);return r.default.createElement(this.props.tagName,o({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:t,style:n},a),i)}}]),t}(t.Component);g.displayName=`ReactSwipe`,g.propTypes={tagName:i.default.string,className:i.default.string,style:i.default.object,children:i.default.node,allowMouseEvents:i.default.bool,onSwipeUp:i.default.func,onSwipeDown:i.default.func,onSwipeLeft:i.default.func,onSwipeRight:i.default.func,onSwipeStart:i.default.func,onSwipeMove:i.default.func,onSwipeEnd:i.default.func,innerRef:i.default.func,tolerance:i.default.number.isRequired},g.defaultProps={tagName:`div`,allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},e.default=g})})),En=r((e=>{(function(t,n){if(typeof define==`function`&&define.amd)define([`exports`,`./react-swipe`],n);else if(e!==void 0)n(e,Tn());else{var r={exports:{}};n(r.exports,t.reactSwipe),t.index=r.exports}})(e,function(e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(t);function r(e){return e&&e.__esModule?e:{default:e}}e.default=n.default})})),Dn=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(Te());function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.default={ROOT:function(e){return(0,t.default)(r({"carousel-root":!0},e||``,!!e))},CAROUSEL:function(e){return(0,t.default)({carousel:!0,"carousel-slider":e})},WRAPPER:function(e,n){return(0,t.default)({"thumbs-wrapper":!e,"slider-wrapper":e,"axis-horizontal":n===`horizontal`,"axis-vertical":n!==`horizontal`})},SLIDER:function(e,n){return(0,t.default)({thumbs:!e,slider:e,animated:!n})},ITEM:function(e,n,r){return(0,t.default)({thumb:!e,slide:e,selected:n,previous:r})},ARROW_PREV:function(e){return(0,t.default)({"control-arrow control-prev":!0,"control-disabled":e})},ARROW_NEXT:function(e){return(0,t.default)({"control-arrow control-next":!0,"control-disabled":e})},DOT:function(e){return(0,t.default)({dot:!0,selected:e})}}})),On=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.outerWidth=void 0,e.outerWidth=function(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+=parseInt(n.marginLeft)+parseInt(n.marginRight),t}})),kn=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(e,t,n){var r=e===0?e:e+t;return`translate3d`+(`(`+(n===`horizontal`?[r,0,0]:[0,r,0]).join(`,`)+`)`)}})),An=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(){return window}})),jn=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=u(i()),n=c(Dn()),r=On(),a=c(kn()),o=c(En()),s=c(An());function c(e){return e&&e.__esModule?e:{default:e}}function l(){if(typeof WeakMap!=`function`)return null;var e=new WeakMap;return l=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(e===null||d(e)!==`object`&&typeof e!=`function`)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function d(e){"@babel/helpers - typeof";return d=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},d(e)}function f(){return f=Object.assign||function(e){for(var t=1;t`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=function(e){return e.hasOwnProperty(`key`)},T=function(e){g(c,e);var i=v(c);function c(e){var n;return p(this,c),n=i.call(this,e),C(b(n),`itemsWrapperRef`,void 0),C(b(n),`itemsListRef`,void 0),C(b(n),`thumbsRef`,void 0),C(b(n),`setItemsWrapperRef`,function(e){n.itemsWrapperRef=e}),C(b(n),`setItemsListRef`,function(e){n.itemsListRef=e}),C(b(n),`setThumbsRef`,function(e,t){n.thumbsRef||=[],n.thumbsRef[t]=e}),C(b(n),`updateSizes`,function(){if(!(!n.props.children||!n.itemsWrapperRef||!n.thumbsRef)){var e=t.Children.count(n.props.children),i=n.itemsWrapperRef.clientWidth,a=n.props.thumbWidth?n.props.thumbWidth:(0,r.outerWidth)(n.thumbsRef[0]),o=Math.floor(i/a),s=o0&&(r=0),s===c&&r<0&&(r=0);var l=s+100/(n.itemsWrapperRef.clientWidth/r);return n.itemsListRef&&[`WebkitTransform`,`MozTransform`,`MsTransform`,`OTransform`,`transform`,`msTransform`].forEach(function(e){n.itemsListRef.style[e]=(0,a.default)(l,`%`,n.props.axis)}),!0}),C(b(n),`slideRight`,function(e){n.moveTo(n.state.firstItem-(typeof e==`number`?e:1))}),C(b(n),`slideLeft`,function(e){n.moveTo(n.state.firstItem+(typeof e==`number`?e:1))}),C(b(n),`moveTo`,function(e){e=e<0?0:e,e=e>=n.state.lastPosition?n.state.lastPosition:e,n.setState({firstItem:e})}),n.state={selectedItem:e.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},n}return h(c,[{key:`componentDidMount`,value:function(){this.setupThumbs()}},{key:`componentDidUpdate`,value:function(e){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==e.children&&this.updateSizes()}},{key:`componentWillUnmount`,value:function(){this.destroyThumbs()}},{key:`setupThumbs`,value:function(){(0,s.default)().addEventListener(`resize`,this.updateSizes),(0,s.default)().addEventListener(`DOMContentLoaded`,this.updateSizes),this.updateSizes()}},{key:`destroyThumbs`,value:function(){(0,s.default)().removeEventListener(`resize`,this.updateSizes),(0,s.default)().removeEventListener(`DOMContentLoaded`,this.updateSizes)}},{key:`getFirstItem`,value:function(e){var t=e;return e>=this.state.lastPosition&&(t=this.state.lastPosition),e1,i=this.state.showArrows&&this.state.firstItem>0,s=this.state.showArrows&&this.state.firstItem{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(){return document}})),Nn=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setPosition=e.getPosition=e.isKeyboardEvent=e.defaultStatusFormatter=e.noop=void 0;var t=i(),n=r(kn());function r(e){return e&&e.__esModule?e:{default:e}}e.noop=function(){},e.defaultStatusFormatter=function(e,t){return`${e} of ${t}`},e.isKeyboardEvent=function(e){return e?e.hasOwnProperty(`key`):!1},e.getPosition=function(e,n){if(n.infiniteLoop&&++e,e===0)return 0;var r=t.Children.count(n.children);if(n.centerMode&&n.axis===`horizontal`){var i=-e*n.centerSlidePercentage,a=r-1;return e&&(e!==a||n.infiniteLoop)?i+=(100-n.centerSlidePercentage)/2:e===a&&(i+=100-n.centerSlidePercentage),i}return-e*100},e.setPosition=function(e,t){var r={};return[`WebkitTransform`,`MozTransform`,`MsTransform`,`OTransform`,`transform`,`msTransform`].forEach(function(i){r[i]=(0,n.default)(e,`%`,t)}),r}})),Pn=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fadeAnimationHandler=e.slideStopSwipingHandler=e.slideSwipeAnimationHandler=e.slideAnimationHandler=void 0;var t=i(),n=a(kn()),r=Nn();function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;tl))return c<0?e.centerMode&&e.centerSlidePercentage&&e.axis===`horizontal`?a.itemListStyle=(0,r.setPosition)(-(l+2)*e.centerSlidePercentage-(100-e.centerSlidePercentage)/2,e.axis):a.itemListStyle=(0,r.setPosition)(-(l+2)*100,e.axis):c>l&&(a.itemListStyle=(0,r.setPosition)(0,e.axis)),a;var u=(0,r.getPosition)(o,e),d=(0,n.default)(u,`%`,e.axis),f=e.transitionTime+`ms`;return a.itemListStyle={WebkitTransform:d,msTransform:d,OTransform:d,transform:d},i.swiping||(a.itemListStyle=s(s({},a.itemListStyle),{},{WebkitTransitionDuration:f,MozTransitionDuration:f,OTransitionDuration:f,transitionDuration:f,msTransitionDuration:f})),a},e.slideSwipeAnimationHandler=function(e,n,i,a){var o={},s=n.axis===`horizontal`,c=t.Children.count(n.children),l=0,u=(0,r.getPosition)(i.selectedItem,n),d=n.infiniteLoop?(0,r.getPosition)(c-1,n)-100:(0,r.getPosition)(c-1,n),f=s?e.x:e.y,p=f;u===l&&f>0&&(p=0),u===d&&f<0&&(p=0);var m=u+100/(i.itemSize/p),h=Math.abs(f)>n.swipeScrollTolerance;return n.infiniteLoop&&h&&(i.selectedItem===0&&m>-100?m-=c*100:i.selectedItem===c-1&&m<-c*100&&(m+=c*100)),(!n.preventMovementUntilSwipeScrollTolerance||h||i.swipeMovementStarted)&&(i.swipeMovementStarted||a({swipeMovementStarted:!0}),o.itemListStyle=(0,r.setPosition)(m,n.axis)),h&&!i.cancelClick&&a({cancelClick:!0}),o},e.slideStopSwipingHandler=function(e,t){var n=(0,r.getPosition)(t.selectedItem,e);return{itemListStyle:(0,r.setPosition)(n,e.axis)}},e.fadeAnimationHandler=function(e,t){var n=e.transitionTime+`ms`,r=`ease-in-out`,i={position:`absolute`,display:`block`,zIndex:-2,minHeight:`100%`,opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:r,msTransitionTimingFunction:r,MozTransitionTimingFunction:r,WebkitTransitionTimingFunction:r,OTransitionTimingFunction:r};return t.swiping||(i=s(s({},i),{},{WebkitTransitionDuration:n,MozTransitionDuration:n,OTransitionDuration:n,transitionDuration:n,msTransitionDuration:n})),{slideStyle:i,selectedStyle:s(s({},i),{},{opacity:1,position:`relative`}),prevStyle:s({},i)}}})),Fn=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=f(i()),n=u(En()),r=u(Dn()),a=u(jn()),o=u(Mn()),s=u(An()),c=Nn(),l=Pn();function u(e){return e&&e.__esModule?e:{default:e}}function d(){if(typeof WeakMap!=`function`)return null;var e=new WeakMap;return d=function(){return e},e}function f(e){if(e&&e.__esModule)return e;if(e===null||p(e)!==`object`&&typeof e!=`function`)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function p(e){"@babel/helpers - typeof";return p=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},p(e)}function m(){return m=Object.assign||function(e){for(var t=1;t`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function D(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O=function(e){b(u,e);var i=S(u);function u(e){var n;_(this,u),n=i.call(this,e),D(w(n),`thumbsRef`,void 0),D(w(n),`carouselWrapperRef`,void 0),D(w(n),`listRef`,void 0),D(w(n),`itemsRef`,void 0),D(w(n),`timer`,void 0),D(w(n),`animationHandler`,void 0),D(w(n),`setThumbsRef`,function(e){n.thumbsRef=e}),D(w(n),`setCarouselWrapperRef`,function(e){n.carouselWrapperRef=e}),D(w(n),`setListRef`,function(e){n.listRef=e}),D(w(n),`setItemsRef`,function(e,t){n.itemsRef||=[],n.itemsRef[t]=e}),D(w(n),`autoPlay`,function(){t.Children.count(n.props.children)<=1||(n.clearAutoPlay(),n.props.autoPlay&&(n.timer=setTimeout(function(){n.increment()},n.props.interval)))}),D(w(n),`clearAutoPlay`,function(){n.timer&&clearTimeout(n.timer)}),D(w(n),`resetAutoPlay`,function(){n.clearAutoPlay(),n.autoPlay()}),D(w(n),`stopOnHover`,function(){n.setState({isMouseEntered:!0},n.clearAutoPlay)}),D(w(n),`startOnLeave`,function(){n.setState({isMouseEntered:!1},n.autoPlay)}),D(w(n),`isFocusWithinTheCarousel`,function(){return n.carouselWrapperRef?!!((0,o.default)().activeElement===n.carouselWrapperRef||n.carouselWrapperRef.contains((0,o.default)().activeElement)):!1}),D(w(n),`navigateWithKeyboard`,function(e){if(n.isFocusWithinTheCarousel()){var t=n.props.axis===`horizontal`,r={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},i=t?r.ArrowRight:r.ArrowDown,a=t?r.ArrowLeft:r.ArrowUp;i===e.keyCode?n.increment():a===e.keyCode&&n.decrement()}}),D(w(n),`updateSizes`,function(){if(!(!n.state.initialized||!n.itemsRef||n.itemsRef.length===0)){var e=n.props.axis===`horizontal`,t=n.itemsRef[0];if(t){var r=e?t.clientWidth:t.clientHeight;n.setState({itemSize:r}),n.thumbsRef&&n.thumbsRef.updateSizes()}}}),D(w(n),`setMountState`,function(){n.setState({hasMount:!0}),n.updateSizes()}),D(w(n),`handleClickItem`,function(e,r){if(t.Children.count(n.props.children)!==0){if(n.state.cancelClick){n.setState({cancelClick:!1});return}n.props.onClickItem(e,r),e!==n.state.selectedItem&&n.setState({selectedItem:e})}}),D(w(n),`handleOnChange`,function(e,r){t.Children.count(n.props.children)<=1||n.props.onChange(e,r)}),D(w(n),`handleClickThumb`,function(e,t){n.props.onClickThumb(e,t),n.moveTo(e)}),D(w(n),`onSwipeStart`,function(e){n.setState({swiping:!0}),n.props.onSwipeStart(e)}),D(w(n),`onSwipeEnd`,function(e){n.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),n.props.onSwipeEnd(e),n.clearAutoPlay(),n.state.autoPlay&&n.autoPlay()}),D(w(n),`onSwipeMove`,function(e,t){n.props.onSwipeMove(t);var r=n.props.swipeAnimationHandler(e,n.props,n.state,n.setState.bind(w(n)));return n.setState(g({},r)),!!Object.keys(r).length}),D(w(n),`decrement`,function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;n.moveTo(n.state.selectedItem-(typeof e==`number`?e:1))}),D(w(n),`increment`,function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;n.moveTo(n.state.selectedItem+(typeof e==`number`?e:1))}),D(w(n),`moveTo`,function(e){if(typeof e==`number`){var r=t.Children.count(n.props.children)-1;e<0&&(e=n.props.infiniteLoop?r:0),e>r&&(e=n.props.infiniteLoop?0:r),n.selectItem({selectedItem:e}),n.state.autoPlay&&n.state.isMouseEntered===!1&&n.resetAutoPlay()}}),D(w(n),`onClickNext`,function(){n.increment(1)}),D(w(n),`onClickPrev`,function(){n.decrement(1)}),D(w(n),`onSwipeForward`,function(){n.increment(1),n.props.emulateTouch&&n.setState({cancelClick:!0})}),D(w(n),`onSwipeBackwards`,function(){n.decrement(1),n.props.emulateTouch&&n.setState({cancelClick:!0})}),D(w(n),`changeItem`,function(e){return function(t){(!(0,c.isKeyboardEvent)(t)||t.key===`Enter`)&&n.moveTo(e)}}),D(w(n),`selectItem`,function(e){n.setState(g({previousItem:n.state.selectedItem},e),function(){n.setState(n.animationHandler(n.props,n.state))}),n.handleOnChange(e.selectedItem,t.Children.toArray(n.props.children)[e.selectedItem])}),D(w(n),`getInitialImage`,function(){var e=n.props.selectedItem,t=n.itemsRef&&n.itemsRef[e];return(t&&t.getElementsByTagName(`img`)||[])[0]}),D(w(n),`getVariableItemHeight`,function(e){var t=n.itemsRef&&n.itemsRef[e];if(n.state.hasMount&&t&&t.children.length){var r=t.children[0].getElementsByTagName(`img`)||[];if(r.length>0){var i=r[0];i.complete||i.addEventListener(`load`,function e(){n.forceUpdate(),i.removeEventListener(`load`,e)})}var a=(r[0]||t.children[0]).clientHeight;return a>0?a:null}return null});var r={initialized:!1,previousItem:e.selectedItem,selectedItem:e.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:e.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return n.animationHandler=typeof e.animationHandler==`function`&&e.animationHandler||e.animationHandler===`fade`&&l.fadeAnimationHandler||l.slideAnimationHandler,n.state=g(g({},r),n.animationHandler(e,r)),n}return y(u,[{key:`componentDidMount`,value:function(){this.props.children&&this.setupCarousel()}},{key:`componentDidUpdate`,value:function(e,t){!e.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!e.autoFocus&&this.props.autoFocus&&this.forceFocus(),t.swiping&&!this.state.swiping&&this.setState(g({},this.props.stopSwipingHandler(this.props,this.state))),(e.selectedItem!==this.props.selectedItem||e.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),e.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:`componentWillUnmount`,value:function(){this.destroyCarousel()}},{key:`setupCarousel`,value:function(){var e=this;this.bindEvents(),this.state.autoPlay&&t.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var t=e.getInitialImage();t&&!t.complete?t.addEventListener(`load`,e.setMountState):e.setMountState()})}},{key:`destroyCarousel`,value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:`setupAutoPlay`,value:function(){this.autoPlay();var e=this.carouselWrapperRef;this.props.stopOnHover&&e&&(e.addEventListener(`mouseenter`,this.stopOnHover),e.addEventListener(`mouseleave`,this.startOnLeave))}},{key:`destroyAutoPlay`,value:function(){this.clearAutoPlay();var e=this.carouselWrapperRef;this.props.stopOnHover&&e&&(e.removeEventListener(`mouseenter`,this.stopOnHover),e.removeEventListener(`mouseleave`,this.startOnLeave))}},{key:`bindEvents`,value:function(){(0,s.default)().addEventListener(`resize`,this.updateSizes),(0,s.default)().addEventListener(`DOMContentLoaded`,this.updateSizes),this.props.useKeyboardArrows&&(0,o.default)().addEventListener(`keydown`,this.navigateWithKeyboard)}},{key:`unbindEvents`,value:function(){(0,s.default)().removeEventListener(`resize`,this.updateSizes),(0,s.default)().removeEventListener(`DOMContentLoaded`,this.updateSizes);var e=this.getInitialImage();e&&e.removeEventListener(`load`,this.setMountState),this.props.useKeyboardArrows&&(0,o.default)().removeEventListener(`keydown`,this.navigateWithKeyboard)}},{key:`forceFocus`,value:function(){var e;(e=this.carouselWrapperRef)==null||e.focus()}},{key:`renderItems`,value:function(e){var n=this;return this.props.children?t.Children.map(this.props.children,function(i,a){var o=a===n.state.selectedItem,s=a===n.state.previousItem,c=o&&n.state.selectedStyle||s&&n.state.prevStyle||n.state.slideStyle||{};n.props.centerMode&&n.props.axis===`horizontal`&&(c=g(g({},c),{},{minWidth:n.props.centerSlidePercentage+`%`})),n.state.swiping&&n.state.swipeMovementStarted&&(c=g(g({},c),{},{pointerEvents:`none`}));var l={ref:function(e){return n.setItemsRef(e,a)},key:`itemKey`+a+(e?`clone`:``),className:r.default.ITEM(!0,a===n.state.selectedItem,a===n.state.previousItem),onClick:n.handleClickItem.bind(n,a,i),style:c};return t.default.createElement(`li`,l,n.props.renderItem(i,{isSelected:a===n.state.selectedItem,isPrevious:a===n.state.previousItem}))}):[]}},{key:`renderControls`,value:function(){var e=this,n=this.props,r=n.showIndicators,i=n.labels,a=n.renderIndicator,o=n.children;return r?t.default.createElement(`ul`,{className:`control-dots`},t.Children.map(o,function(t,n){return a&&a(e.changeItem(n),n===e.state.selectedItem,n,i.item)})):null}},{key:`renderStatus`,value:function(){return this.props.showStatus?t.default.createElement(`p`,{className:`carousel-status`},this.props.statusFormatter(this.state.selectedItem+1,t.Children.count(this.props.children))):null}},{key:`renderThumbs`,value:function(){return!this.props.showThumbs||!this.props.children||t.Children.count(this.props.children)===0?null:t.default.createElement(a.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:`render`,value:function(){var e=this;if(!this.props.children||t.Children.count(this.props.children)===0)return null;var i=this.props.swipeable&&t.Children.count(this.props.children)>1,a=this.props.axis===`horizontal`,o=this.props.showArrows&&t.Children.count(this.props.children)>1,s=o&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,c=o&&(this.state.selectedItem{})),Ln=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(Fn()),n=In(),r=i(jn());function i(e){return e&&e.__esModule?e:{default:e}}})),Rn=r(((e,t)=>{var n=it();t.exports=function(){return n.Date.now()}})),zn=r(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),Bn=r(((e,t)=>{var n=zn(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),Vn=r(((e,t)=>{var n=Bn(),r=lt(),i=ot(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),Hn=r(((e,t)=>{var n=lt(),r=Rn(),i=Vn(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c})),Un=t(Hn(),1);function Wn(e,t,n,r,i=!1){let a=K.useRef();a.current=t,K.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;let t=n,o=e=>{a.current?.call(t,e)};return t.addEventListener(e,o,{passive:r,capture:i}),()=>{t.removeEventListener(e,o,{capture:i})}},[e,n,r,i])}function Gn(e,t){return e===void 0?void 0:t}var Kn=Math.PI;function qn(e){return e*Kn/180}var Jn=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Yn=(e,t,n,r,i)=>{switch(e){case`left`:return Math.floor(t)+r+i/2;case`center`:return Math.floor(t+n/2);case`right`:return Math.floor(t+n)-r-i/2}},Xn=(e,t,n)=>Math.min(e,t-n*2),Zn=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Qn=e=>{let t=e.fgColor??`currentColor`;return K.createElement(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},K.createElement(`path`,{d:`M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,vectorEffect:`non-scaling-stroke`}),K.createElement(`path`,{d:`M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,vectorEffect:`non-scaling-stroke`}))},$n=e=>{let t=e.fgColor??`currentColor`;return K.createElement(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},K.createElement(`path`,{d:`M19 6L10.3802 17L5.34071 11.8758`,vectorEffect:`non-scaling-stroke`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}))};function er(e,t,n){let[r,i]=K.useState(e),a=K.useRef(!0);K.useEffect(()=>()=>{a.current=!1},[]);let o=K.useRef((0,Un.default)(e=>{a.current&&i(e)},n));return K.useLayoutEffect(()=>{a.current&&o.current(()=>e())},t),r}var tr=RegExp(`^[^A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿]*[֑-߿יִ-﷽ﹰ-ﻼ]`);function nr(e){return tr.test(e)?`rtl`:`not-rtl`}var rr=void 0;function ir(){if(typeof document>`u`)return 0;if(rr!==void 0)return rr;let e=document.createElement(`p`);e.style.width=`100%`,e.style.height=`200px`;let t=document.createElement(`div`);t.id=`testScrollbar`,t.style.position=`absolute`,t.style.top=`0px`,t.style.left=`0px`,t.style.visibility=`hidden`,t.style.width=`200px`,t.style.height=`150px`,t.style.overflow=`hidden`,t.append(e),document.body.append(t);let n=e.offsetWidth;t.style.overflow=`scroll`;let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),rr=n-r,rr}var ar=Symbol();function or(e){let t=K.useRef([ar,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;let[n,r]=K.useState(e),[,i]=K.useState(),a=K.useCallback(e=>{let n=t.current[0];n!==ar&&(e=typeof e==`function`?e(n):e,e===n)||(n!==ar&&i({}),r(t=>typeof e==`function`?e(n===ar?t:n):e),t.current[0]=ar)},[]),o=K.useCallback(()=>{t.current[0]=ar,i({})},[]);return[t.current[0]===ar?n:t.current[0],a,o]}function sr(e){if(e.length===0)return``;let t=0,n=0;for(let r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(`, `)}function cr(e){let t=K.useRef(e);return Ft(e,t.current)||(t.current=e),t.current}var lr=Ln(),ur=e=>{let{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,a=t.filter(e=>e!==``);if(a.length===0)return null;let o=a.length>1;return K.createElement(wn,{"data-testid":`GDG-default-image-overlay-editor`},K.createElement(lr.Carousel,{showArrows:o,showThumbs:!1,swipeable:o,emulateTouch:o,infiniteLoop:o},a.map(e=>{let t=i?.(e)??K.createElement(`img`,{draggable:!1,src:e});return K.createElement(`div`,{className:`gdg-centering-container`,key:e},t)})),n&&r&&K.createElement(`button`,{className:`gdg-edit-icon`,onClick:r},K.createElement(Qn,null)))};function dr(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:``,highlight:null,hooks:null,langPrefix:`language-`,mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}var fr=dr();function pr(e){fr=e}var mr=/[&<>"']/,hr=new RegExp(mr.source,`g`),gr=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,_r=new RegExp(gr.source,`g`),vr={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},yr=e=>vr[e];function br(e,t){if(t){if(mr.test(e))return e.replace(hr,yr)}else if(gr.test(e))return e.replace(_r,yr);return e}var xr=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Sr(e){return e.replace(xr,(e,t)=>(t=t.toLowerCase(),t===`colon`?`:`:t.charAt(0)===`#`?t.charAt(1)===`x`?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):``))}var Cr=/(^|[^\[])\^/g;function wr(e,t){e=typeof e==`string`?e:e.source,t||=``;let n={replace:(t,r)=>(r=r.source||r,r=r.replace(Cr,`$1`),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}var Tr=/[^\w:]/g,Er=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Dr(e,t,n){if(e){let e;try{e=decodeURIComponent(Sr(n)).replace(Tr,``).toLowerCase()}catch{return null}if(e.indexOf(`javascript:`)===0||e.indexOf(`vbscript:`)===0||e.indexOf(`data:`)===0)return null}t&&!Er.test(n)&&(n=Mr(t,n));try{n=encodeURI(n).replace(/%25/g,`%`)}catch{return null}return n}var Or={},kr=/^[^:]+:\/*[^/]*$/,Ar=/^([^:]+:)[\s\S]*$/,jr=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Mr(e,t){Or[` `+e]||(kr.test(e)?Or[` `+e]=e+`/`:Or[` `+e]=Fr(e,`/`,!0)),e=Or[` `+e];let n=e.indexOf(`:`)===-1;return t.substring(0,2)===`//`?n?t:e.replace(Ar,`$1`)+t:t.charAt(0)===`/`?n?t:e.replace(jr,`$1`)+t:e+t}var Nr={exec:function(){}};function Pr(e,t){let n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function zr(e,t,n,r){let i=t.href,a=t.title?br(t.title):null,o=e[1].replace(/\\([\[\]])/g,`$1`);if(e[0].charAt(0)!==`!`){r.state.inLink=!0;let e={type:`link`,raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:`image`,raw:n,href:i,title:a,text:br(o)}}function Br(e,t){let n=e.match(/^(\s+)(?:```)/);if(n===null)return t;let r=n[1];return t.split(` +`).map(e=>{let t=e.match(/^\s+/);if(t===null)return e;let[n]=t;return n.length>=r.length?e.slice(r.length):e}).join(` +`)}var Vr=class{constructor(e){this.options=e||fr}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(/^ {1,4}/gm,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:Fr(e,` +`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Br(e,t[3]||``);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){let t=Fr(e,`#`);(this.options.pedantic||!t||/ $/.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/^ *>[ \t]?/gm,``),n=this.lexer.state.top;this.lexer.state.top=!0;let r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:`blockquote`,raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,i,a,o,s,c,l,u,d,f,p,m=t[1].trim(),h=m.length>1,g={type:`list`,raw:``,ordered:h,start:h?+m.slice(0,-1):``,loose:!1,items:[]};m=h?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=h?m:`[*+-]`);let _=RegExp(`^( {0,3}${m})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(p=!1,!(!(t=_.exec(e))||this.rules.block.hr.test(e)));){if(n=t[0],e=e.substring(n.length),l=t[2].split(` +`,1)[0].replace(/^\t+/,e=>` `.repeat(3*e.length)),u=e.split(` +`,1)[0],this.options.pedantic?(a=2,f=l.trimLeft()):(a=t[2].search(/[^ ]/),a=a>4?1:a,f=l.slice(a),a+=t[1].length),s=!1,!l&&/^ *$/.test(u)&&(n+=u+` +`,e=e.substring(u.length+1),p=!0),!p){let t=RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),o=RegExp(`^ {0,${Math.min(3,a-1)}}#`);for(;e&&(d=e.split(` +`,1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g,` `)),!(i.test(u)||o.test(u)||t.test(u)||r.test(e)));){if(u.search(/[^ ]/)>=a||!u.trim())f+=` +`+u.slice(a);else{if(s||l.search(/[^ ]/)>=4||i.test(l)||o.test(l)||r.test(l))break;f+=` +`+u}!s&&!u.trim()&&(s=!0),n+=d+` +`,e=e.substring(d.length+1),l=u.slice(a)}}g.loose||(c?g.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(f),r&&(i=r[0]!==`[ ] `,f=f.replace(/^\[[ xX]\] +/,``))),g.items.push({type:`list_item`,raw:n,task:!!r,checked:i,loose:!1,text:f}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=f.trimRight(),g.raw=g.raw.trimRight();let v=g.items.length;for(o=0;oe.type===`space`);g.loose=e.length>0&&e.some(e=>/\n.*\n/.test(e.raw))}if(g.loose)for(o=0;o$/,`$1`).replace(this.rules.inline._escapes,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(t){let e={type:`table`,header:Pr(t[1]).map(e=>({text:e})),align:t[2].replace(/^ *|\| *$/g,``).split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,``).split(` +`):[]};if(e.header.length===e.align.length){e.raw=t[0];let n=e.align.length,r,i,a,o;for(r=0;r({text:e}));for(n=e.header.length,i=0;i/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?`text`:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):br(t[0]):t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;let t=Fr(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Ir(t[2],`()`);if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),zr(t,{href:n&&n.replace(this.rules.inline._escapes,`$1`),title:r&&r.replace(this.rules.inline._escapes,`$1`)},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g,` `);if(e=t[e.toLowerCase()],!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return zr(n,e,n[0],this.lexer)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r||r[3]&&n.match(/[\p{L}\p{N}]/u))return;let i=r[1]||r[2]||``;if(!i||i&&(n===``||this.rules.inline.punctuation.exec(n))){let n=r[0].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=i.length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=e.slice(0,n+r.index+(r[0].length-i.length)+a);if(Math.min(n,a)%2){let e=t.slice(1,-1);return{type:`em`,raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}let c=t.slice(2,-2);return{type:`strong`,raw:t,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g,` `),n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=br(e,!0),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){let n=this.rules.inline.autolink.exec(e);if(n){let e,r;return n[2]===`@`?(e=br(this.options.mangle?t(n[1]):n[1]),r=`mailto:`+e):(e=br(n[1]),r=e),{type:`link`,raw:n[0],text:e,href:r,tokens:[{type:`text`,raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if(n[2]===`@`)e=br(this.options.mangle?t(n[0]):n[0]),r=`mailto:`+e;else{let t;do t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(t!==n[0]);e=br(n[0]),r=n[1]===`www.`?`http://`+n[0]:n[0]}return{type:`link`,raw:n[0],text:e,href:r,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e,t){let n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):br(n[0]):n[0]:br(this.options.smartypants?t(n[0]):n[0]),{type:`text`,raw:n[0],text:e}}}},J={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))`,def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Nr,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};J._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,J._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,J.def=wr(J.def).replace(`label`,J._label).replace(`title`,J._title).getRegex(),J.bullet=/(?:[*+-]|\d{1,9}[.)])/,J.listItemStart=wr(/^( *)(bull) */).replace(`bull`,J.bullet).getRegex(),J.list=wr(J.list).replace(/bull/g,J.bullet).replace(`hr`,`\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))`).replace(`def`,`\\n+(?=`+J.def.source+`)`).getRegex(),J._tag=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,J._comment=/|$)/,J.html=wr(J.html,`i`).replace(`comment`,J._comment).replace(`tag`,J._tag).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),J.paragraph=wr(J._paragraph).replace(`hr`,J.hr).replace(`heading`,` {0,3}#{1,6} `).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,J._tag).getRegex(),J.blockquote=wr(J.blockquote).replace(`paragraph`,J.paragraph).getRegex(),J.normal={...J},J.gfm={...J.normal,table:`^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`},J.gfm.table=wr(J.gfm.table).replace(`hr`,J.hr).replace(`heading`,` {0,3}#{1,6} `).replace(`blockquote`,` {0,3}>`).replace(`code`,` {4}[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,J._tag).getRegex(),J.gfm.paragraph=wr(J._paragraph).replace(`hr`,J.hr).replace(`heading`,` {0,3}#{1,6} `).replace(`|lheading`,``).replace(`table`,J.gfm.table).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,J._tag).getRegex(),J.pedantic={...J.normal,html:wr(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,J._comment).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Nr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:wr(J.normal._paragraph).replace(`hr`,J.hr).replace(`heading`,` *#{1,6} *[^ +]`).replace(`lheading`,J.lheading).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).getRegex()};var Y={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Nr,tag:`^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^`,link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:`reflink|nolink(?!\\()`,emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Nr,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]\`^{|}~`,Y.punctuation=wr(Y.punctuation).replace(/punctuation/g,Y._punctuation).getRegex(),Y.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Y.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,Y._comment=wr(J._comment).replace(`(?:-->|$)`,`-->`).getRegex(),Y.emStrong.lDelim=wr(Y.emStrong.lDelim).replace(/punct/g,Y._punctuation).getRegex(),Y.emStrong.rDelimAst=wr(Y.emStrong.rDelimAst,`g`).replace(/punct/g,Y._punctuation).getRegex(),Y.emStrong.rDelimUnd=wr(Y.emStrong.rDelimUnd,`g`).replace(/punct/g,Y._punctuation).getRegex(),Y._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Y._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Y._email=/[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])?)+(?![-_])/,Y.autolink=wr(Y.autolink).replace(`scheme`,Y._scheme).replace(`email`,Y._email).getRegex(),Y._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Y.tag=wr(Y.tag).replace(`comment`,Y._comment).replace(`attribute`,Y._attribute).getRegex(),Y._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Y._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Y._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Y.link=wr(Y.link).replace(`label`,Y._label).replace(`href`,Y._href).replace(`title`,Y._title).getRegex(),Y.reflink=wr(Y.reflink).replace(`label`,Y._label).replace(`ref`,J._label).getRegex(),Y.nolink=wr(Y.nolink).replace(`ref`,J._label).getRegex(),Y.reflinkSearch=wr(Y.reflinkSearch,`g`).replace(`reflink`,Y.reflink).replace(`nolink`,Y.nolink).getRegex(),Y.normal={...Y},Y.pedantic={...Y.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:wr(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Y._label).getRegex(),reflink:wr(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Y._label).getRegex()},Y.gfm={...Y.normal,escape:wr(Y.escape).replace(`])`,`~|])`).getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(r=`x`+r.toString(16)),t+=`&#`+r+`;`;return t}var Wr=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||fr,this.options.tokenizer=this.options.tokenizer||new Vr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={block:J.normal,inline:Y.normal};this.options.pedantic?(t.block=J.pedantic,t.inline=Y.pedantic):this.options.gfm&&(t.block=J.gfm,this.options.breaks?t.inline=Y.breaks:t.inline=Y.gfm),this.tokenizer.rules=t}static get rules(){return{block:J,inline:Y}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(/\r\n|\r/g,` +`),this.blockTokens(e,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){e=this.options.pedantic?e.replace(/\t/g,` `).replace(/^ +$/gm,``):e.replace(/^( *)(\t+)/gm,(e,t,n)=>t+` `.repeat(n.length));let n,r,i,a;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=` +`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&(r.type===`paragraph`||r.type===`text`)?(r.raw+=` +`+n.raw,r.text+=` +`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&(r.type===`paragraph`||r.type===`text`)?(r.raw+=` +`+n.raw,r.text+=` +`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(function(e){r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){r=t[t.length-1],a&&r.type===`paragraph`?(r.raw+=` +`+n.raw,r.text+=` +`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),a=i.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&r.type===`text`?(r.raw+=` +`+n.raw,r.text+=` +`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,a=e,o,s,c;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)e.includes(o[0].slice(o[0].lastIndexOf(`[`)+1,-1))&&(a=a.slice(0,o.index)+`[`+Rr(`a`,o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,o.index)+`[`+Rr(`a`,o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.escapedEmSt.exec(a))!=null;)a=a.slice(0,o.index+o[0].length-2)+`++`+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(s||(c=``),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,a,c)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e,Ur)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e,Ur))){e=e.substring(n.raw.length),t.push(n);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(function(e){r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i,Hr)){e=e.substring(n.raw.length),n.raw.slice(-1)!==`_`&&(c=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},Gr=class{constructor(e){this.options=e||fr}code(e,t,n){let r=(t||``).match(/\S*/)[0];if(this.options.highlight){let t=this.options.highlight(e,r);t!=null&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,``)+` +`,r?`
`+(n?e:br(e,!0))+`
+`:`
`+(n?e:br(e,!0))+`
+`}blockquote(e){return`
\n${e}
\n`}html(e){return e}heading(e,t,n,r){return this.options.headerIds?`${e}\n`:`${e}\n`}hr(){return this.options.xhtml?`
+`:`
+`}list(e,t,n){let r=t?`ol`:`ul`,i=t&&n!==1?` start="`+n+`"`:``;return`<`+r+i+`> +`+e+` +`}listitem(e){return`
  • ${e}
  • \n`}checkbox(e){return` `}paragraph(e){return`

    ${e}

    \n`}table(e,t){return t&&=`${t}`,` + +`+e+` +`+t+`
    +`}tablerow(e){return`\n${e}\n`}tablecell(e,t){let n=t.header?`th`:`td`;return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return this.options.xhtml?`
    `:`
    `}del(e){return`${e}`}link(e,t,n){if(e=Dr(this.options.sanitize,this.options.baseUrl,e),e===null)return n;let r=``+n+``,r}image(e,t,n){if(e=Dr(this.options.sanitize,this.options.baseUrl,e),e===null)return n;let r=`${n}`:`>`,r}text(e){return e}},Kr=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return``+n}image(e,t,n){return``+n}br(){return``}},qr=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,``).replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,``).replace(/\s/g,`-`)}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do r++,n=e+`-`+r;while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){let n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}},Jr=class e{constructor(e){this.options=e||fr,this.options.renderer=this.options.renderer||new Gr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Kr,this.slugger=new qr}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S=e.length;for(r=0;r0&&_.tokens[0].type===`paragraph`?(_.tokens[0].text=b+` `+_.tokens[0].text,_.tokens[0].tokens&&_.tokens[0].tokens.length>0&&_.tokens[0].tokens[0].type===`text`&&(_.tokens[0].tokens[0].text=b+` `+_.tokens[0].tokens[0].text)):_.tokens.unshift({type:`text`,text:b}):g+=b),g+=this.parse(_.tokens,h),d+=this.renderer.listitem(g,y,v);n+=this.renderer.list(d,p,m);continue;case`html`:n+=this.renderer.html(f.text);continue;case`paragraph`:n+=this.renderer.paragraph(this.parseInline(f.tokens));continue;case`text`:for(d=f.tokens?this.parseInline(f.tokens):f.text;r+1{if(r.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let e=`

    An error occurred:

    `+br(r.message+``,!0)+`
    `;if(t)return Promise.resolve(e);if(n){n(null,e);return}return e}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function Zr(e,t){return(n,r,i)=>{typeof r==`function`&&(i=r,r=null);let a={...r};r={...X.defaults,...a};let o=Xr(r.silent,r.async,i);if(n==null)return o(Error(`marked(): input parameter is undefined or null`));if(typeof n!=`string`)return o(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(n)+`, string expected`));if(Lr(r),r.hooks&&(r.hooks.options=r),i){let a=r.highlight,s;try{r.hooks&&(n=r.hooks.preprocess(n)),s=e(n,r)}catch(e){return o(e)}let c=function(e){let n;if(!e)try{r.walkTokens&&X.walkTokens(s,r.walkTokens),n=t(s,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=a,e?o(e):i(null,n)};if(!a||a.length<3||(delete r.highlight,!s.length))return c();let l=0;X.walkTokens(s,function(e){e.type===`code`&&(l++,setTimeout(()=>{a(e.text,e.lang,function(t,n){if(t)return c(t);n!=null&&n!==e.text&&(e.text=n,e.escaped=!0),l--,l===0&&c()})},0))}),l===0&&c();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(t=>e(t,r)).then(e=>r.walkTokens?Promise.all(X.walkTokens(e,r.walkTokens)).then(()=>e):e).then(e=>t(e,r)).then(e=>r.hooks?r.hooks.postprocess(e):e).catch(o);try{r.hooks&&(n=r.hooks.preprocess(n));let i=e(n,r);r.walkTokens&&X.walkTokens(i,r.walkTokens);let a=t(i,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(e){return o(e)}}}function X(e,t,n){return Zr(Wr.lex,Jr.parse)(e,t,n)}X.options=X.setOptions=function(e){return X.defaults={...X.defaults,...e},pr(X.defaults),X},X.getDefaults=dr,X.defaults=fr,X.use=function(...e){let t=X.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(e=>{let n={...e};if(n.async=X.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(e.renderer){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(e.tokenizer){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=X.defaults.renderer||new Gr;for(let n in e.renderer){let r=t[n];t[n]=(...i)=>{let a=e.renderer[n].apply(t,i);return a===!1&&(a=r.apply(t,i)),a}}n.renderer=t}if(e.tokenizer){let t=X.defaults.tokenizer||new Vr;for(let n in e.tokenizer){let r=t[n];t[n]=(...i)=>{let a=e.tokenizer[n].apply(t,i);return a===!1&&(a=r.apply(t,i)),a}}n.tokenizer=t}if(e.hooks){let t=X.defaults.hooks||new Yr;for(let n in e.hooks){let r=t[n];Yr.passThroughHooks.has(n)?t[n]=i=>{if(X.defaults.async)return Promise.resolve(e.hooks[n].call(t,i)).then(e=>r.call(t,e));let a=e.hooks[n].call(t,i);return r.call(t,a)}:t[n]=(...i)=>{let a=e.hooks[n].apply(t,i);return a===!1&&(a=r.apply(t,i)),a}}n.hooks=t}if(e.walkTokens){let t=X.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}X.setOptions(n)})},X.walkTokens=function(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(X,r)),r.type){case`table`:for(let e of r.header)n=n.concat(X.walkTokens(e.tokens,t));for(let e of r.rows)for(let r of e)n=n.concat(X.walkTokens(r.tokens,t));break;case`list`:n=n.concat(X.walkTokens(r.items,t));break;default:X.defaults.extensions&&X.defaults.extensions.childTokens&&X.defaults.extensions.childTokens[r.type]?X.defaults.extensions.childTokens[r.type].forEach(function(e){n=n.concat(X.walkTokens(r[e],t))}):r.tokens&&(n=n.concat(X.walkTokens(r.tokens,t)))}return n},X.parseInline=Zr(Wr.lexInline,Jr.parseInline),X.Parser=Jr,X.parser=Jr.parse,X.Renderer=Gr,X.TextRenderer=Kr,X.Lexer=Wr,X.lexer=Wr.lex,X.Tokenizer=Vr,X.Slugger=qr,X.Hooks=Yr,X.parse=X,X.options,X.setOptions,X.use,X.walkTokens,X.parseInline,Jr.parse,Wr.lex;var Qr=an(`div`)({name:`MarkdownContainer`,class:`gdg-mnuv029`,propsAsIs:!1}),$r=class extends K.PureComponent{targetElement=null;renderMarkdownIntoDiv(){let{targetElement:e,props:t}=this;if(e===null)return;let{contents:n,createNode:r}=t,i=X(n),a=document.createRange();a.selectNodeContents(e),a.deleteContents();let o=r?.(i);if(o===void 0){let e=document.createElement(`template`);e.innerHTML=i,o=e.content}e.append(o);let s=e.getElementsByTagName(`a`);for(let e of s)e.target=`_blank`,e.rel=`noreferrer noopener`}containerRefHook=e=>{this.targetElement=e,this.renderMarkdownIntoDiv()};render(){return this.renderMarkdownIntoDiv(),K.createElement(Qr,{ref:this.containerRefHook})}},ei=an(`textarea`)({name:`InputBox`,class:`gdg-izpuzkl`,propsAsIs:!1}),ti=an(`div`)({name:`ShadowBox`,class:`gdg-s69h75o`,propsAsIs:!1}),ni=an(`div`)({name:`GrowingEntryStyle`,class:`gdg-g1y0xocz`,propsAsIs:!1}),ri=0,ii=e=>{let{placeholder:t,value:n,onKeyDown:r,highlight:i,altNewline:a,validatedSelection:o,...s}=e,{onChange:c,className:l}=s,u=K.useRef(null),d=n??``;tn(c!==void 0,`GrowingEntry must be a controlled input area`);let[f]=K.useState(()=>`input-box-`+(ri=(ri+1)%1e7));K.useEffect(()=>{let e=u.current;if(e===null||e.disabled)return;let t=d.toString().length;e.focus(),e.setSelectionRange(i?0:t,t)},[]),K.useLayoutEffect(()=>{if(o!==void 0){let e=typeof o==`number`?[o,null]:o;u.current?.setSelectionRange(e[0],e[1])}},[o]);let p=K.useCallback(e=>{e.key===`Enter`&&e.shiftKey&&a===!0||r?.(e)},[a,r]);return K.createElement(ni,{className:`gdg-growing-entry`},K.createElement(ti,{className:l},d+` +`),K.createElement(ei,{...s,className:(l??``)+` gdg-input`,id:f,ref:u,onKeyDown:p,value:d,placeholder:t,dir:`auto`}))},ai=new Map,oi=new Map,si=new Map;function ci(){ai.clear(),si.clear(),oi.clear()}function li(e,t,n,r,i){let a=0,o={};for(let t of e)a+=n.get(t)??i,o[t]=(o[t]??0)+1;let s=t-a;for(let e of Object.keys(o)){let t=o[e],c=n.get(e)??i,l=c+s*(c*t/a)*r/t;n.set(e,l)}}function ui(e,t){let n=new Map,r=0;for(let t of`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?`){let i=e.measureText(t).width;n.set(t,i),r+=i}let i=r/n.size,a=(t/i+3)/4,o=n.keys();for(let e of o)n.set(e,(n.get(e)??i)*a);return n}function di(e,t,n,r){let i=oi.get(n);if(r&&i!==void 0&&i.count>2e4){let r=si.get(n);if(r===void 0&&(r=ui(e,i.size),si.set(n,r)),i.count>5e5){let e=0;for(let n of t)e+=r.get(n)??i.size;return e*1.01}let a=e.measureText(t);return li(t,a.width,r,Math.max(.05,1-i.count/2e5),i.size),oi.set(n,{count:i.count+t.length,size:i.size}),a.width}let a=e.measureText(t),o=a.width/t.length;if((i?.count??0)>2e4)return a.width;if(i===void 0)oi.set(n,{count:t.length,size:o});else{let e=o-i.size,r=t.length/(i.count+t.length),a=i.size+e*r;oi.set(n,{count:i.count+t.length,size:a})}return a.width}function fi(e,t,n,r,i,a,o,s){if(t.length<=1)return t.length;if(in;){let n=u===void 0?t.lastIndexOf(` `,c-1):0;n>0?c=n:c--,l=di(e,t.slice(0,Math.max(0,c)),r,o)}if(t[c]!==` `){let e=0;if(u===void 0)e=t.lastIndexOf(` `,c);else for(let t of u){if(t>c)break;e=t}e>0&&(c=e)}return c}function pi(e,t,n,r,i,a){let o=`${t}_${n}_${r}px`,s=ai.get(o);if(s!==void 0)return s;if(r<=0)return[];let c=[],l=t.split(` +`),u=oi.get(n),d=u===void 0?t.length:r/u.size*1.5,f=i&&u!==void 0&&u.count>2e4;for(let t of l){let i=di(e,t.slice(0,Math.max(0,d)),n,f),o=Math.min(t.length,d);if(i<=r)c.push(t);else{for(;i>r;){let s=fi(e,t,r,n,i,o,f,a),l=t.slice(0,Math.max(0,s));t=t.slice(l.length),c.push(l),i=di(e,t.slice(0,Math.max(0,d)),n,f),o=Math.min(t.length,d)}i>0&&c.push(t)}}return c=c.map((e,t)=>t===0?e.trimEnd():e.trim()),ai.set(o,c),ai.size>500&&ai.delete(ai.keys().next().value),c}function mi(e,t){return K.useMemo(()=>e.map((e,n)=>({group:e.group,grow:e.grow,hasMenu:e.hasMenu,icon:e.icon,id:e.id,menuIcon:e.menuIcon,overlayIcon:e.overlayIcon,sourceIndex:n,sticky:n=e.x&&n=e.y&&r=t.span[0]&&n.current.cell[0]<=t.span[1]}function vi(e,t){let[n,r]=e;return n>=t.x&&n=t.y&&ro)return!1;if(t.span===void 0)return s>=r&&s<=i;let[l,u]=t.span;return l>=r&&l<=i||u>=r&&l<=i||li}function Si(e,t,n,r){let i=0;if(n.current===void 0)return i;let a=n.current.range;(r||a.height*a.width>1)&&xi(e,t,a)&&i++;for(let r of n.current.rangeStack)xi(e,t,r)&&i++;return i}function Ci(e,t){let n=e;if(t!==void 0){let r=[...e],i=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,i)):(r.splice(t.dest+1,0,i),r.splice(t.src,1)),r=r.map((t,n)=>({...t,sticky:e[n].sticky})),n=r}return n}function wi(e,t){let n=0,r=Ci(e,t);for(let e=0;e0)for(let e of o)n-=e.width;let s=t,c=i??0;for(;c<=n&&s=d)return n}let f=a-l,p=e-(c??0);if(typeof o==`number`){let e=Math.floor((p-u)/o)+s;return e>=f?void 0:e}else{let e=u;for(let t=s;t`u`;async function Mi(){ji||document?.fonts?.ready===void 0||(await document.fonts.ready,ki=0,Ai={},ci())}Mi();function Ni(e,t,n,r){return`${e}_${r??t?.font}_${n}`}function Pi(e,t,n,r=`middle`){let i=Ni(e,t,r,n),a=Ai[i];return a===void 0&&(a=t.measureText(e),Ai[i]=a,ki++),ki>1e4&&(Ai={},ki=0),a}function Fi(e,t){let n=Ni(e,void 0,`middle`,t);return Ai[n]}function Ii(e,t){return typeof t!=`string`&&(t=t.baseFontFull),zi(e,t)}function Li(e,t){e.save(),e.textBaseline=t;let n=e.measureText(`ABCDEFGHIJKLMNOPQRSTUVWXYZ`);return e.restore(),n}var Ri=[];function zi(e,t){for(let e of Ri)if(e.key===t)return e.val;let n=Li(e,`alphabetic`),r=-(Li(e,`middle`).actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return Ri.push({key:t,val:r}),r}function Bi(e,t,n,r,i,a){let{ctx:o,rect:s,theme:c}=e,l=2**53-1;return t!==void 0&&(l=n-t,l<500&&(o.globalAlpha=1-l/500,o.fillStyle=c.bgSearchResult,o.fillRect(s.x+1,s.y+1,s.width-(i?2:1),s.height-(a?2:1)),o.globalAlpha=1,r!==void 0&&(r.fillStyle=c.bgSearchResult))),l<500}function Vi(e,t,n){let{ctx:r,theme:i}=e,a=t??{},o=n??i.textDark;return o!==a.fillStyle&&(r.fillStyle=o,a.fillStyle=o),a}function Hi(e,t,n,r,i){let{rect:a,ctx:o,theme:s}=e;o.fillStyle=s.textDark,qi({ctx:o,rect:a,theme:s},t,n,r,i)}function Ui(e,t,n,r,i,a,o,s,c){c===`right`?e.fillText(t,n+i-(s.cellHorizontalPadding+.5),r+a/2+o):c===`center`?e.fillText(t,n+i/2,r+a/2+o):e.fillText(t,n+s.cellHorizontalPadding+.5,r+a/2+o)}function Wi(e,t){let n=Pi(`ABCi09jgqpy`,e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function Gi(e,t){e.includes(` +`)&&(e=e.split(/\r?\n/,1)[0]);let n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function Ki(e,t,n,r,i,a,o,s,c,l){let u=s.baseFontFull,d=pi(e,t,u,i-s.cellHorizontalPadding*2,l??!1),f=Wi(e,u),p=s.lineHeight*f,m=f+p*(d.length-1),h=m+s.cellVerticalPadding>a;h&&(e.save(),e.rect(n,r,i,a),e.clip());let g=r+a/2-m/2,_=Math.max(r+s.cellVerticalPadding,g);for(let t of d)if(Ui(e,t,n,_,i,f,o,s,c),_+=p,_>r+a)break;h&&e.restore()}function qi(e,t,n,r,i){let{ctx:a,rect:o,theme:s}=e,{x:c,y:l,width:u,height:d}=o;r??=!1,r||(t=Gi(t,u));let f=Ii(a,s),p=nr(t)===`rtl`;if(n===void 0&&p&&(n=`right`),p&&(a.direction=`rtl`),t.length>0){let e=!1;n===`right`?(a.textAlign=`right`,e=!0):n!==void 0&&n!==`left`&&(a.textAlign=n,e=!0),r?Ki(a,t,c,l,u,d,f,s,n,i):Ui(a,t,c,l,u,d,f,s,n),e&&(a.textAlign=`start`),p&&(a.direction=`inherit`)}}function Ji(e,t,n,r,i,a){typeof a==`number`&&(a={tl:a,tr:a,br:a,bl:a}),a={tl:Math.max(0,Math.min(a.tl,i/2,r/2)),tr:Math.max(0,Math.min(a.tr,i/2,r/2)),bl:Math.max(0,Math.min(a.bl,i/2,r/2)),br:Math.max(0,Math.min(a.br,i/2,r/2))},e.moveTo(t+a.tl,n),e.arcTo(t+r,n,t+r,n+a.tr,a.tr),e.arcTo(t+r,n+i,t+r-a.br,n+i,a.br),e.arcTo(t,n+i,t,n+i-a.bl,a.bl),e.arcTo(t,n,t+a.tl,n,a.tl)}function Yi(e,t,n){let r=1.25;e.arc(t,n-r*3.5,r,0,2*Math.PI,!1),e.arc(t,n,r,0,2*Math.PI,!1),e.arc(t,n+r*3.5,r,0,2*Math.PI,!1)}function Xi(e,t,n){let r=function(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),a=n/i,o=r/i;return{x:n,y:t.y-e.y,len:i,nx:a,ny:o,ang:Math.atan2(o,a)}},i,a=t.length,o=t[a-1];for(let s=0;s1?1:f),h=1,g=!1;p<0?m<0?m=Math.PI+m:(m=Math.PI-m,h=-1,g=!0):m>0&&(h=-1,g=!0),i=c.radius===void 0?n:c.radius;let _=m/2,v=Math.abs(Math.cos(_)*i/Math.sin(_)),y;v>Math.min(u.len/2,d.len/2)?(v=Math.min(u.len/2,d.len/2),y=Math.abs(v*Math.sin(_)/Math.cos(_))):y=i;let b=c.x+d.nx*v,x=c.y+d.ny*v;b+=-d.ny*y*h,x+=d.nx*y*h,e.arc(b,x,y,u.ang+Math.PI/2*h,d.ang-Math.PI/2*h,g),o=c,c=l}e.closePath()}function Zi(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h={x:0,y:a+l,width:0,height:0};if(e>=p.length||t>=u||t<-2||e<0)return h;let g=a-i;if(e>=d){let t=o>e?-1:1,n=wi(p);h.x+=n+c;for(let n=o;n!==e;n+=t)h.x+=p[t===1?n:n-1].width*t}else for(let t=0;t0&&gi(p[t-1].group,r)&&p[t-1].sticky===a;){let e=p[t-1];h.x-=e.width,h.width+=e.width,t--}let o=e;for(;o+1n&&(h.width=n-h.x)}}else if(t>=u-f){let e=u-t;for(h.y=r;e>0;){let n=t+e-1;h.height=typeof m==`number`?m:m(n),h.y-=h.height,e--}h.height+=1}else{let e=s>t?-1:1;if(typeof m==`number`){let e=t-s;h.y+=e*m}else for(let n=s;n!==t;n+=e)h.y+=m(n)*e;h.height=(typeof m==`number`?m:m(t))+1}return h}var Qi=1<<21;function $i(e,t){return(t+2)*Qi+e}function ea(e){return e%Qi}function ta(e){return Math.floor(e/Qi)-2}function na(e){return[ea(e),ta(e)]}var ra=class{visibleWindow={x:0,y:0,width:0,height:0};freezeCols=0;freezeRows=[];isInWindow=e=>{let t=ea(e),n=ta(e),r=this.visibleWindow,i=t>=r.x&&t<=r.x+r.width||t=r.y&&n<=r.y+r.height||this.freezeRows.includes(n);return i&&a};setWindow(e,t,n){this.visibleWindow.x===e.x&&this.visibleWindow.y===e.y&&this.visibleWindow.width===e.width&&this.visibleWindow.height===e.height&&this.freezeCols===t&&Ft(this.freezeRows,n)||(this.visibleWindow=e,this.freezeCols=t,this.freezeRows=n,this.clearOutOfWindow())}},ia=class extends ra{cache=new Map;setValue=(e,t)=>{this.cache.set($i(e[0],e[1]),t)};getValue=e=>this.cache.get($i(e[0],e[1]));clearOutOfWindow=()=>{for(let[e]of this.cache.entries())this.isInWindow(e)||this.cache.delete(e)}},aa=class{cells;constructor(e=[]){this.cells=new Set(e.map(e=>$i(e[0],e[1])))}add(e){this.cells.add($i(e[0],e[1]))}has(e){return e!==void 0&&this.cells.has($i(e[0],e[1]))}remove(e){this.cells.delete($i(e[0],e[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(let e of this.cells)if(ta(e)<0)return!0;return!1}hasItemInRectangle(e){for(let t=e.y;t{let i=sa(e,n[r],t,c);return l=Math.max(l,i),i});if(u.length>5&&s){l=0;let e=0;for(let t of u)e+=t;let t=e/u.length;for(let e=0;e=t*2?u[e]=0:l=Math.max(l,u[e])}let d=e.font;e.font=t.headerFontFull,l=Math.max(l,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28)),e.font=d;let f=Math.max(Math.ceil(a),Math.min(Math.floor(o),Math.ceil(l)));return{...n,width:f}}function la(e,t,n,r,i,a,o,s,c){let l=K.useRef(t),u=K.useRef(n),d=K.useRef(o);l.current=t,u.current=n,d.current=o;let[f,p]=K.useMemo(()=>{if(typeof window>`u`)return[null,null];let e=document.createElement(`canvas`);return e.style.display=`none`,e.style.opacity=`0`,e.style.position=`fixed`,[e,e.getContext(`2d`,{alpha:!1})]},[]);K.useLayoutEffect(()=>(f&&document.documentElement.append(f),()=>{f?.remove()}),[f]);let m=K.useRef({}),h=K.useRef(),[g,_]=K.useState();return K.useLayoutEffect(()=>{let t=u.current;if(t===void 0||e.every(It))return;let n=Math.max(1,10-Math.floor(e.length/1e4)),r=0;n1&&(n--,r=1);let i={x:0,y:0,width:e.length,height:Math.min(l.current,n)},a={x:0,y:l.current-1,width:e.length,height:1};(async()=>{let n=t(i,c.signal),o=r>0?t(a,c.signal):void 0,s;s=typeof n==`object`?n:await Nt(n),o!==void 0&&(s=typeof o==`object`?[...s,...o]:[...s,...await Nt(o)]),h.current=e,_(s)})()},[c.signal,e]),K.useMemo(()=>{let t=e.every(It)?e:p===null?e.map(e=>It(e)?e:{...e,width:oa}):(p.font=d.current.baseFontFull,e.map((t,n)=>{if(It(t))return t;if(m.current[t.id]!==void 0)return{...t,width:m.current[t.id]};if(g===void 0||h.current!==e||t.id===void 0)return{...t,width:oa};let r=ca(p,o,t,n,g,i,a,!0,s);return m.current[t.id]=r.width,r})),n=0,c=0,l=[];for(let[e,r]of t.entries())n+=r.width,r.grow!==void 0&&r.grow>0&&(c+=r.grow,l.push(e));if(n0){let e=[...t],i=r-n,a=i;for(let n=0;n{function n(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}t.exports=n})),da=r(((e,t)=>{var n=ua(),r=Vn();function i(e,t,i){return i===void 0&&(i=t,t=void 0),i!==void 0&&(i=r(i),i=i===i?i:0),t!==void 0&&(t=r(t),t=t===t?t:0),n(r(e),t,i)}t.exports=i})),fa=r(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a{function n(e){return e!==e}t.exports=n})),ma=r(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r{var n=fa(),r=pa(),i=ma();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),ga=r(((e,t)=>{var n=ha();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),_a=r(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r{function n(){}t.exports=n})),ya=r(((e,t)=>{var n=ft(),r=va(),i=pt();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),ba=r(((e,t)=>{var n=mt(),r=ga(),i=_a(),a=gt(),o=ya(),s=pt(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u{var n=ba();function r(e){return e&&e.length?n(e):[]}t.exports=r})),Sa=r(((e,t)=>{var n=ut(),r=at(),i=dt(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),Ca=r(((e,t)=>{var n=yt(),r=Sa();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),wa=r(((e,t)=>{var n=Ca();function r(e){return e!=null&&e.length?n(e,1):[]}t.exports=r})),Ta=r(((e,t)=>{var n=Math.ceil,r=Math.max;function i(e,t,i,a){for(var o=-1,s=r(n((t-e)/(i||1)),0),c=Array(s);s--;)c[a?s:++o]=e,e+=i;return c}t.exports=i})),Ea=r(((e,t)=>{var n=st(),r=bt(),i=ct(),a=lt();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),Da=r(((e,t)=>{var n=Vn(),r=1/0,i=17976931348623157e292;function a(e){return e?(e=n(e),e===r||e===-r?(e<0?-1:1)*i:e===e?e:0):e===0?e:0}t.exports=a})),Oa=r(((e,t)=>{var n=Ta(),r=Ea(),i=Da();function a(e){return function(t,a,o){return o&&typeof o!=`number`&&r(t,a,o)&&(a=o=void 0),t=i(t),a===void 0?(a=t,t=0):a=i(a),o=o===void 0?t{t.exports=Oa()()})),Aa=t(da(),1),ja=t(xa(),1),Ma=t(wa(),1),Na=t(ka(),1),Pa=``,Fa=e=>{let t=e.fgColor;return` + ${Pa}`},Ia=e=>{let t=e.fgColor;return` + ${Pa}`},La=e=>{let t=e.fgColor;return`${Pa} + + + `},Ra=e=>{let t=e.fgColor;return`${Pa} + + +`},za=e=>{let t=e.fgColor;return`${Pa} + + +`},Ba=e=>{let t=e.fgColor;return`${Pa} + + + + + `},Va={headerRowID:Fa,headerNumber:La,headerCode:Ia,headerString:Ra,headerBoolean:za,headerAudioUri:Ba,headerVideoUri:e=>{let t=e.fgColor;return`${Pa} + + +`},headerEmoji:e=>{let t=e.fgColor;return` + ${Pa} + + + + + + + + `},headerImage:e=>{let t=e.fgColor;return`${Pa} + + + +`},headerUri:Ba,headerPhone:e=>` + ${Pa} + + + `,headerMarkdown:e=>{let t=e.fgColor;return` + ${Pa} + + + `},headerDate:e=>{let t=e.fgColor;return`${Pa} + + +`},headerTime:e=>{let t=e.fgColor;return` + ${Pa} + + + + `},headerEmail:e=>{let t=e.fgColor;return`${Pa} + + + +`},headerReference:e=>{let t=e.fgColor,n=e.bgColor;return` + ${Pa} + + + + `},headerIfThenElse:e=>`${Pa} + + +`,headerSingleValue:e=>{let t=e.fgColor;return` + ${Pa} + + + `},headerLookup:e=>{let t=e.fgColor;return` + ${Pa} + + + `},headerTextTemplate:e=>{let t=e.fgColor;return`${Pa} + + +`},headerMath:e=>{let t=e.fgColor;return`${Pa} + + + + + +`},headerRollup:e=>{let t=e.fgColor;return` + ${Pa} + + + `},headerJoinStrings:e=>{let t=e.fgColor;return`${Pa} + + +`},headerSplitString:e=>{let t=e.fgColor;return` + ${Pa} + + + `},headerGeoDistance:e=>{let t=e.fgColor;return`${Pa} + + + +`},headerArray:e=>{let t=e.fgColor;return`${Pa} + + +`},rowOwnerOverlay:e=>{let t=e.fgColor;return` + + + `},protectedColumnOverlay:e=>{let t=e.fgColor;return` + + + +`},renameIcon:e=>{let t=e.bgColor;return`${Pa} + + + + +`}};function Ha(e,t){return e===`normal`?[t.bgIconHeader,t.fgIconHeader]:e===`selected`?[`white`,t.accentColor]:[t.accentColor,t.bgHeader]}var Ua=class{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(e,t){this.onSettled=t,this.headerIcons=e??{}}drawSprite(e,t,n,r,i,a,o,s=1){let[c,l]=Ha(t,o),u=a*Math.ceil(window.devicePixelRatio),d=`${c}_${l}_${u}_${e}`,f=this.spriteMap.get(d);if(f===void 0){let t=this.headerIcons[e];if(t===void 0)return;f=document.createElement(`canvas`);let n=f.getContext(`2d`);if(n===null)return;let r=new Image;r.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t({fgColor:l,bgColor:c}))}`,this.spriteMap.set(d,f);let i=r.decode();if(i===void 0)return;this.inFlight++,i.then(()=>{n.drawImage(r,0,0,u,u)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(n.globalAlpha=s),n.drawImage(f,0,0,u,u,r,i,a,a),s<1&&(n.globalAlpha=1)}};function Wa(e){if(e.length===0)return;let t;for(let n of e)t=Math.min(t??n.y,n.y);return t}function Ga(e,t,n,r,i,a,o,s,c){s??=t;let l=t,u=e,d=r-a,f=!1;for(;ls&&c(l,u,e,!1,o&&u===r-1)===!0){f=!0;break}l+=e,u++}if(!f){l=n;for(let e=0;e!e.sticky)?.sourceIndex??0;if(c>d){let e=Math.max(s,d),l=t,f=r;for(let t=a.sourceIndex-1;t>=e;t--)l-=o[t].width,f+=o[t].width;for(let e=a.sourceIndex+1;e<=c;e++)f+=o[e].width;u={x:l,y:n,width:f,height:i}}if(d>s){let e=Math.min(c,d-1),u=t,f=r;for(let e=a.sourceIndex-1;e>=s;e--)u-=o[e].width,f+=o[e].width;for(let t=a.sourceIndex+1;t<=e;t++)f+=o[t].width;l={x:u,y:n,width:f,height:i}}return[l,u]}function Ya(e,t,n,r){if(r===`any`)return Qa(e,{x:t,y:n,width:1,height:1});if(r===`vertical`&&(t=e.x),r===`horizontal`&&(n=e.y),vi([t,n],e))return;let i=t-e.x,a=e.x+e.width-t,o=n-e.y+1,s=e.y+e.height-n,c=Math.min(r===`vertical`?2**53-1:i,r===`vertical`?2**53-1:a,r===`horizontal`?2**53-1:o,r===`horizontal`?2**53-1:s);return c===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:c===o?{x:e.x,y:n,width:e.width,height:e.y-n}:c===a?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function Xa(e,t,n,r,i,a,o,s){return e<=i+o&&i<=e+n&&t<=a+s&&a<=t+r}function Za(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Qa(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function $a(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function eo(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;let i=t+4,a=n+4,o=-4-e.x,s=e.x+e.width-i,c=-4-e.y,l=e.y+e.height-a,u=o>0?e.x+Math.floor(o/r)*r:e.x,d=s>0?e.x+e.width-Math.floor(s/r)*r:e.x+e.width,f=c>0?e.y+Math.floor(c/r)*r:e.y,p=l>0?e.y+e.height-Math.floor(l/r)*r:e.y+e.height;return{x:u,y:f,width:d-u,height:p-f}}function to(e,t,n,r,i){let[a,o,s,c]=t,[l,u,d,f]=i,{x:p,y:m,width:h,height:g}=e,_=[];if(h<=0||g<=0)return _;let v=p+h,y=m+g,b=ps,C=m+g>c,w=p>=a&&pa&&v<=s||ps,T=m>=o&&mo&&y<=c||mc;if(w&&T){let e=Math.max(p,a),t=Math.max(m,o),n=Math.min(v,s),r=Math.min(y,c);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:l,y:u,width:d-l+1,height:f-u+1}})}if(b&&x){let e=p,t=m,n=Math.min(v,a),r=Math.min(y,o);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:0,y:0,width:l+1,height:u+1}})}if(x&&w){let e=Math.max(p,a),t=m,n=Math.min(v,s),r=Math.min(y,o);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:l,y:0,width:d-l+1,height:u+1}})}if(x&&S){let e=Math.max(p,s),t=m,r=v,i=Math.min(y,o);_.push({rect:{x:e,y:t,width:r-e,height:i-t},clip:{x:d,y:0,width:n-d+1,height:u+1}})}if(b&&T){let e=p,t=Math.max(m,o),n=Math.min(v,a),r=Math.min(y,c);_.push({rect:{x:e,y:t,width:n-e,height:r-t},clip:{x:0,y:u,width:l+1,height:f-u+1}})}if(S&&T){let e=Math.max(p,s),t=Math.max(m,o),r=v,i=Math.min(y,c);_.push({rect:{x:e,y:t,width:r-e,height:i-t},clip:{x:d,y:u,width:n-d+1,height:f-u+1}})}if(b&&C){let e=p,t=Math.max(m,c),n=Math.min(v,a),i=y;_.push({rect:{x:e,y:t,width:n-e,height:i-t},clip:{x:0,y:f,width:l+1,height:r-f+1}})}if(C&&w){let e=Math.max(p,a),t=Math.max(m,c),n=Math.min(v,s),i=y;_.push({rect:{x:e,y:t,width:n-e,height:i-t},clip:{x:l,y:f,width:d-l+1,height:r-f+1}})}if(S&&C){let e=Math.max(p,s),t=Math.max(m,c),i=v,a=y;_.push({rect:{x:e,y:t,width:i-e,height:a-t},clip:{x:d,y:f,width:n-d+1,height:r-f+1}})}return _}var no={kind:U.Loading,allowOverlay:!1};function ro(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,ee,te,ne){let re=y?.size??2**53-1,ie=performance.now(),ae=k.baseFontFull;e.font=ae;let oe={ctx:e},M=[0,0],N=g>0?Ti(c,g,l):0,se,P,ce=Wa(v);return Ka(t,s,a,o,i,(t,a,o,s,le)=>{let ue=Math.max(0,s-a),de=a+ue,fe=i+1,pe=t.width-ue,me=r-i-1;if(v.length>0){let e=!1;for(let t=0;t{e.save(),e.beginPath(),e.rect(de,fe,pe,me),e.clip()},ge=b.columns.hasIndex(t.sourceIndex),_e=d(t.group??``).overrideTheme,ve=t.themeOverride===void 0&&_e===void 0?k:zt(k,_e,t.themeOverride),ye=ve.baseFontFull;ye!==ae&&(ae=ye,e.font=ye),he();let F;return Ga(le,o,r,c,l,g,_,ce,(i,o,l,d,g)=>{if(o<0||(M[0]=t.sourceIndex,M[1]=o,y!==void 0&&!y.has(M)))return;if(v.length>0){let e=!1;for(let n=0;nle.span!==void 0&&e>=le.span[0]&&e<=le.span[1]);xe&&!m&&h?Se=0:xe&&h&&(Se=Math.max(Se,1)),I&&Se++,xe||(_&&Se++,ge&&!g&&Se++);let Ce=le.kind===U.Protected?be.bgCellMedium:be.bgCell,L;if((d||Ce!==k.bgCell)&&(L=W(Ce,L)),Se>0||ce){ce&&(L=W(be.bgHeader,L));for(let e=0;ene&&!pe){let n=be.baseFontFull;n!==ae&&(e.font=n,ae=n),F=lo(e,le,t.sourceIndex,o,R,Te,ue,i,de,l,Se>0,be,L??be.bgCell,C,w,z?.hoverAmount??0,E,O,ie,D,F,A,j,ee,te)}return we&&e.restore(),le.style===`faded`&&(e.globalAlpha=1),re--,fe&&(e.restore(),F?.deprep?.(oe),F=void 0,he(),ae=ye,e.font=ye),re<=0}),e.restore(),re<=0}),se}var io=[0,0],ao={x:0,y:0,width:0,height:0},oo=[void 0,()=>void 0],so=!1;function co(){so=!0}function lo(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w){let T,E;g!==void 0&&g[0][0]===n&&g[0][1]===r&&(T=g[1][0],E=g[1][1]);let D;io[0]=n,io[1]=r,ao.x=o,ao.y=s,ao.width=c,ao.height=l,oo[0]=S.getValue(io),oo[1]=e=>S.setValue(io,e),so=!1;let O={ctx:e,theme:d,col:n,row:r,cell:t,rect:ao,highlighted:u,cellFillColor:f,hoverAmount:h,frameTime:v,hoverX:T,drawState:oo,hoverY:E,imageLoader:p,spriteManager:m,hyperWrapping:_,overrideCursor:T===void 0?void 0:w,requestAnimationFrame:co},k=Bi(O,t.lastUpdated,v,b,i,a),A=C(t);if(A!==void 0){b?.renderer!==A&&(b?.deprep?.(O),b=void 0);let e=A.drawPrep?.(O,b);y!==void 0&&!rn(O.cell)?y(O,()=>A.draw(O,t)):A.draw(O,t),D=e===void 0?void 0:{deprep:e?.deprep,fillStyle:e?.fillStyle,font:e?.font,renderer:A}}return(k||so)&&x?.(io),D}function uo(e,t,n,r,i,a,o,s,c=-20,l=-20,u=void 0,d=`center`,f=`square`){let p=Math.floor(i+o/2),m=f===`circle`?1e4:t.roundingRadius??4,h=Xn(u??t.checkboxMaxSize,o,t.cellVerticalPadding),g=h/2,_=Yn(d,r,a,t.cellHorizontalPadding,h),v=Jn(_,p,h),y=Zn(r+c,i+l,v);switch(n){case!0:e.beginPath(),Ji(e,_-h/2,p-h/2,h,h,m),f===`circle`&&(g*=.8,h*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(_-g+h/4.23,p-g+h/1.97),e.lineTo(_-g+h/2.42,p-g+h/1.44),e.lineTo(_-g+h/1.29,p-g+h/3.25),e.strokeStyle=t.bgCell,e.lineJoin=`round`,e.lineCap=`round`,e.lineWidth=1.9,e.stroke();break;case null:case!1:e.beginPath(),Ji(e,_-h/2+.5,p-h/2+.5,h-1,h-1,m),e.lineWidth=1,e.strokeStyle=y?t.textDark:t.textMedium,e.stroke();break;case void 0:e.beginPath(),Ji(e,_-h/2,p-h/2,h,h,m),e.fillStyle=y?t.textMedium:t.textLight,e.fill(),f===`circle`&&(g*=.8,h*=.8),e.beginPath(),e.moveTo(_-h/3,p),e.lineTo(_+h/3,p),e.strokeStyle=t.bgCell,e.lineCap=`round`,e.lineWidth=1.9,e.stroke();break;default:Lt(n)}}function fo(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=o+s;if(y<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,y);let b=r?.[0]?.[0],x=r?.[0]?.[1],S=r?.[1]?.[0],C=r?.[1]?.[1];e.font=d.headerFontFull,Ka(t,0,a,0,y,(t,r,i,a)=>{if(g!==void 0&&!g.has([t.sourceIndex,-1]))return;let m=Math.max(0,a-r);e.save(),e.beginPath(),e.rect(r+m,s,t.width-m,o),e.clip();let y=h(t.group??``).overrideTheme,w=t.themeOverride===void 0&&y===void 0?d:zt(d,y,t.themeOverride);w.bgHeader!==d.bgHeader&&(e.fillStyle=w.bgHeader,e.fill()),w!==d&&(e.font=w.headerFontFull);let T=u.columns.hasIndex(t.sourceIndex),E=c!==void 0||l||t.headerRowMarkerDisabled===!0,D=!E&&x===-1&&b===t.sourceIndex,O=E?0:p.find(e=>e.item[0]===t.sourceIndex&&e.item[1]===-1)?.hoverAmount??0,k=u?.current!==void 0&&u.current.cell[0]===t.sourceIndex,A=T?w.accentColor:k?w.bgHeaderHasFocus:w.bgHeader,j=n?s:0,ee=t.sourceIndex===0?0:1;T?(e.fillStyle=A,e.fillRect(r+ee,j,t.width-ee,o)):(k||O>0)&&(e.beginPath(),e.rect(r+ee,j,t.width-ee,o),k&&(e.fillStyle=w.bgHeaderHasFocus,e.fill()),O>0&&(e.globalAlpha=O,e.fillStyle=w.bgHeaderHovered,e.fill(),e.globalAlpha=1)),bo(e,r,j,t.width,o,t,T,w,D,D?S:void 0,D?C:void 0,k,O,f,_,v),e.restore()}),n&&po(e,t,i,a,s,r,d,f,p,m,h,g)}function po(e,t,n,r,i,a,o,s,c,l,u,d){let[f,p]=a?.[0]??[],m=0;qa(t,n,r,i,(t,n,r,c,h,g)=>{if(d!==void 0&&!d.hasItemInRectangle({x:t[0],y:-2,width:t[1]-t[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(r,c,h,g),e.clip();let _=u(n),v=_?.overrideTheme===void 0?o:zt(o,_.overrideTheme),y=p===-2&&f!==void 0&&f>=t[0]&&f<=t[1],b=y?v.bgGroupHeaderHovered??v.bgHeaderHovered:v.bgGroupHeader??v.bgHeader;if(b!==o.bgHeader&&(e.fillStyle=b,e.fill()),e.fillStyle=v.textGroupHeader??v.textHeader,_!==void 0){let t=r;if(_.icon!==void 0&&(s.drawSprite(_.icon,`normal`,e,t+8,(i-20)/2,20,v),t+=26),e.fillText(_.name,t+8,i/2+Ii(e,o.headerFontFull)),_.actions!==void 0&&y){let t=go({x:r,y:c,width:h,height:g},_.actions);e.beginPath();let n=t[0].x-10,o=r+h-n;e.rect(n,0,o,i);let l=e.createLinearGradient(n,0,n+o,0),u=Ht(b,0);l.addColorStop(0,u),l.addColorStop(10/o,b),l.addColorStop(1,b),e.fillStyle=l,e.fill(),e.globalAlpha=.6;let[d,f]=a?.[1]??[-1,-1];for(let n=0;n<_.actions.length;n++){let i=_.actions[n],a=t[n],o=Za(a,d+r,f);o&&(e.globalAlpha=1),s.drawSprite(i.icon,`normal`,e,a.x+a.width/2-10,a.y+a.height/2-10,20,v),o&&(e.globalAlpha=.6)}e.globalAlpha=1}}r!==0&&l(t[0])&&(e.beginPath(),e.moveTo(r+.5,0),e.lineTo(r+.5,i),e.strokeStyle=o.borderColor,e.lineWidth=1,e.stroke()),e.restore(),m=r+h}),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,i),e.moveTo(0,i+.5),e.lineTo(n,i+.5),e.strokeStyle=o.borderColor,e.lineWidth=1,e.stroke()}var mo=30;function ho(e,t,n,r,i){return i?{x:e,y:t,width:mo,height:Math.min(mo,r)}:{x:e+n-mo,y:Math.max(t,t+r/2-mo/2),width:mo,height:Math.min(mo,r)}}function go(e,t){let n=[],r=e.x+e.width-26*t.length,i=e.y+e.height/2-13;for(let e=0;e35){let n=m?35:r-35,i=m?35*.7:r-35*.7,a=n/r,o=i/r,s=e.createLinearGradient(t,0,t+r,0),c=Ht(g,0);s.addColorStop(+!!m,g),s.addColorStop(a,g),s.addColorStop(o,c),s.addColorStop(+!m,c),e.fillStyle=s}else e.fillStyle=g;if(m&&(e.textAlign=`right`),h.textBounds!==void 0&&e.fillText(a.title,m?h.textBounds.x+h.textBounds.width:h.textBounds.x,n+i/2+Ii(e,s.headerFontFull)),m&&(e.textAlign=`left`),a.indicatorIcon!==void 0&&h.indicatorIconBounds!==void 0&&(!_||!Xa(h.menuBounds.x,h.menuBounds.y,h.menuBounds.width,h.menuBounds.height,h.indicatorIconBounds.x,h.indicatorIconBounds.y,h.indicatorIconBounds.width,h.indicatorIconBounds.height))){let t=o?`selected`:`normal`;a.style===`highlight`&&(t=o?`selected`:`special`),f.drawSprite(a.indicatorIcon,t,e,h.indicatorIconBounds.x,h.indicatorIconBounds.y,h.indicatorIconBounds.width,s)}if(_&&h.menuBounds!==void 0){let r=h.menuBounds,i=l!==void 0&&u!==void 0&&Za(r,l+t,u+n);if(i||(e.globalAlpha=.7),a.menuIcon===void 0||a.menuIcon===Gt.Triangle){e.beginPath();let t=r.x+r.width/2-5.5,n=r.y+r.height/2-3;Xi(e,[{x:t,y:n},{x:t+11,y:n},{x:t+5.5,y:n+6}],1),e.fillStyle=g,e.fill()}else if(a.menuIcon===Gt.Dots)e.beginPath(),Yi(e,r.x+r.width/2,r.y+r.height/2),e.fillStyle=g,e.fill();else{let t=r.x+(r.width-s.headerIconSize)/2,n=r.y+(r.height-s.headerIconSize)/2;f.drawSprite(a.menuIcon,`normal`,e,t,n,s.headerIconSize,s)}i||(e.globalAlpha=1)}}function bo(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=nr(a.title)===`rtl`,_=vo(e,a,t,n,r,i,s,g);m===void 0?yo(e,t,n,r,i,a,o,s,c,l,u,f,p,h,g,_):m({ctx:e,theme:s,rect:{x:t,y:n,width:r,height:i},column:a,columnIndex:a.sourceIndex,isSelected:o,hoverAmount:f,isHovered:c,hasSelectedCell:d,spriteManager:p,menuBounds:_?.menuBounds??{x:0,y:0,height:0,width:0},hoverX:l,hoverY:u},()=>yo(e,t,n,r,i,a,o,s,c,l,u,f,p,h,g,_))}var xo=r(((e,t)=>{function n(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i{var n=ht();function r(e,t,r,i){return n(e,function(e,n,a){t(i,e,r(e),a)}),i}t.exports=r})),Co=r(((e,t)=>{var n=xo(),r=So(),i=_t(),a=dt();function o(e,t){return function(o,s){var c=a(o)?n:r,l=t?t():{};return c(o,e,i(s,2),l)}}t.exports=o})),wo=t(r(((e,t)=>{var n=vt(),r=Co(),i=Object.prototype.hasOwnProperty;t.exports=r(function(e,t,r){i.call(e,r)?e[r].push(t):n(e,r,[t])})}))(),1);function To(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){if(_!==void 0||t[t.length-1]!==n[t.length-1])return;let y=Wa(g);Ka(t,c,o,s,a,(n,o,s,c,_)=>{if(n!==t[t.length-1])return;o+=n.width;let b=Math.max(o,c);b>r||(e.save(),e.beginPath(),e.rect(b,a+1,1e4,i-a-1),e.clip(),Ga(_,s,i,l,u,m,h,y,(t,n,r,i)=>{if(!i&&g.length>0&&!g.some(e=>Xa(o,t,1e4,r,e.x,e.y,e.width,e.height)))return;let a=f.hasIndex(n),s=p.hasIndex(n);e.beginPath();let c=d?.(n),l=c===void 0?v:zt(v,c);l.bgCell!==v.bgCell&&(e.fillStyle=l.bgCell,e.fillRect(o,t,1e4,r)),s&&(e.fillStyle=l.bgHeader,e.fillRect(o,t,1e4,r)),a&&(e.fillStyle=l.accentLight,e.fillRect(o,t,1e4,r))}),e.restore())})}function Eo(e,t,n,r,i,a,o,s,c){let l=!1;for(let e of t)if(!e.sticky){l=o(e.sourceIndex);break}let u=c.horizontalBorderColor??c.borderColor,d=c.borderColor,f=l?wi(t):0,p;if(f!==0&&(p=Vt(d,c.bgCell),e.beginPath(),e.moveTo(f+.5,0),e.lineTo(f+.5,r),e.strokeStyle=p,e.stroke()),i>0){let t=d===u&&p!==void 0?p:Vt(u,c.bgCell),o=Ti(a,i,s);e.beginPath(),e.moveTo(0,r-o+.5),e.lineTo(n,r-o+.5),e.strokeStyle=t,e.stroke()}}var Do=(e,t,n)=>{let r=0,i=t,a=0,o=n;if(e!==void 0&&e.length>0){r=2**53-1,a=2**53-1,i=-(2**53-1),o=-(2**53-1);for(let t of e)r=Math.min(r,t.x-1),i=Math.max(i,t.x+t.width+1),a=Math.min(a,t.y-1),o=Math.max(o,t.y+t.height+1)}return{minX:r,maxX:i,minY:a,maxY:o}};function Oo(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h=m.bgCell,{minX:g,maxX:_,minY:v,maxY:y}=Do(s,a,o),b=[],x=o-Ti(p,f,l),S=c,C=n,w=0;for(;S+i=v&&e<=y-1){let n=u?.(C)?.bgCell;n!==void 0&&n!==h&&C>=p-f&&b.push({x:g,y:e,w:_-g,h:t,color:n})}S+=t,C0)for(let e=0;e=g&&i<=_&&d(e+1)&&b.push({x:i,y:w,w:n.width,h:E,color:a}),T+=n.width}if(b.length===0)return;let D;e.beginPath();for(let t=b.length-1;t>=0;t--){let n=b[t];D===void 0?D=n.color:n.color!==D&&(e.fillStyle=D,e.fill(),e.beginPath(),D=n.color),e.rect(n.x,n.y,n.w,n.h)}D!==void 0&&(e.fillStyle=D,e.fill()),e.beginPath()}function ko(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_=!1){if(c!==void 0){e.beginPath(),e.save(),e.rect(0,0,a,o);for(let t of c)e.rect(t.x+1,t.y+1,t.width-1,t.height-1);e.clip(`evenodd`)}let v=g.horizontalBorderColor??g.borderColor,y=g.borderColor,{minX:b,maxX:x,minY:S,maxY:C}=Do(s,a,o),w=[];e.beginPath();let T=.5;for(let e=0;e=b&&i<=x&&p(e+1)&&w.push({x1:i,y1:Math.max(l,S),x2:i,y2:Math.min(o,C),color:y})}let E=o+.5;for(let e=h-m;e=S&&n<=C-1){let e=f?.(t);w.push({x1:b,y1:n,x2:x,y2:n,color:e?.horizontalBorderColor??e?.borderColor??v})}e+=d(t),t++}}let D=(0,wo.default)(w,e=>e.color);for(let t of Object.keys(D)){e.strokeStyle=t;for(let n of D[t])e.moveTo(n.x1,n.y1),e.lineTo(n.x2,n.y2);e.stroke(),e.beginPath()}c!==void 0&&e.restore()}function Ao(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=[];e.imageSmoothingEnabled=!1;let b=Math.min(i.cellYOffset,o),x=Math.max(i.cellYOffset,o),S=0;if(typeof _==`number`)S+=(x-b)*_;else for(let e=b;ei.cellYOffset&&(S=-S),S+=c-i.translateY;let C=Math.min(i.cellXOffset,a),w=Math.max(i.cellXOffset,a),T=0;for(let e=C;ei.cellXOffset&&(T=-T),T+=s-i.translateX;let E=wi(g);if(T!==0&&S!==0)return{regions:[]};let D=l>0?Ti(f,l,_):0,O=u-E-Math.abs(T),k=d-p-D-Math.abs(S)-1;if(O>150&&k>150){let i={sx:0,sy:0,sw:u*m,sh:d*m,dx:0,dy:0,dw:u*m,dh:d*m};if(S>0?(i.sy=(p+1)*m,i.sh=k*m,i.dy=(S+p+1)*m,i.dh=k*m,y.push({x:0,y:p,width:u,height:S+1})):S<0&&(i.sy=(-S+p+1)*m,i.sh=k*m,i.dy=(p+1)*m,i.dh=k*m,y.push({x:0,y:d+S-D,width:u,height:-S+D})),T>0?(i.sx=E*m,i.sw=O*m,i.dx=(T+E)*m,i.dw=O*m,y.push({x:E-1,y:0,width:T+2,height:d})):T<0&&(i.sx=(E-T)*m,i.sw=O*m,i.dx=E*m,i.dw=O*m,y.push({x:u+T,y:0,width:-T,height:d})),e.setTransform(1,0,0,1,0,0),v){if(E>0&&T!==0&&S===0&&(r===void 0||n?.[1]!==!1)){let n=E*m,r=d*m;e.drawImage(t,0,0,n,r,0,0,n,r)}if(D>0&&T===0&&S!==0&&(r===void 0||n?.[0]!==!1)){let n=(d-D)*m,r=u*m,i=D*m;e.drawImage(t,0,n,r,i,0,n,r,i)}}e.drawImage(t,i.sx,i.sy,i.sw,i.sh,i.dx,i.dy,i.dw,i.dh),e.scale(m,m)}return e.imageSmoothingEnabled=!0,{regions:y}}function jo(e,t,n,r,i,a,o,s,c,l){let u=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||Ka(c,n,r,i,s,(e,t,n,r)=>{if(e.sourceIndex===l){let e=Math.max(t,r)+1;return u.push({x:e,y:0,width:a-e,height:o}),!0}}),u}function Mo(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let r=0;re.style!==`no-outline`);if(g===void 0||g.length===0)return;let _=wi(s),v=Ti(p,f,d),y=[c,0,s.length,p-f],b=[_,0,t,n-v],x=g.map(e=>{let m=e.range,h=e.style??`dashed`;return to(m,y,t,n,b).map(m=>{let g=m.rect,_=Zi(g.x,g.y,t,n,u,l+u,r,i,a,o,p,c,f,s,d),v=g.width===1&&g.height===1?_:Zi(g.x+g.width-1,g.y+g.height-1,t,n,u,l+u,r,i,a,o,p,c,f,s,d);return g.x+g.width>=s.length&&--v.width,g.y+g.height>=p&&--v.height,{color:e.color,style:h,clip:m.clip,rect:eo({x:_.x,y:_.y,width:v.x+v.width-_.x,height:v.y+v.height-_.y},t,n,8)}})}),S=()=>{e.lineWidth=1;let r=!1;for(let i of x)for(let a of i)if(a?.rect!==void 0&&Xa(0,0,t,n,a.rect.x,a.rect.y,a.rect.width,a.rect.height)){let t=r,n=!$a(a.clip,a.rect);e.beginPath(),n&&(e.save(),e.rect(a.clip.x,a.clip.y,a.clip.width,a.clip.height),e.clip()),a.style===`dashed`&&!r?(e.setLineDash([5,3]),r=!0):(a.style===`solid`||a.style===`solid-outline`)&&r&&(e.setLineDash([]),r=!1),e.strokeStyle=a.style===`solid-outline`?W(W(a.color,h.borderColor),h.bgCell):Ht(a.color,1),e.closePath(),e.strokeRect(a.rect.x+.5,a.rect.y+.5,a.rect.width-1,a.rect.height-1),n&&(e.restore(),r=t)}r&&e.setLineDash([])};return S(),S}function Po(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function Fo(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){if(u.current===void 0)return;let _=h!==!1&&h!==void 0;if(!_)return;let v=typeof h==`object`?{...Xt,...h}:Xt,y=u.current.range,b=u.current.cell,x=[y.x+y.width-1,y.y+y.height-1];if(b[1]>=g&&x[1]>=g||!o.some(e=>e.sourceIndex===b[0]||e.sourceIndex===x[0]))return;let[S,C]=u.current.cell,w=f(u.current.cell),T=w.span??[S,S],E=C>=g-p,D=p>0&&!E?Ti(g,p,d)-1:0,O=x[1],k;if(Ka(o,r,i,a,l,(r,i,a,o,l)=>{if(r.sticky&&S>r.sourceIndex)return;let u=r.sourceIndexT[1],h=r.sourceIndex===x[0];if(!(!h&&(u||f)))return Ga(l,a,n,g,d,p,m,void 0,(a,l,u)=>{if(l!==C&&l!==O)return;let d=i,f=r.width;if(w.span!==void 0){let e=Ja(w.span,i,a,r.width,u,r,s),t=r.sticky?e[0]:e[1];t!==void 0&&(d=t.x,f=t.width)}return l===O&&h&&_&&(k=()=>{o>d&&!r.sticky&&(e.beginPath(),e.rect(o,0,t-o,n),e.clip());let i=v.size,s=i/2,l=d+f+v.offsetX-s+.5,p=a+u+v.offsetY-s+.5;e.beginPath(),v.shape===`circle`?e.arc(l+s,p+s,s,0,Math.PI*2):e.rect(l,p,i,i),e.fillStyle=r.themeOverride?.accentColor??c.accentColor,e.fill(),v.outline>0&&(e.lineWidth=v.outline,e.strokeStyle=c.bgCell,v.shape===`circle`?(e.beginPath(),e.arc(l+s,p+s,s+v.outline/2,0,Math.PI*2),e.stroke()):e.strokeRect(l-v.outline/2,p-v.outline/2,i+v.outline,i+v.outline))}),k!==void 0}),k!==void 0}),k===void 0)return;let A=()=>{e.save(),e.beginPath(),e.rect(0,l,t,n-l-D),e.clip(),k?.(),e.restore()};return A(),A}function Io(e,t,n,r,i,a,o,s,c){c===void 0||c.size===0||(e.beginPath(),qa(t,n,a,r,(t,n,r,i,a,o)=>{c.hasItemInRectangle({x:t[0],y:-2,width:t[1]-t[0]+1,height:1})&&e.rect(r,i,a,o)}),Ka(t,s,a,o,i,(t,n,a,o)=>{let s=Math.max(0,o-n),l=n+s+1,u=t.width-s-1;c.has([t.sourceIndex,-1])&&e.rect(l,r,u,i-r)}),e.clip())}function Lo(e,t,n,r,i,a,o,s,c,l){let u=0;return Ka(e,a,r,i,n,(e,n,r,i,a)=>(Ga(a,r,t,o,s,c,l,void 0,(e,t,n,r)=>{r||(u=Math.max(t,u))}),!0)),u}function Ro(e,t){let{canvasCtx:n,headerCanvasCtx:r,width:i,height:a,cellXOffset:o,cellYOffset:s,translateX:c,translateY:l,mappedColumns:u,enableGroups:d,freezeColumns:f,dragAndDropState:p,theme:m,drawFocus:h,headerHeight:g,groupHeaderHeight:_,disabledRows:v,rowHeight:y,verticalBorder:b,overrideCursor:x,isResizing:S,selection:C,fillHandle:w,freezeTrailingRows:T,rows:E,getCellContent:D,getGroupDetails:O,getRowThemeOverride:k,isFocused:A,drawHeaderCallback:j,prelightCells:ee,drawCellCallback:te,highlightRegions:ne,resizeCol:re,imageLoader:ie,lastBlitData:ae,hoverValues:oe,hyperWrapping:M,hoverInfo:N,spriteManager:se,maxScaleFactor:P,hasAppendRow:ce,touchMode:le,enqueue:ue,renderStateProvider:de,getCellRenderer:fe,renderStrategy:pe,bufferACtx:me,bufferBCtx:he,damage:ge,minimumCellWidth:_e,resizeIndicator:ve}=e;if(i===0||a===0)return;let ye=pe===`double-buffer`,F=Math.min(P,Math.ceil(window.devicePixelRatio??1)),be=pe!==`direct`&&Mo(e,t),xe=n.canvas;(xe.width!==i*F||xe.height!==a*F)&&(xe.width=i*F,xe.height=a*F,xe.style.width=i+`px`,xe.style.height=a+`px`);let Se=r.canvas,I=d?_+g:g,Ce=I+1;(Se.width!==i*F||Se.height!==Ce*F)&&(Se.width=i*F,Se.height=Ce*F,Se.style.width=i+`px`,Se.style.height=Ce+`px`);let L=me.canvas,we=he.canvas;ye&&(L.width!==i*F||L.height!==a*F)&&(L.width=i*F,L.height=a*F,ae.current!==void 0&&(ae.current.aBufferScroll=void 0)),ye&&(we.width!==i*F||we.height!==a*F)&&(we.width=i*F,we.height=a*F,ae.current!==void 0&&(ae.current.bBufferScroll=void 0));let R=ae.current;if(be===!0&&o===R?.cellXOffset&&s===R?.cellYOffset&&c===R?.translateX&&l===R?.translateY)return;let Te=null;ye&&(Te=n);let z=r,B;B=ye?ge===void 0?R?.lastBuffer===`b`?me:he:R?.lastBuffer===`b`?he:me:n;let Ee=B.canvas,De=ye?Ee===L?we:L:xe,Oe=typeof y==`number`?()=>y:y;z.save(),B.save(),z.beginPath(),B.beginPath(),z.textBaseline=`middle`,B.textBaseline=`middle`,F!==1&&(z.scale(F,F),B.scale(F,F));let V=Ei(u,o,i,p,c),ke=[],Ae=h&&C.current?.cell[1]===s&&l===0,je=!1;if(ne!==void 0){for(let e of ne)if(e.style!==`no-outline`&&e.range.y===s&&l===0){je=!0;break}}let H=()=>{fo(z,V,d,N,i,c,g,_,p,S,C,m,se,oe,b,O,ge,j,le),ko(z,V,s,c,l,i,a,void 0,void 0,_,I,Oe,k,b,T,E,m,!0),z.beginPath(),z.moveTo(0,Ce-.5),z.lineTo(i,Ce-.5),z.strokeStyle=W(m.headerBottomBorderColor??m.horizontalBorderColor??m.borderColor,m.bgHeader),z.stroke(),je&&No(z,i,a,o,s,c,l,u,f,g,_,y,T,E,ne,m),Ae&&Fo(z,i,a,s,c,l,V,u,m,I,C,Oe,D,T,ce,w,E)};if(ge!==void 0){let e=V[V.length-1].sourceIndex+1,t=ge.hasItemInRegion([{x:o,y:-2,width:e,height:2},{x:o,y:s,width:e,height:300},{x:0,y:s,width:f,height:300},{x:0,y:-2,width:f,height:2},{x:o,y:E-T,width:e,height:T,when:T>0}]),n=e=>{ro(e,V,u,a,I,c,l,s,E,Oe,D,O,k,v,A,h,T,ce,ke,ge,C,ee,ne,ie,se,oe,N,te,M,m,ue,de,fe,x,_e);let t=C.current;w!==!1&&w!==void 0&&h&&t!==void 0&&ge.has(bi(t.range))&&Fo(e,i,a,s,c,l,V,u,m,I,C,Oe,D,T,ce,w,E)};t&&(n(B),Te!==null&&(Te.save(),Te.scale(F,F),Te.textBaseline=`middle`,n(Te),Te.restore()),ge.hasHeader()&&(Io(z,V,i,_,I,c,l,s,ge),H())),B.restore(),z.restore();return}if((be!==!0||o!==R?.cellXOffset||c!==R?.translateX||Ae!==R?.mustDrawFocusOnHeader||je!==R?.mustDrawHighlightRingsOnHeader)&&H(),be===!0){tn(De!==void 0&&R!==void 0);let{regions:e}=Ao(B,De,De===L?R.aBufferScroll:R.bBufferScroll,De===L?R.bBufferScroll:R.aBufferScroll,R,o,s,c,l,T,i,a,E,I,F,u,V,y,ye);ke=e}else be!==!1&&(tn(R!==void 0),ke=jo(R,o,s,c,l,i,a,I,V,be));Eo(B,V,i,a,T,E,b,Oe,m);let Me=No(B,i,a,o,s,c,l,u,f,g,_,y,T,E,ne,m),Ne=h?Fo(B,i,a,s,c,l,V,u,m,I,C,Oe,D,T,ce,w,E):void 0;if(B.fillStyle=m.bgCell,ke.length>0){B.beginPath();for(let e of ke)B.rect(e.x,e.y,e.width,e.height);B.clip(),B.fill(),B.beginPath()}else B.fillRect(0,0,i,a);let Pe=ro(B,V,u,a,I,c,l,s,E,Oe,D,O,k,v,A,h,T,ce,ke,ge,C,ee,ne,ie,se,oe,N,te,M,m,ue,de,fe,x,_e);To(B,V,u,i,a,I,c,l,s,E,Oe,k,C.rows,v,T,ce,ke,ge,m),Oo(B,V,s,c,l,i,a,ke,I,Oe,k,b,T,E,m),ko(B,V,s,c,l,i,a,ke,Pe,_,I,Oe,k,b,T,E,m),Me?.(),Ne?.(),S&&ve!==`none`&&Ka(V,0,c,0,I,(e,t)=>e.sourceIndex===re?(Po(z,t+e.width,0,I+1,W(m.resizeIndicatorColor??m.accentLight,m.bgHeader)),ve===`full`&&Po(B,t+e.width,I,a,W(m.resizeIndicatorColor??m.accentLight,m.bgCell)),!0):!1),Te!==null&&(Te.fillStyle=m.bgCell,Te.fillRect(0,0,i,a),Te.drawImage(B.canvas,0,0));let Fe=Lo(V,a,I,c,l,s,E,Oe,T,ce);ie?.setWindow({x:o,y:s,width:V.length,height:Fe-s},f,Array.from({length:T},(e,t)=>E-1-t));let Ie=R!==void 0&&(o!==R.cellXOffset||c!==R.translateX),Le=R!==void 0&&(s!==R.cellYOffset||l!==R.translateY);ae.current={cellXOffset:o,cellYOffset:s,translateX:c,translateY:l,mustDrawFocusOnHeader:Ae,mustDrawHighlightRingsOnHeader:je,lastBuffer:ye?Ee===L?`a`:`b`:void 0,aBufferScroll:Ee===L?[Ie,Le]:R?.aBufferScroll,bBufferScroll:Ee===we?[Ie,Le]:R?.bBufferScroll},B.restore(),z.restore()}var zo=80;function Bo(e){let t=e-1;return t*t*t+1}var Vo=class{callback;constructor(e){this.callback=e}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=e=>{this.leavingItems.some(t=>yi(t.item,e.item))||this.leavingItems.push(e)};removeFromLeavingItems=e=>{let t=this.leavingItems.find(t=>yi(t.item,e));return this.leavingItems=this.leavingItems.filter(e=>e!==t),t?.hoverAmount??0};cleanUpLeavingElements=()=>{this.leavingItems=this.leavingItems.filter(e=>e.hoverAmount>0)};shouldStep=()=>{let e=this.leavingItems.length>0,t=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return e||t};getAnimatingItems=()=>this.currentHoveredItem===void 0?this.leavingItems.map(e=>({...e,hoverAmount:Bo(e.hoverAmount)})):[...this.leavingItems,this.currentHoveredItem];step=e=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=e;else{let t=(e-this.lastAnimationTime)/zo;for(let e of this.leavingItems)e.hoverAmount=(0,Aa.default)(e.hoverAmount-t,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=(0,Aa.default)(this.currentHoveredItem.hoverAmount+t,0,1));let n=this.getAnimatingItems();this.callback(n),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=e,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=e=>{if(!yi(this.currentHoveredItem?.item,e)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),e!==void 0){let t=this.removeFromLeavingItems(e);this.currentHoveredItem={item:e,hoverAmount:t}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}}},Ho=class{fn;val;constructor(e){this.fn=e}get value(){return this.val??=this.fn()}};function Uo(e){return new Ho(e)}var Wo=Uo(()=>window.navigator.userAgent.includes(`Firefox`)),Go=Uo(()=>window.navigator.userAgent.includes(`Mac OS`)&&window.navigator.userAgent.includes(`Safari`)&&!window.navigator.userAgent.includes(`Chrome`)),Ko=Uo(()=>window.navigator.platform.toLowerCase().startsWith(`mac`));function qo(e){let t=K.useRef([]),n=K.useRef(0),r=K.useRef(e);r.current=e;let i=K.useCallback(()=>{let e=()=>window.requestAnimationFrame(i),i=()=>{let e=t.current.map(na);t.current=[],r.current(new aa(e)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?e:i)},[]);return K.useCallback(e=>{t.current.length===0&&i();let n=$i(e[0],e[1]);t.current.includes(n)||t.current.push(n)},[i])}var Jo=`header`,Yo=`group-header`,Xo=`out-of-bounds`,Zo;(function(e){e[e.Start=-2]=`Start`,e[e.StartPadding=-1]=`StartPadding`,e[e.Center=0]=`Center`,e[e.EndPadding=1]=`EndPadding`,e[e.End=2]=`End`})(Zo||={});function Qo(e,t){return e===t?!0:e?.kind===`out-of-bounds`?e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]&&e?.region[0]===t?.region[0]&&e?.region[1]===t?.region[1]:e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]}var $o=(e,t)=>e.kind===U.Custom?e.copyData:(t?.(e))?.getAccessibilityString(e)??``,es=K.memo(K.forwardRef((e,t)=>{let{width:n,height:r,accessibilityHeight:i,columns:a,cellXOffset:o,cellYOffset:s,headerHeight:c,fillHandle:l=!1,groupHeaderHeight:u,rowHeight:d,rows:f,getCellContent:p,getRowThemeOverride:m,onHeaderMenuClick:h,onHeaderIndicatorClick:g,enableGroups:_,isFilling:v,onCanvasFocused:y,onCanvasBlur:b,isFocused:x,selection:S,freezeColumns:C,onContextMenu:w,freezeTrailingRows:T,fixedShadowX:E=!0,fixedShadowY:D=!0,drawFocusRing:O,onMouseDown:k,onMouseUp:A,onMouseMoveRaw:j,onMouseMove:ee,onItemHovered:te,dragAndDropState:ne,firstColAccessible:re,onKeyDown:ie,onKeyUp:ae,highlightRegions:oe,canvasRef:M,onDragStart:N,onDragEnd:se,eventTargetRef:P,isResizing:ce,resizeColumn:le,isDragging:ue,isDraggable:de=!1,allowResize:fe,disabledRows:pe,hasAppendRow:me,getGroupDetails:he,theme:ge,prelightCells:_e,headerIcons:ve,verticalBorder:ye,drawCell:F,drawHeader:be,onCellFocused:xe,onDragOverCell:Se,onDrop:I,onDragLeave:Ce,imageWindowLoader:L,smoothScrollX:we=!1,smoothScrollY:R=!1,experimental:Te,getCellRenderer:z,resizeIndicator:B=`full`}=e,Ee=e.translateX??0,De=e.translateY??0,Oe=Math.max(C,Math.min(a.length-1,o)),V=K.useRef(null),ke=K.useRef(Te?.eventTarget??window),Ae=ke.current,je=L,H=K.useRef(),[Me,Ne]=K.useState(!1),Pe=K.useRef([]),Fe=K.useRef(),[Ie,Le]=K.useState(),[Re,ze]=K.useState(),Be=K.useRef(null),[Ve,He]=K.useState(),[Ue,We]=K.useState(!1),Ge=K.useRef(Ue);Ge.current=Ue;let Ke=K.useMemo(()=>new Ua(ve,()=>{lt.current=void 0,pt.current()}),[ve]),qe=_?u+c:c,Je=K.useRef(-1),Ye=(Te?.enableFirefoxRescaling??!1)&&Wo.value,Xe=(Te?.enableSafariRescaling??!1)&&Go.value;K.useLayoutEffect(()=>{window.devicePixelRatio===1||!Ye&&!Xe||(Je.current!==-1&&Ne(!0),window.clearTimeout(Je.current),Je.current=window.setTimeout(()=>{Ne(!1),Je.current=-1},200))},[s,Oe,Ee,De,Ye,Xe]);let Ze=mi(a,C),Qe=K.useMemo(()=>E?wi(Ze,ne):0,[Ze,ne,E]),$e=K.useCallback((e,t,i)=>{let a=e.getBoundingClientRect();if(t>=Ze.length||i>=f)return;let o=a.width/n,c=Zi(t,i,n,r,u,qe,Oe,s,Ee,De,f,C,T,Ze,d);return o!==1&&(c.x*=o,c.y*=o,c.width*=o,c.height*=o),c.x+=a.x,c.y+=a.y,c},[n,r,u,qe,Oe,s,Ee,De,f,C,T,Ze,d]),et=K.useCallback((e,t,i,a)=>{let o=e.getBoundingClientRect(),p=o.width/n,m=(t-o.left)/p,h=(i-o.top)/p,g=Ei(Ze,Oe,n,void 0,Ee),v=0,y=0,b=typeof PointerEvent<`u`&&a instanceof PointerEvent&&a.pointerType===`mouse`||typeof MouseEvent<`u`&&a instanceof MouseEvent,x=typeof PointerEvent<`u`&&a instanceof PointerEvent&&a.pointerType===`touch`||typeof TouchEvent<`u`&&a instanceof TouchEvent;b&&(v=a.button,y=a.buttons);let C=Di(m,g,Ee),w=Oi(h,r,_,c,u,f,d,s,De,T),E=a?.shiftKey===!0,D=a?.ctrlKey===!0,O=a?.metaKey===!0,k=[m<0?-1:+(nn||h>r){let i=m>n?1:m<0?-1:0,a=h>r?1:h<0?-1:0,o=i*2,s=a*2;i===0&&(o=C===-1?Zo.EndPadding:Zo.Center),a===0&&(s=w===void 0?Zo.EndPadding:Zo.Center);let c=!1;if(C===-1&&w===-1){let n=$e(e,Ze.length-1,-1);tn(n!==void 0),c=tn&&mr&&h=0?(r=!0,n=$e(e,a,w),tn(n!==void 0),A={kind:_&&w===-2?Yo:Jo,location:[a,w],bounds:n,group:Ze[a].group??``,isEdge:r,shiftKey:E,ctrlKey:D,metaKey:O,isTouch:x,localEventX:t-n.x,localEventY:i-n.y,button:v,buttons:y,scrollEdge:k}):A={kind:_&&w===-2?Yo:Jo,group:Ze[C].group??``,location:[C,w],bounds:n,isEdge:r,shiftKey:E,ctrlKey:D,metaKey:O,isTouch:x,localEventX:t-n.x,localEventY:i-n.y,button:v,buttons:y,scrollEdge:k}}else{let n=$e(e,C,w);tn(n!==void 0);let r=n!==void 0&&n.x+n.width-t<5,a=!1;if(l!==!1&&l!==void 0&&S.current!==void 0){let n=typeof l==`object`?{...Xt,...l}:Xt,r=n.size,o=r/2,s=bi(S.current.range),c=$e(e,s[0],s[1]);if(c!==void 0){let e=c.x+c.width+n.offsetX-o+.5,s=c.y+c.height+n.offsetY-o+.5;a=Math.abs(e-t){}),rt=K.useRef(Ie);rt.current=Ie;let[it,at]=K.useMemo(()=>{let e=document.createElement(`canvas`),t=document.createElement(`canvas`);return e.style.display=`none`,e.style.opacity=`0`,e.style.position=`fixed`,t.style.display=`none`,t.style.opacity=`0`,t.style.position=`fixed`,[e.getContext(`2d`,{alpha:!1}),t.getContext(`2d`,{alpha:!1})]},[]);K.useLayoutEffect(()=>{if(!(it===null||at===null))return document.documentElement.append(it.canvas),document.documentElement.append(at.canvas),()=>{it.canvas.remove(),at.canvas.remove()}},[it,at]);let ot=K.useMemo(()=>new ia,[]),st=Ye&&Me?1:Xe&&Me?2:5,ct=Te?.disableMinimumCellWidth===!0?1:10,lt=K.useRef(),ut=K.useRef(null),dt=K.useRef(null),ft=K.useCallback(()=>{let e=V.current,t=Be.current;if(e===null||t===null||(ut.current===null&&(ut.current=e.getContext(`2d`,{alpha:!1}),e.width=0,e.height=0),dt.current===null&&(dt.current=t.getContext(`2d`,{alpha:!1}),t.width=0,t.height=0),ut.current===null||dt.current===null||it===null||at===null))return;let i=!1,a=e=>{i=!0,He(e)},o=lt.current,h={headerCanvasCtx:dt.current,canvasCtx:ut.current,bufferACtx:it,bufferBCtx:at,width:n,height:r,cellXOffset:Oe,cellYOffset:s,translateX:Math.round(Ee),translateY:Math.round(De),mappedColumns:Ze,enableGroups:_,freezeColumns:C,dragAndDropState:ne,theme:ge,headerHeight:c,groupHeaderHeight:u,disabledRows:pe??Ut.empty(),rowHeight:d,verticalBorder:ye,isResizing:ce,resizeCol:le,isFocused:x,selection:S,fillHandle:l,drawCellCallback:F,hasAppendRow:me,overrideCursor:a,maxScaleFactor:st,freezeTrailingRows:T,rows:f,drawFocus:O,getCellContent:p,getGroupDetails:he??(e=>({name:e})),getRowThemeOverride:m,drawHeaderCallback:be,prelightCells:_e,highlightRegions:oe,imageLoader:je,lastBlitData:Fe,damage:H.current,hoverValues:Pe.current,hoverInfo:rt.current,spriteManager:Ke,scrolling:Me,hyperWrapping:Te?.hyperWrapping??!1,touchMode:Ue,enqueue:nt.current,renderStateProvider:ot,renderStrategy:Te?.renderStrategy??(Go.value?`double-buffer`:`single-buffer`),getCellRenderer:z,minimumCellWidth:ct,resizeIndicator:B};h.damage===void 0?(lt.current=h,Ro(h,o)):Ro(h,void 0),!i&&(h.damage===void 0||h.damage.has(rt?.current?.[0]))&&He(void 0)},[it,at,n,r,Oe,s,Ee,De,Ze,_,C,ne,ge,c,u,pe,d,ye,ce,me,le,x,S,l,T,f,O,st,p,he,m,F,be,_e,oe,je,Ke,Me,Te?.hyperWrapping,Te?.renderStrategy,Ue,ot,z,ct,B]),pt=K.useRef(ft);K.useLayoutEffect(()=>{ft(),pt.current=ft},[ft]),K.useLayoutEffect(()=>{(async()=>{document?.fonts?.ready!==void 0&&(await document.fonts.ready,lt.current=void 0,pt.current())})()},[]);let mt=K.useCallback(e=>{H.current=e,pt.current(),H.current=void 0},[]);nt.current=qo(mt);let ht=K.useCallback(e=>{mt(new aa(e.map(e=>e.cell)))},[mt]);je.setCallback(mt);let[gt,_t]=K.useState(!1),[vt,yt]=tt??[],bt=vt!==void 0&&yt===-1&&vt>=0&&vt-1&&yt({contain:`strict`,display:`block`,cursor:Tt}),[Tt]),Dt=K.useRef(`default`),Ot=P?.current;Ot!=null&&Dt.current!==Et.cursor&&(Ot.style.cursor=Dt.current=Et.cursor);let kt=K.useCallback((e,t,n,r)=>{if(he===void 0)return;let i=he(e);if(i.actions!==void 0){let e=go(t,i.actions);for(let[a,o]of e.entries())if(Za(o,n+t.x,r+o.y))return i.actions[a]}},[he]),At=K.useCallback((e,t,n,r)=>{let i=Ze[t];if(!ue&&!ce&&!(Re??!1)){let a=$e(e,t,-1);tn(a!==void 0);let o=vo(void 0,i,a.x,a.y,a.width,a.height,ge,nr(i.title)===`rtl`);if(i.hasMenu===!0&&o.menuBounds!==void 0&&Za(o.menuBounds,n,r))return{area:`menu`,bounds:o.menuBounds};if(i.indicatorIcon!==void 0&&o.indicatorIconBounds!==void 0&&Za(o.indicatorIconBounds,n,r))return{area:`indicator`,bounds:o.indicatorIconBounds}}},[Ze,$e,Re,ue,ce,ge]),jt=K.useRef(0),Mt=K.useRef(),Nt=K.useRef(!1);Wn(`pointerdown`,K.useCallback(e=>{let t=V.current,n=P?.current;if(t===null||e.target!==t&&e.target!==n)return;Nt.current=!0;let r=e.clientX,i=e.clientY;if(e.target===n&&n!==null){let e=n.getBoundingClientRect();if(r>e.right||i>e.bottom)return}let a=et(t,r,i,e);Mt.current=a.location,a.isTouch&&(jt.current=Date.now()),Ge.current!==a.isTouch&&We(a.isTouch),!(a.kind===`header`&&At(t,a.location[0],r,i)!==void 0)&&(a.kind===`group-header`&&kt(a.group,a.bounds,a.localEventX,a.localEventY)!==void 0||(k?.(a),!a.isTouch&&de!==!0&&de!==a.kind&&a.button<3&&a.button!==1&&e.preventDefault()))},[P,de,et,kt,At,k]),Ae,!1);let Pt=K.useRef(0);Wn(`pointerup`,K.useCallback(e=>{let t=Pt.current;Pt.current=Date.now();let n=V.current;if(Nt.current=!1,A===void 0||n===null)return;let r=P?.current,i=e.target!==n&&e.target!==r,a=e.clientX,o=e.clientY,s=e.pointerType!==`mouse`||e.button<3,c=et(n,a,o,e);c.isTouch&&jt.current!==0&&Date.now()-jt.current>500&&(c={...c,isLongTouch:!0}),t!==0&&Date.now()-t<(c.isTouch?1e3:500)&&(c={...c,isDoubleClick:!0}),Ge.current!==c.isTouch&&We(c.isTouch),!i&&e.cancelable&&s&&e.preventDefault();let[l]=c.location,u=At(n,l,a,o);if(c.kind===`header`&&u!==void 0){(c.button!==0||Mt.current?.[0]!==l||Mt.current?.[1]!==-1)&&A(c,!0);return}else if(c.kind===`group-header`){let e=kt(c.group,c.bounds,c.localEventX,c.localEventY);if(e!==void 0){c.button===0&&e.onClick(c);return}}A(c,i)},[A,P,et,At,kt]),Ae,!1),Wn(`click`,K.useCallback(e=>{let t=V.current;if(t===null)return;let n=P?.current,r=e.target!==t&&e.target!==n,i,a,o=!0;e instanceof MouseEvent?(i=e.clientX,a=e.clientY,o=e.button<3):(i=e.changedTouches[0].clientX,a=e.changedTouches[0].clientY);let s=et(t,i,a,e);Ge.current!==s.isTouch&&We(s.isTouch),!r&&e.cancelable&&o&&e.preventDefault();let[c]=s.location;if(s.kind===`header`){let e=At(t,c,i,a);e!==void 0&&s.button===0&&Mt.current?.[0]===c&&Mt.current?.[1]===-1&&(e.area===`menu`?h?.(c,e.bounds):e.area===`indicator`&&g?.(c,e.bounds))}},[P,et,At,h,g]),Ae,!1),Wn(`contextmenu`,K.useCallback(e=>{let t=V.current,n=P?.current;if(t===null||e.target!==t&&e.target!==n||w===void 0)return;let r=et(t,e.clientX,e.clientY,e);w(r,()=>{e.cancelable&&e.preventDefault()})},[P,et,w]),P?.current??null,!1);let Ft=K.useCallback(e=>{H.current=new aa(e.map(e=>e.item)),Pe.current=e,pt.current(),H.current=void 0},[]),It=K.useMemo(()=>new Vo(Ft),[Ft]),Lt=K.useRef(It);Lt.current=It,K.useLayoutEffect(()=>{let e=Lt.current;if(tt===void 0||tt[1]<0){e.setHovered(tt);return}let t=p(tt,!0),n=z(t),r=n===void 0&&t.kind===U.Custom||n?.needsHover!==void 0&&(typeof n.needsHover==`boolean`?n.needsHover:n.needsHover(t));e.setHovered(r?tt:void 0)},[p,z,tt]);let zt=K.useRef();Wn(`pointermove`,K.useCallback(e=>{let t=V.current;if(t===null)return;let n=P?.current,r=e.target!==t&&e.target!==n,i=et(t,e.clientX,e.clientY,e);if(i.kind!==`out-of-bounds`&&r&&!Nt.current&&!i.isTouch)return;let a=(e,t)=>{Le(n=>n===e||n?.[0][0]===e?.[0][0]&&n?.[0][1]===e?.[0][1]&&(n?.[1][0]===e?.[1][0]&&n?.[1][1]===e?.[1][1]||!t)?n:e)};if(!Qo(i,zt.current))He(void 0),te?.(i),a(i.kind===`out-of-bounds`?void 0:[i.location,[i.localEventX,i.localEventY]],!0),zt.current=i;else if(i.kind===`cell`||i.kind===`header`||i.kind===`group-header`){let e=!1,t=!0;if(i.kind===`cell`){let n=p(i.location);t=z(n)?.needsHoverPosition??n.kind===U.Custom,e=t}else e=!0;let n=[i.location,[i.localEventX,i.localEventY]];a(n,t),rt.current=n,e&&mt(new aa([i.location]))}let o=i.location[0]>=+!re;ze(i.kind===`header`&&i.isEdge&&o&&fe===!0),_t(i.kind===`cell`&&i.isFillHandle),j?.(e),ee(i)},[P,et,re,fe,j,ee,te,p,z,mt]),Ae,!0);let Bt=K.useCallback(e=>{let t=V.current;if(t===null)return;let n,r;S.current!==void 0&&(n=$e(t,S.current.cell[0],S.current.cell[1]),r=S.current.cell),ie?.({bounds:n,stopPropagation:()=>e.stopPropagation(),preventDefault:()=>e.preventDefault(),cancel:()=>void 0,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,key:e.key,keyCode:e.keyCode,rawEvent:e,location:r})},[ie,S,$e]),Vt=K.useCallback(e=>{let t=V.current;if(t===null)return;let n,r;S.current!==void 0&&(n=$e(t,S.current.cell[0],S.current.cell[1]),r=S.current.cell),ae?.({bounds:n,stopPropagation:()=>e.stopPropagation(),preventDefault:()=>e.preventDefault(),cancel:()=>void 0,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,key:e.key,keyCode:e.keyCode,rawEvent:e,location:r})},[ae,S,$e]),Ht=K.useCallback(e=>{if(V.current=e,M!==void 0&&(M.current=e),Te?.eventTarget)ke.current=Te.eventTarget;else if(e===null)ke.current=window;else{let t=e.getRootNode();t===document&&(ke.current=window),ke.current=t}},[M,Te?.eventTarget]);Wn(`dragstart`,K.useCallback(e=>{let t=V.current;if(t===null||de===!1||ce){e.preventDefault();return}let n,r,i=et(t,e.clientX,e.clientY);if(de!==!0&&i.kind!==de){e.preventDefault();return}let a=(e,t)=>{n=e,r=t},o,s,c,l=(e,t,n)=>{o=e,s=t,c=n},u=!1;if(N?.({...i,setData:a,setDragImage:l,preventDefault:()=>u=!0,defaultPrevented:()=>u}),!u&&n!==void 0&&r!==void 0&&e.dataTransfer!==null)if(e.dataTransfer.setData(n,r),e.dataTransfer.effectAllowed=`copyLink`,o!==void 0&&s!==void 0&&c!==void 0)e.dataTransfer.setDragImage(o,s,c);else{let[n,r]=i.location;if(r!==void 0){let i=document.createElement(`canvas`),a=$e(t,n,r);tn(a!==void 0);let o=Math.ceil(window.devicePixelRatio??1);i.width=a.width*o,i.height=a.height*o;let s=i.getContext(`2d`);s!==null&&(s.scale(o,o),s.textBaseline=`middle`,r===-1?(s.font=ge.headerFontFull,s.fillStyle=ge.bgHeader,s.fillRect(0,0,i.width,i.height),bo(s,0,0,a.width,a.height,Ze[n],!1,ge,!1,void 0,void 0,!1,0,Ke,be,!1)):(s.font=ge.baseFontFull,s.fillStyle=ge.bgCell,s.fillRect(0,0,i.width,i.height),lo(s,p([n,r]),0,r,!1,!1,0,0,a.width,a.height,!1,ge,ge.bgCell,je,Ke,1,void 0,!1,0,void 0,void 0,void 0,ot,z,()=>void 0))),i.style.left=`-100%`,i.style.position=`absolute`,i.style.width=`${a.width}px`,i.style.height=`${a.height}px`,document.body.append(i),e.dataTransfer.setDragImage(i,a.width/2,a.height/2),window.setTimeout(()=>{i.remove()},0)}}else e.preventDefault()},[de,ce,et,N,$e,ge,Ze,Ke,be,p,je,ot,z]),P?.current??null,!1,!1);let Gt=K.useRef();Wn(`dragover`,K.useCallback(e=>{let t=V.current;if(I!==void 0&&e.preventDefault(),t===null||Se===void 0)return;let[n,r]=et(t,e.clientX,e.clientY).location,i=n-+!re,[a,o]=Gt.current??[];(a!==i||o!==r)&&(Gt.current=[i,r],Se([i,r],e.dataTransfer))},[re,et,Se,I]),P?.current??null,!1,!1),Wn(`dragend`,K.useCallback(()=>{Gt.current=void 0,se?.()},[se]),P?.current??null,!1,!1),Wn(`drop`,K.useCallback(e=>{let t=V.current;if(t===null||I===void 0)return;e.preventDefault();let[n,r]=et(t,e.clientX,e.clientY).location,i=n-+!re;I([i,r],e.dataTransfer)},[re,et,I]),P?.current??null,!1,!1),Wn(`dragleave`,K.useCallback(()=>{Ce?.()},[Ce]),P?.current??null,!1,!1);let Kt=K.useRef(S);Kt.current=S;let qt=K.useRef(null),Jt=K.useCallback(e=>{V.current===null||!V.current.contains(document.activeElement)||(e===null&&Kt.current.current!==void 0?M?.current?.focus({preventScroll:!0}):e!==null&&e.focus({preventScroll:!0}),qt.current=e)},[M]);K.useImperativeHandle(t,()=>({focus:()=>{let e=qt.current;e===null||!document.contains(e)?M?.current?.focus({preventScroll:!0}):e.focus({preventScroll:!0})},getBounds:(e,t)=>{if(!(M===void 0||M.current===null))return $e(M.current,e??0,t??-1)},damage:ht,getMouseArgsForPosition:(e,t,n)=>{if(!(M===void 0||M.current===null))return et(M.current,e,t,n)}}),[M,ht,$e,et]);let Yt=K.useRef(),Zt=er(()=>{if(n<50||Te?.disableAccessibilityTree===!0)return null;let e=Ei(Ze,Oe,n,ne,Ee),t=re?0:-1;!re&&e[0]?.sourceIndex===0&&(e=e.slice(1));let[r,a]=S.current?.cell??[],o=S.current?.range,c=e.map(e=>e.sourceIndex),l=(0,Na.default)(s,Math.min(f,s+i));return r!==void 0&&a!==void 0&&!(c.includes(r)&&l.includes(a))&&Jt(null),K.createElement(`table`,{key:`access-tree`,role:`grid`,"aria-rowcount":f+1,"aria-multiselectable":`true`,"aria-colcount":Ze.length+t},K.createElement(`thead`,{role:`rowgroup`},K.createElement(`tr`,{role:`row`,"aria-rowindex":1},e.map(e=>K.createElement(`th`,{role:`columnheader`,"aria-selected":S.columns.hasIndex(e.sourceIndex),"aria-colindex":e.sourceIndex+1+t,tabIndex:-1,onFocus:t=>{if(t.target!==qt.current)return xe?.([e.sourceIndex,-1])},key:e.sourceIndex},e.title)))),K.createElement(`tbody`,{role:`rowgroup`},l.map(n=>K.createElement(`tr`,{role:`row`,"aria-selected":S.rows.hasIndex(n),key:n,"aria-rowindex":n+2},e.map(e=>{let i=e.sourceIndex,s=$i(i,n),c=r===i&&a===n,l=o!==void 0&&i>=o.x&&i=o.y&&n{let e=M?.current;if(e!=null)return ie?.({bounds:$e(e,i,n),cancel:()=>void 0,preventDefault:()=>void 0,stopPropagation:()=>void 0,ctrlKey:!1,key:`Enter`,keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:d})},onFocusCapture:e=>{if(!(e.target===qt.current||Yt.current?.[0]===i&&Yt.current?.[1]===n))return Yt.current=d,xe?.(d)},ref:c?Jt:void 0,tabIndex:-1},$o(f,z))})))))},[n,Ze,Oe,ne,Ee,f,s,i,S,Jt,p,M,ie,$e,xe],200),W=C===0||!E?0:Oe>C?1:(0,Aa.default)(-Ee/100,0,1),Qt=-s*32+De,$t=D?(0,Aa.default)(-Qt/100,0,1):0,en=K.useMemo(()=>{if(!W&&!$t)return null;let e={position:`absolute`,top:0,left:Qe,width:n-Qe,height:r,opacity:W,pointerEvents:`none`,transition:we?void 0:`opacity 0.2s`,boxShadow:`inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)`},t={position:`absolute`,top:qe,left:0,width:n,height:r,opacity:$t,pointerEvents:`none`,transition:R?void 0:`opacity 0.2s`,boxShadow:`inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)`};return K.createElement(K.Fragment,null,W>0&&K.createElement(`div`,{id:`shadow-x`,style:e}),$t>0&&K.createElement(`div`,{id:`shadow-y`,style:t}))},[W,$t,Qe,n,we,qe,r,R]),an=K.useMemo(()=>({position:`absolute`,top:0,left:0}),[]);return K.createElement(K.Fragment,null,K.createElement(`canvas`,{"data-testid":`data-grid-canvas`,tabIndex:0,onKeyDown:Bt,onKeyUp:Vt,onFocus:y,onBlur:b,ref:Ht,style:Et},Zt),K.createElement(`canvas`,{ref:Be,style:an}),en)}));function ts(e,t,n,r){return(0,Aa.default)(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}var ns=e=>{let[t,n]=K.useState(),[r,i]=K.useState(),[a,o]=K.useState(),[s,c]=K.useState(),[l,u]=K.useState(!1),[d,f]=K.useState(),[p,m]=K.useState(),[h,g]=K.useState(),[_,v]=K.useState(!1),[y,b]=K.useState(),{onHeaderMenuClick:x,onHeaderIndicatorClick:S,getCellContent:C,onColumnMoved:w,onColumnResize:T,onColumnResizeStart:E,onColumnResizeEnd:D,gridRef:O,maxColumnWidth:k,minColumnWidth:A,onRowMoved:j,lockColumns:ee,onColumnProposeMove:te,onMouseDown:ne,onMouseUp:re,onItemHovered:ie,onDragStart:ae,canvasRef:oe}=e,M=(T??D??E)!==void 0,{columns:N,selection:se}=e,P=se.columns,ce=K.useCallback(e=>{let[t,n]=e.location;a!==void 0&&s!==t&&t>=ee?(u(!0),c(t)):p!==void 0&&n!==void 0?(v(!0),g(Math.max(0,n))):r===void 0&&!l&&!_&&ie?.(e)},[a,p,s,ie,ee,r,l,_]),le=w!==void 0,ue=K.useCallback(e=>{if(e.button===0){let[t,r]=e.location;if(e.kind===`out-of-bounds`&&e.isEdge&&M){let e=O?.current?.getBounds(N.length-1,-1);e!==void 0&&(n(e.x),i(N.length-1))}else if(e.kind===`header`&&t>=ee){let r=oe?.current;if(e.isEdge&&M&&r){n(e.bounds.x),i(t);let a=r.getBoundingClientRect().width/r.offsetWidth,o=e.bounds.width/a;E?.(N[t],o,t,o+(N[t].growOffset??0))}else e.kind===`header`&&le&&(f(e.bounds.x),o(t))}else e.kind===`cell`&&ee>0&&t===0&&r!==void 0&&j!==void 0&&(b(e.bounds.y),m(r))}ne?.(e)},[ne,M,ee,j,O,N,le,E,oe]),de=K.useCallback((e,t)=>{l||_||x?.(e,t)},[l,_,x]),fe=K.useCallback((e,t)=>{l||_||S?.(e,t)},[l,_,S]),pe=K.useRef(-1),me=K.useCallback(()=>{pe.current=-1,m(void 0),g(void 0),b(void 0),v(!1),o(void 0),c(void 0),f(void 0),u(!1),i(void 0),n(void 0)},[]),he=K.useCallback((e,t)=>{if(e.button===0){if(r!==void 0){if(P?.hasIndex(r)===!0)for(let e of P){if(e===r)continue;let t=N[e],n=ts(t,pe.current,A,k);T?.(t,n,e,n+(t.growOffset??0))}let e=ts(N[r],pe.current,A,k);if(D?.(N[r],e,r,e+(N[r].growOffset??0)),P.hasIndex(r))for(let e of P){if(e===r)continue;let t=N[e],n=ts(t,pe.current,A,k);D?.(t,n,e,n+(t.growOffset??0))}}me(),a!==void 0&&s!==void 0&&te?.(a,s)!==!1&&w?.(a,s),p!==void 0&&h!==void 0&&j?.(p,h)}re?.(e,t)},[re,r,a,s,p,h,P,D,N,A,k,T,w,j,me,te]),ge=K.useMemo(()=>{if(!(a===void 0||s===void 0)&&a!==s&&te?.(a,s)!==!1)return{src:a,dest:s}},[a,s,te]),_e=K.useCallback(e=>{let n=oe?.current;if(a!==void 0&&d!==void 0)Math.abs(e.clientX-d)>20&&u(!0);else if(p!==void 0&&y!==void 0)Math.abs(e.clientY-y)>20&&v(!0);else if(r!==void 0&&t!==void 0&&n){let i=n.getBoundingClientRect().width/n.offsetWidth,a=(e.clientX-t)/i,o=N[r],s=ts(o,a,A,k);if(T?.(o,s,r,s+(o.growOffset??0)),pe.current=a,P?.first()===r)for(let e of P){if(e===r)continue;let t=N[e],n=ts(t,pe.current,A,k);T?.(t,n,e,n+(t.growOffset??0))}}},[a,d,p,y,r,t,N,A,k,T,P,oe]),ve=K.useCallback((e,t)=>{if(p===void 0||h===void 0)return C(e,t);let[n,r]=e;return r===h?r=p:(r>h&&--r,r>=p&&(r+=1)),C([n,r],t)},[p,h,C]),ye=K.useCallback(e=>{ae?.(e),e.defaultPrevented()||me()},[me,ae]);return K.createElement(es,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:ve,isResizing:r!==void 0,onHeaderMenuClick:de,onHeaderIndicatorClick:fe,isDragging:l,onItemHovered:ce,onDragStart:ye,onMouseDown:ue,allowResize:M,onMouseUp:he,dragAndDropState:ge,onMouseMoveRaw:_e,ref:O})};function rs(e){let t=(0,K.useRef)(null),[n,r]=(0,K.useState)({width:e?.[0],height:e?.[1]});return(0,K.useLayoutEffect)(()=>{let e=new window.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t&&t.contentRect||{};r(t=>t.width===e&&t.height===n?t:{width:e,height:n})}});return t.current&&e.observe(t.current,void 0),()=>{e.disconnect()}},[t.current]),{ref:t,...n}}var is=(e,t,n)=>{let r=(0,K.useRef)(null),i=(0,K.useRef)(null),a=(0,K.useRef)(null),o=(0,K.useRef)(0),s=(0,K.useRef)(t);s.current=t;let c=n.current;(0,K.useEffect)(()=>{let t=()=>{if(i.current===!1&&c!==null){let e=[c.scrollLeft,c.scrollTop];if(a.current?.[0]===e[0]&&a.current?.[1]===e[1])if(o.current>10){a.current=null,i.current=null;return}else o.current++;else o.current=0,s.current(e[0],e[1]),a.current=e;r.current=window.setTimeout(t,1e3/120)}},n=()=>{i.current=!0,a.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},l=e=>{e.touches.length===0&&(i.current=!1,o.current=0,r.current=window.setTimeout(t,1e3/120))};if(e&&c!==null){let e=c;return e.addEventListener(`touchstart`,n),e.addEventListener(`touchend`,l),()=>{e.removeEventListener(`touchstart`,n),e.removeEventListener(`touchend`,l),r.current!==null&&window.clearTimeout(r.current)}}},[e,c])},as=an(`div`)({name:`ScrollRegionStyle`,class:`gdg-s1dgczr6`,propsAsIs:!1,vars:{"s1dgczr6-0":[e=>e.isSafari?`scroll`:`auto`]}}),os=33554400,ss=5e6;function cs(e){let[t,n]=K.useState(!1),r=typeof window>`u`?null:window,i=K.useRef(0);return Wn(`touchstart`,K.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),Wn(`touchend`,K.useCallback(t=>{t.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}var ls=e=>{let{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:a,draggable:o,className:s,preventDiagonalScrolling:c=!1,paddingBottom:l=0,paddingRight:u=0,rightElement:d,rightElementProps:f,kineticScrollPerfHack:p=!1,scrollRef:m,initialSize:h}=e,g=[],_=f?.sticky??!1,v=f?.fill??!1,y=K.useRef(0),b=K.useRef(0),x=K.useRef(null),S=typeof window>`u`?1:window.devicePixelRatio,C=K.useRef(S);K.useEffect(()=>{if(C.current!==S){y.current=0,b.current=0,C.current=S;let e=x.current;e!==null&&j.current(e.scrollLeft,e.scrollTop)}},[S]);let w=K.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),T=K.useRef(null),E=cs(200),[D,O]=K.useState(!0),k=K.useRef(0);K.useLayoutEffect(()=>{if(!D||E||w.current.lockDirection===void 0)return;let e=x.current;if(e===null)return;let[t,n]=w.current.lockDirection;t===void 0?n!==void 0&&(e.scrollTop=n):e.scrollLeft=t,w.current.lockDirection=void 0},[E,D]);let A=K.useCallback((e,t)=>{let n=x.current;if(n===null)return;t??=n.scrollTop,e??=n.scrollLeft;let i=w.current.scrollTop,o=w.current.scrollLeft,s=e-o,d=t-i;E&&s!==0&&d!==0&&(Math.abs(s)>3||Math.abs(d)>3)&&c&&w.current.lockDirection===void 0&&(w.current.lockDirection=Math.abs(s)0&&r>n.scrollHeight+5?Math.abs(g)>2e3||h===0||h===_?(v=Math.max(0,Math.min(1,h/_))*(r-m),y.current=v):(y.current-=g,v=y.current):(v=h,y.current=v),v=Math.max(0,Math.min(v,r-m)),y.current=v,f!==void 0&&(window.clearTimeout(k.current),O(!1),k.current=window.setTimeout(()=>O(!0),200)),a({x:e,y:v,width:p-u,height:m-l,paddingRight:T.current?.clientWidth??0})},[l,u,r,a,c,E]);is(p&&Go.value,A,x);let j=K.useRef(A);j.current=A;let ee=K.useRef(),te=K.useRef(!1);K.useLayoutEffect(()=>{te.current?A():te.current=!0},[A,l,u]);let ne=K.useCallback(e=>{x.current=e,m!==void 0&&(m.current=e)},[m]),re=0,ie=0,ae=Math.min(r,os);for(g.push(K.createElement(`div`,{key:re++,style:{width:i,height:0}}));iej.current(),0),ee.current={width:M,height:N}),(M??0)===0||(N??0)===0?K.createElement(`div`,{ref:oe}):K.createElement(`div`,{ref:oe},K.createElement(as,{isSafari:Go.value},K.createElement(`div`,{className:`dvn-underlay`},t),K.createElement(`div`,{ref:ne,style:ee.current,draggable:o,onDragStart:e=>{o||(e.stopPropagation(),e.preventDefault())},className:`dvn-scroller `+(s??``),onScroll:()=>A()},K.createElement(`div`,{className:`dvn-scroll-inner`+(d===void 0?` dvn-hidden`:``)},K.createElement(`div`,{className:`dvn-stack`},g),d!==void 0&&K.createElement(K.Fragment,null,!v&&K.createElement(`div`,{className:`dvn-spacer`}),K.createElement(`div`,{ref:T,style:{height:N,maxHeight:n-Math.ceil(S%1),position:`sticky`,top:0,paddingLeft:1,marginBottom:-40,marginRight:u,flexGrow:v?1:void 0,right:_?u??0:void 0,pointerEvents:`auto`}},d))))))},us=e=>{let{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:a,enableGroups:o,freezeColumns:s,experimental:c,nonGrowWidth:l,clientSize:u,className:d,onVisibleRegionChanged:f,scrollRef:p,preventDiagonalScrolling:m,rightElement:h,rightElementProps:g,overscrollX:_,overscrollY:v,initialSize:y,smoothScrollX:b=!1,smoothScrollY:x=!1,isDraggable:S}=e,{paddingRight:C,paddingBottom:w}=c??{},[T,E]=u,D=K.useRef(),O=K.useRef(),k=K.useRef(),A=K.useRef(),j=l+Math.max(0,_??0),ee=o?i+a:i;if(typeof r==`number`)ee+=n*r;else for(let e=0;e{if(te.current===void 0)return;let e={...te.current},i=0,a=e.x<0?-e.x:0,o=0,c=0;e.x=e.x<0?0:e.x;let l=0;for(let e=0;e=t+n.width)i+=n.width,c++,o++;else if(e.x>t)i+=n.width,b?a+=t-e.x:c++,o++;else if(e.x+e.width>t)i+=n.width,o++;else break}let u=0,d=0,p=0;if(typeof r==`number`)x?(d=Math.floor(e.y/r),u=d*r-e.y):d=Math.ceil(e.y/r),p=Math.ceil(e.height/r)+d,u<0&&p++;else{let t=0;for(let i=0;i=t+n)t+=n,d++,p++;else if(e.y>a)t+=n,x?u+=a-e.y:d++,p++;else if(e.y+e.height>n/2+t)t+=n,p++;else break}}d=Math.max(0,Math.min(d,n-1)),p=Math.max(d,Math.min(p,n));let m={x:c,y:d,width:o-c,height:p-d},h=D.current;(h===void 0||h.y!==m.y||h.x!==m.x||h.height!==m.height||h.width!==m.width||O.current!==a||k.current!==u||e.width!==A.current?.[0]||e.height!==A.current?.[1])&&(f?.({x:c,y:d,width:o-c,height:p-d},e.width,e.height,e.paddingRight??0,a,u),D.current=m,O.current=a,k.current=u,A.current=[e.width,e.height])},[t,r,n,f,s,b,x]),re=K.useCallback(e=>{te.current=e,ne()},[ne]);return K.useEffect(()=>{ne()},[ne]),K.createElement(ls,{scrollRef:p,className:d,kineticScrollPerfHack:c?.kineticScrollPerfHack,preventDiagonalScrolling:m,draggable:S===!0||typeof S==`string`,scrollWidth:j+(C??0),scrollHeight:ee+(w??0),clientHeight:E,rightElement:h,paddingBottom:w,paddingRight:C,rightElementProps:g,update:re,initialSize:y},K.createElement(ns,{eventTargetRef:p,width:T,height:E,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},ds=an(`div`)({name:`SearchWrapper`,class:`gdg-seveqep`,propsAsIs:!1}),fs=K.createElement(`svg`,{className:`button-icon`,viewBox:`0 0 512 512`},K.createElement(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`48`,d:`M112 244l144-144 144 144M256 120v292`})),ps=K.createElement(`svg`,{className:`button-icon`,viewBox:`0 0 512 512`},K.createElement(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`48`,d:`M112 268l144 144 144-144M256 392V100`})),ms=K.createElement(`svg`,{className:`button-icon`,viewBox:`0 0 512 512`},K.createElement(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`32`,d:`M368 368L144 144M368 144L144 368`})),hs=10,gs=e=>{let{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:a,searchValue:o,searchResults:s,onSearchValueChange:c,getCellsForSelection:l,onSearchResultsChanged:u,showSearch:d=!1,onSearchClose:f}=e,[p]=K.useState(()=>`search-box-`+Math.round(Math.random()*1e3)),[m,h]=K.useState(``),g=o??m,_=K.useCallback(e=>{h(e),c?.(e)},[c]),[v,y]=K.useState(),b=K.useRef(v);b.current=v,K.useEffect(()=>{s!==void 0&&(s.length>0?y(e=>({rowsSearched:r,results:s.length,selectedIndex:e?.selectedIndex??-1})):y(void 0))},[r,s]);let x=K.useRef();x.current===void 0&&(x.current=new AbortController);let S=K.useRef(),[C,w]=K.useState([]),T=s??C,E=K.useCallback(()=>{S.current!==void 0&&(window.cancelAnimationFrame(S.current),S.current=void 0),x.current!==void 0&&x.current.abort(),x.current=new AbortController},[]),D=K.useRef(n);D.current=n;let O=K.useCallback(e=>{let t=new RegExp(e.replace(/([$()*+.?[\\\]^{|}-])/g,`\\$1`),`i`),n=D.current,a=Math.min(10,r),o=0;y(void 0),w([]);let s=[],c=async()=>{if(l===void 0)return;let e=performance.now(),d=r-o,f=l({x:0,y:n,width:i.length,height:Math.min(a,d,r-n)},x.current.signal);typeof f==`function`&&(f=await f());let p=!1;for(let[e,r]of f.entries())for(let[i,a]of r.entries()){let r;switch(a.kind){case U.Text:case U.Number:r=a.displayData;break;case U.Uri:case U.Markdown:r=a.data;break;case U.Boolean:r=typeof a.data==`boolean`?a.data.toString():void 0;break;case U.Image:case U.Bubble:r=a.data.join(`🐳`);break;case U.Custom:r=a.copyData;break}r!==void 0&&t.test(r)&&(s.push([i,e+n]),p=!0)}let m=performance.now();p&&w([...s]),o+=f.length,tn(o<=r);let h=b.current?.selectedIndex??-1;y({results:s.length,rowsSearched:o,selectedIndex:h}),u?.(s,h),n+a>=r?n=0:n+=a;let g=m-e,_=hs/Math.max(g,1);a=Math.ceil(a*_),o{f?.(),y(void 0),w([]),u?.([],-1),E(),t?.current?.focus()},[E,t,f,u]),A=K.useCallback(e=>{_(e.target.value),s===void 0&&(e.target.value===``?(y(void 0),w([]),E()):O(e.target.value))},[O,E,_,s]);K.useEffect(()=>{a.current!==null&&(_(``),y(void 0),C.length>0&&(w([]),u?.([],-1)),d?a.current.focus({preventScroll:!0}):E())},[d,a]);let j=K.useCallback(e=>{if(e?.stopPropagation?.(),v===void 0||v.results===0)return;let t=(v.selectedIndex+1)%v.results;y({...v,selectedIndex:t}),u?.(T,t)},[v,u,T]),ee=K.useCallback(e=>{if(e?.stopPropagation?.(),v===void 0||v.results===0)return;let t=(v.selectedIndex-1)%v.results;t<0&&(t+=v.results),y({...v,selectedIndex:t}),u?.(T,t)},[u,T,v]),te=K.useCallback(e=>{(e.ctrlKey||e.metaKey)&&e.nativeEvent.code===`KeyF`||e.key===`Escape`?(k(),e.stopPropagation(),e.preventDefault()):e.key===`Enter`&&(e.shiftKey?ee():j())},[k,j,ee]);K.useEffect(()=>()=>{E()},[E]);let[ne,re]=K.useState(!1);K.useEffect(()=>{if(d)re(!0);else{let e=setTimeout(()=>re(!1),150);return()=>clearTimeout(e)}},[d]);let ie=K.useMemo(()=>{if(!d&&!ne)return null;let e;v!==void 0&&(e=v.results>=1e3?`over 1000`:`${v.results} result${v.results===1?``:`s`}`,v.selectedIndex>=0&&(e=`${v.selectedIndex+1} of ${e}`));let t=e=>{e.stopPropagation()},n={width:`${r>0?Math.floor((v?.rowsSearched??0)/r*100):0}%`};return K.createElement(ds,{className:`gdg-search-bar`+(d?``:` out`),onMouseDown:t,onMouseMove:t,onMouseUp:t,onClick:t},K.createElement(`div`,{className:`gdg-search-bar-inner`},K.createElement(`input`,{id:p,"aria-hidden":!d,"data-testid":`search-input`,ref:a,onChange:A,value:g,tabIndex:d?void 0:-1,onKeyDownCapture:te}),K.createElement(`button`,{type:`button`,"aria-label":`Previous Result`,"aria-hidden":!d,tabIndex:d?void 0:-1,onClick:ee,disabled:(v?.results??0)===0},fs),K.createElement(`button`,{type:`button`,"aria-label":`Next Result`,"aria-hidden":!d,tabIndex:d?void 0:-1,onClick:j,disabled:(v?.results??0)===0},ps),f!==void 0&&K.createElement(`button`,{type:`button`,"aria-label":`Close Search`,"aria-hidden":!d,"data-testid":`search-close-button`,tabIndex:d?void 0:-1,onClick:k},ms)),v===void 0?K.createElement(`div`,{className:`gdg-search-status`},K.createElement(`label`,{htmlFor:p},`Type to search`)):K.createElement(K.Fragment,null,K.createElement(`div`,{className:`gdg-search-status`},K.createElement(`div`,{"data-testid":`search-result-area`},e)),K.createElement(`div`,{className:`gdg-search-progress`,style:n})))},[d,ne,v,r,p,a,A,g,te,ee,j,f,k]);return K.createElement(K.Fragment,null,K.createElement(us,{prelightCells:T,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),ie)},_s=an(`input`)({name:`RenameInput`,class:`gdg-r17m35ur`,propsAsIs:!1,vars:{"r17m35ur-0":[e=>Math.max(16,e.targetHeight-10),`px`]}}),vs=e=>{let{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:a}=e,[o,s]=K.useState(n);return K.createElement(Qt,{style:{position:`absolute`,left:t.x-i.left+1,top:t.y-i.top,width:t.width-2,height:t.height},className:`gdg-c1tqibwd`,onClickOutside:r},K.createElement(_s,{targetHeight:t.height,"data-testid":`group-rename-input`,value:o,onBlur:r,onFocus:e=>e.target.setSelectionRange(0,o.length),onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`?a(o):e.key===`Escape`&&r()},autoFocus:!0}))};function ys(e,t){return e===void 0?!1:e.length>1&&e.startsWith(`_`)?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>=`a`&&e<=`z`?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function Z(e,t,n){let r=bs(e,t);return r&&(n.didMatch=!0),r}function bs(e,t){if(e.length===0)return!1;if(e.includes(`|`)){let n=e.split(`|`);for(let e of n)if(bs(e,t))return!0;return!1}let n=!1,r=!1,i=!1,a=!1,o=e.split(`+`);if(!ys(o.pop(),t))return!1;if(o[0]===`any`)return!0;for(let e of o)switch(e){case`ctrl`:n=!0;break;case`shift`:r=!0;break;case`alt`:i=!0;break;case`meta`:a=!0;break;case`primary`:Ko.value?a=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===a}function xs(e,t,n,r,i,a,o){return[K.useCallback((s,c,l,u)=>{(a===`cell`||a===`multi-cell`)&&s!==void 0&&(s={...s,range:{x:s.cell[0],y:s.cell[1],width:1,height:1}}),!o&&s!==void 0&&s.range.width>1&&(s={...s,range:{...s.range,width:1,x:s.cell[0]}});let d=n===`mixed`&&(l||u===`drag`)||n===`additive`,f=(r===`mixed`||r===`additive`)&&d,p=(i===`mixed`||i===`additive`)&&d,m={current:s===void 0?void 0:{...s,rangeStack:u===`drag`?e.current?.rangeStack??[]:[]},columns:f?e.columns:Ut.empty(),rows:p?e.rows:Ut.empty()};l&&(a===`multi-rect`||a===`multi-cell`)&&m.current!==void 0&&e.current!==void 0&&(m={...m,current:{...m.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(m,c)},[r,e,n,a,o,i,t]),K.useCallback((a,o,s)=>{a??=e.rows,o!==void 0&&(a=a.add(o));let c;if(i===`exclusive`&&a.length>0)c={current:void 0,columns:Ut.empty(),rows:a};else{let t=s&&n===`mixed`||n===`additive`,i=s&&r===`mixed`||r===`additive`;c={current:t?e.current:void 0,columns:i?e.columns:Ut.empty(),rows:a}}t(c,!1)},[r,e,n,i,t]),K.useCallback((a,o,s)=>{a??=e.columns,o!==void 0&&(a=a.add(o));let c;if(r===`exclusive`&&a.length>0)c={current:void 0,rows:Ut.empty(),columns:a};else{let t=s&&n===`mixed`||n===`additive`,r=s&&i===`mixed`||i===`additive`;c={current:t?e.current:void 0,rows:r?e.rows:Ut.empty(),columns:a}}t(c,!1)},[r,e,n,i,t])]}function Ss(e,t,n,r,i){let a=K.useCallback(n=>{if(e===!0){let e=[];for(let r=n.y;r=i?a.push({kind:U.Loading,allowOverlay:!1}):a.push(t([e,r]));e.push(a)}return e}return e?.(n,r.signal)??[]},[r.signal,t,e,i]),o=e===void 0?void 0:a,s=K.useCallback(e=>{if(o===void 0)return[];let t={...e,x:e.x-n};if(t.x<0){t.x=0,t.width--;let e=o(t,r.signal);return typeof e==`function`?async()=>(await e()).map(e=>[{kind:U.Loading,allowOverlay:!1},...e]):e.map(e=>[{kind:U.Loading,allowOverlay:!1},...e])}return o(t,r.signal)},[r.signal,o,n]);return[e===void 0?void 0:s,o]}function Cs(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:`string`,doNotEscape:!0};switch(e.kind){case U.Boolean:return{formatted:e.data===!0?`TRUE`:e.data===!1?`FALSE`:e.data===void 0?`INDETERMINATE`:``,rawValue:e.data,format:`boolean`};case U.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:`string`};case U.Image:case U.Bubble:return{formatted:e.data,rawValue:e.data,format:`string-array`};case U.Drilldown:return{formatted:e.data.map(e=>e.text),rawValue:e.data.map(e=>e.text),format:`string-array`};case U.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:`string`};case U.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:`url`};case U.Markdown:case U.RowID:return{formatted:e.data,rawValue:e.data,format:`string`};case U.Number:return{formatted:e.displayData,rawValue:e.data,format:`number`};case U.Loading:return{formatted:`#LOADING`,rawValue:``,format:`string`};case U.Protected:return{formatted:`************`,rawValue:``,format:`string`};default:Lt(e)}}function ws(e,t){return e.map((e,n)=>{let r=t[n];return e.map(e=>e.span!==void 0&&e.span[0]!==r?{formatted:``,rawValue:``,format:`string`}:Cs(e))})}function Ts(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,`""`)}"`),e}function Es(e){let t=[];for(let n of e){let e=[];for(let t of n)t.format===`url`?e.push(t.rawValue?.toString()??``):t.format===`string-array`?e.push(t.formatted.map(e=>Ts(e,!0)).join(`,`)):e.push(t.doNotEscape===!0?t.formatted:Ts(t.formatted,!1));t.push(e.join(` `))}return t.join(` +`)}function Ds(e){return e.replace(/\t/g,` `).replace(/ {2,}/g,e=>` `.repeat(e.length))}function Os(e){return`"`+e.replace(/&/g,`&`).replace(/"/g,`"`).replace(//g,`>`)+`"`}function ks(e){return e.replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`).replace(/&/g,`&`)}function As(e){let t=[];t.push(``,``);for(let n of e){t.push(``);for(let e of n){let n=`gdg-format="${e.format}"`;e.format===`url`?t.push(``):e.format===`string-array`?t.push(``):t.push(``)}t.push(``)}return t.push(`
    ${Ds(e.formatted)}
      ${e.formatted.map((t,n)=>`
    1. `+Ds(t)+`
    2. `).join(``)}
    ${Ds(e.formatted)}
    `),t.join(``)}function js(e,t){let n=ws(e,t);return{textPlain:Es(n),textHtml:As(n)}}function Ms(e){let t=document.createElement(`html`);t.innerHTML=e.replace(/ /g,` `);let n=t.querySelector(`table`);if(n===null)return;let r=[n],i=[],a;for(;r.length>0;){let e=r.pop();if(e===void 0)break;if(e instanceof HTMLTableElement||e.nodeName===`TBODY`)r.push(...[...e.children].reverse());else if(e instanceof HTMLTableRowElement)a!==void 0&&i.push(a),a=[],r.push(...[...e.children].reverse());else if(e instanceof HTMLTableCellElement){let t=e.cloneNode(!0),n=t.children.length===1&&t.children[0].nodeName===`P`?t.children[0]:null,r=n?.children.length===1&&n.children[0].nodeName===`FONT`,i=t.querySelectorAll(`br`);for(let e of i)e.replaceWith(` +`);let o=t.getAttribute(`gdg-raw-value`),s=t.getAttribute(`gdg-format`)??`string`;if(t.querySelector(`a`)!==null)a?.push({rawValue:t.querySelector(`a`)?.getAttribute(`href`)??``,formatted:t.textContent??``,format:s});else if(t.querySelector(`ol`)!==null){let e=t.querySelectorAll(`li`);a?.push({rawValue:[...e].map(e=>e.getAttribute(`gdg-raw-value`)??``),formatted:[...e].map(e=>e.textContent??``),format:`string-array`})}else if(o!==null)a?.push({rawValue:ks(o),formatted:t.textContent??``,format:s});else{let e=t.textContent??``;r&&(e=e.replace(/\n(?!\n)/g,``)),a?.push({rawValue:e??``,formatted:e??``,format:s})}}}return a!==void 0&&i.push(a),i}function Ns(e,t,n,r,i){let a=e;if(r===`allowPartial`||e.current===void 0||t===void 0)return e;let o=!1;do{if(e?.current===void 0)break;let r=e.current?.range,s=[];if(r.width>2){let e=t({x:r.x,y:r.y,width:1,height:r.height},i.signal);if(typeof e==`function`)return a;s.push(...e);let n=t({x:r.x+r.width-1,y:r.y,width:1,height:r.height},i.signal);if(typeof n==`function`)return a;s.push(...n)}else{let e=t({x:r.x,y:r.y,width:r.width,height:r.height},i.signal);if(typeof e==`function`)return a;s.push(...e)}let c=r.x-n,l=r.x+r.width-1-n;for(let e of s)for(let t of e)t.span!==void 0&&(c=Math.min(t.span[0],c),l=Math.max(t.span[1],l));c===r.x-n&&l===r.x+r.width-1-n?o=!0:e={current:{cell:e.current.cell??[0,0],range:{x:c+n,y:r.y,width:l-c+1,height:r.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!o);return e}function Ps(e){return e.startsWith(`"`)&&e.endsWith(`"`)&&(e=e.slice(1,-1).replace(/""/g,`"`)),e}function Fs(e){let t;(function(e){e[e.None=0]=`None`,e[e.inString=1]=`inString`,e[e.inStringPostQuote=2]=`inStringPostQuote`})(t||={});let n=[],r=[],i=0,a=t.None;e=e.replace(/\r\n/g,` +`);let o=0;for(let s of e){switch(a){case t.None:s===` `||s===` +`?(r.push(e.slice(i,o)),i=o+1,s===` +`&&(n.push(r),r=[])):s===`"`&&(a=t.inString);break;case t.inString:s===`"`&&(a=t.inStringPostQuote);break;case t.inStringPostQuote:s===`"`?a=t.inString:s===` `||s===` +`?(r.push(Ps(e.slice(i,o))),i=o+1,s===` +`&&(n.push(r),r=[]),a=t.None):a=t.None;break}o++}return ie.map(e=>({rawValue:e,formatted:e,format:`string`})))}function Is(e,t,n){let r=js(e,t),i=e=>{window.navigator.clipboard?.writeText(e)},a=(e,t)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:`text/plain`}),"text/html":new Blob([t],{type:`text/html`})})]),!0);window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?((e,t)=>{try{if(n===void 0||n.clipboardData===null)throw Error(`No clipboard data`);n?.clipboardData?.setData(`text/plain`,e),n?.clipboardData?.setData(`text/html`,t)}catch{a(e,t)||i(e)}})(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function Ls(e){return e!==!0}function Rs(e){return typeof e==`string`?e:`${e}px`}var zs=an(`div`)({name:`Wrapper`,class:`gdg-wmyidgi`,propsAsIs:!1,vars:{"wmyidgi-0":[e=>e.innerWidth],"wmyidgi-1":[e=>e.innerHeight]}}),Bs=e=>{let{inWidth:t,inHeight:n,children:r,...i}=e;return K.createElement(zs,{innerHeight:Rs(n),innerWidth:Rs(t),...i},r)},Vs=2,Hs=1300;function Us(e,t,n){let r=K.useRef(0),[i,a]=e??[0,0];K.useEffect(()=>{if(i===0&&a===0){r.current=0;return}let e=!1,o=0,s=c=>{if(!e){if(o===0)o=c;else{let e=c-o;r.current=Math.min(1,r.current+e/Hs);let s=r.current**1.618*e*Vs;t.current?.scrollBy(i*s,a*s),o=c,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{e=!0}},[t,i,a,n])}function Ws({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:a,scaleToRem:o,remSize:s}){let[c,l,u,d,f,p]=K.useMemo(()=>{if(!o||s===16)return[e,t,n,r,i,a];let c=s/16,l=e,u=Zt();return[typeof l==`number`?l*c:e=>Math.ceil(l(e)*c),Math.ceil(t*c),Math.ceil(n*c),{...r,headerIconSize:(r?.headerIconSize??u.headerIconSize)*c,cellHorizontalPadding:(r?.cellHorizontalPadding??u.cellHorizontalPadding)*c,cellVerticalPadding:(r?.cellVerticalPadding??u.cellVerticalPadding)*c},Math.ceil((i??0)*c),Math.ceil((a??0)*c)]},[n,t,i,a,s,e,o,r]);return{rowHeight:c,headerHeight:l,groupHeaderHeight:u,theme:d,overscrollX:f,overscrollY:p}}var Gs={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function Q(e,t){return e===!0?t:e===!1?``:e}function Ks(e){let t=Ko.value;return{activateCell:Q(e.activateCell,` |Enter|shift+Enter`),clear:Q(e.clear,`any+Escape`),closeOverlay:Q(e.closeOverlay,`any+Escape`),acceptOverlayDown:Q(e.acceptOverlayDown,`Enter`),acceptOverlayUp:Q(e.acceptOverlayUp,`shift+Enter`),acceptOverlayLeft:Q(e.acceptOverlayLeft,`shift+Tab`),acceptOverlayRight:Q(e.acceptOverlayRight,`Tab`),copy:e.copy,cut:e.cut,delete:Q(e.delete,t?`Backspace|Delete`:`Delete`),downFill:Q(e.downFill,`primary+_68`),scrollToSelectedCell:Q(e.scrollToSelectedCell,`primary+Enter`),goDownCell:Q(e.goDownCell,`ArrowDown`),goDownCellRetainSelection:Q(e.goDownCellRetainSelection,`alt+ArrowDown`),goLeftCell:Q(e.goLeftCell,`ArrowLeft|shift+Tab`),goLeftCellRetainSelection:Q(e.goLeftCellRetainSelection,`alt+ArrowLeft`),goRightCell:Q(e.goRightCell,`ArrowRight|Tab`),goRightCellRetainSelection:Q(e.goRightCellRetainSelection,`alt+ArrowRight`),goUpCell:Q(e.goUpCell,`ArrowUp`),goUpCellRetainSelection:Q(e.goUpCellRetainSelection,`alt+ArrowUp`),goToFirstCell:Q(e.goToFirstCell,`primary+Home`),goToFirstColumn:Q(e.goToFirstColumn,`Home|primary+ArrowLeft`),goToFirstRow:Q(e.goToFirstRow,`primary+ArrowUp`),goToLastCell:Q(e.goToLastCell,`primary+End`),goToLastColumn:Q(e.goToLastColumn,`End|primary+ArrowRight`),goToLastRow:Q(e.goToLastRow,`primary+ArrowDown`),goToNextPage:Q(e.goToNextPage,`PageDown`),goToPreviousPage:Q(e.goToPreviousPage,`PageUp`),paste:e.paste,rightFill:Q(e.rightFill,`primary+_82`),search:Q(e.search,`primary+f`),selectAll:Q(e.selectAll,`primary+a`),selectColumn:Q(e.selectColumn,`ctrl+ `),selectGrowDown:Q(e.selectGrowDown,`shift+ArrowDown`),selectGrowLeft:Q(e.selectGrowLeft,`shift+ArrowLeft`),selectGrowRight:Q(e.selectGrowRight,`shift+ArrowRight`),selectGrowUp:Q(e.selectGrowUp,`shift+ArrowUp`),selectRow:Q(e.selectRow,`shift+ `),selectToFirstCell:Q(e.selectToFirstCell,`primary+shift+Home`),selectToFirstColumn:Q(e.selectToFirstColumn,`primary+shift+ArrowLeft`),selectToFirstRow:Q(e.selectToFirstRow,`primary+shift+ArrowUp`),selectToLastCell:Q(e.selectToLastCell,`primary+shift+End`),selectToLastColumn:Q(e.selectToLastColumn,`primary+shift+ArrowRight`),selectToLastRow:Q(e.selectToLastRow,`primary+shift+ArrowDown`)}}function qs(e){let t=cr(e);return K.useMemo(()=>{if(t===void 0)return Ks(Gs);let e={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Gs.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Gs.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Gs.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Gs.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Gs.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Gs.selectToLastCell};return Ks({...Gs,...e})},[t])}function Js(e){function t(e,n,r){if(typeof e==`number`)return{headerIndex:e,isCollapsed:!1,depth:n,path:r};let i={headerIndex:e.headerIndex,isCollapsed:e.isCollapsed,depth:n,path:r};return e.subGroups!==void 0&&(i.subGroups=e.subGroups.map((e,i)=>t(e,n+1,[...r,i])).sort((e,t)=>e.headerIndex-t.headerIndex)),i}return e.map((e,n)=>t(e,0,[n])).sort((e,t)=>e.headerIndex-t.headerIndex)}function Ys(e,t){let n=[];function r(e,i,a=!1){let o=i===null?t-e.headerIndex:i-e.headerIndex;if(e.subGroups!==void 0&&(o=e.subGroups[0].headerIndex-e.headerIndex),o--,n.push({rowIndex:-1,headerIndex:e.headerIndex,contentIndex:-1,skip:a,isCollapsed:e.isCollapsed,depth:e.depth,path:e.path,rows:o}),e.subGroups)for(let t=0;te.skip===!1).map(e=>{let{skip:t,...n}=e;return n})}function Xs(e,t){if(t===void 0||Ys.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(let e of t){if(n===0)return{path:[...e.path,-1],originalIndex:e.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:e.rows};if(e.isCollapsed)n--;else{if(n<=e.rows)return{path:[...e.path,n-1],originalIndex:e.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:e.contentIndex+n-1,groupRows:e.rows};n=n-e.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function Zs(e,t,n,r){let i=K.useMemo(()=>e===void 0?void 0:Ys(e,t),[e,t]),a=K.useMemo(()=>i?.reduce((e,t)=>(e[t.rowIndex]=t,e),{}),[i]),o=K.useMemo(()=>i===void 0?t:i.reduce((e,t)=>e+(t.isCollapsed?1:t.rows+1),0),[i,t]),s=K.useMemo(()=>e===void 0||typeof n==`number`&&e.height===n?n:t=>a?.[t]?e.height:typeof n==`number`?n:n(t),[a,e,n]),c=K.useCallback(e=>{if(i===void 0)return e;let t=e;for(let e of i){if(t===0)return;if(t--,!e.isCollapsed){if(t{if(e===void 0)return r?.(t,t,t);if(r===void 0&&e?.themeOverride===void 0)return;let{isGroupHeader:n,contentIndex:a,groupIndex:o}=Xs(t,i);return n?e.themeOverride:r?.(t,o,a)},[i,r,e]));return e===void 0?{rowHeight:s,rows:t,rowNumberMapper:c,getRowThemeOverride:l}:{rowHeight:s,rows:o,rowNumberMapper:c,getRowThemeOverride:l}}function Qs(e,t){let n=K.useMemo(()=>e===void 0?void 0:Ys(e,t),[e,t]);return{getRowGroupingForPath:ec,updateRowGroupingByPath:$s,mapper:K.useCallback(e=>{if(typeof e==`number`)return Xs(e,n);let t=Xs(e[1],n);return{...t,originalIndex:[e[0],t.originalIndex]}},[n])}}function $s(e,t,n){let[r,...i]=t;return i[0]===-1?e.map((e,t)=>t===r?{...e,...n}:e):e.map((e,t)=>t===r?{...e,subGroups:$s(e.subGroups??[],i,n)}:e)}function ec(e,t){let[n,...r]=t;return r[0]===-1?e[n]:ec(e[n].subGroups??[],r)}function tc(e,t){let[n]=K.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(e){let t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}));return n.callback=t,n.facade}function nc(e,t,n,r,i){let[a,o]=K.useMemo(()=>[t!==void 0&&typeof n==`number`?Math.floor(t/n):0,t!==void 0&&typeof n==`number`?-(t%n):0],[t,n]),[s,c,l]=or(K.useMemo(()=>({x:r.current.x,y:a,width:r.current.width??1,height:r.current.height??1,ty:o}),[r,o,a])),u=K.useRef(i);u.current=i;let d=tc(null,n=>{n!==null&&t!==void 0?n.scrollTop=t:n!==null&&e!==void 0&&(n.scrollLeft=e)}),f=(s.height??1)>1;K.useLayoutEffect(()=>{if(t!==void 0&&d.current!==null&&f){if(d.current.scrollTop===t)return;d.current.scrollTop=t,d.current.scrollTop!==t&&l(),u.current()}},[t,f,l,d]);let p=(s.width??1)>1;return K.useLayoutEffect(()=>{if(e!==void 0&&d.current!==null&&p){if(d.current.scrollLeft===e)return;d.current.scrollLeft=e,d.current.scrollLeft!==e&&l(),u.current()}},[e,p,l,d]),{visibleRegion:s,setVisibleRegion:c,scrollRef:d}}var rc=K.lazy(async()=>await Be(()=>import(`./data-grid-overlay-editor.Cl0FibMX.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),ic=0;function ac(e){return(0,ja.default)((0,Ma.default)((0,Ma.default)(e).filter(e=>e.span!==void 0).map(e=>(0,Na.default)((e.span?.[0]??0)+1,(e.span?.[1]??0)+1))))}function oc(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(e=>({...e,x:e.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}var sc={kind:U.Loading,allowOverlay:!1},cc={columns:Ut.empty(),rows:Ut.empty(),current:void 0},lc=K.forwardRef((e,t)=>{let[n,r]=K.useState(cc),[i,a]=K.useState(),o=K.useRef(null),s=K.useRef(null),[c,l]=K.useState(),u=K.useRef(),d=typeof window>`u`?null:window,{imageEditorOverride:f,getRowThemeOverride:p,markdownDivCreateNode:m,width:h,height:g,columns:_,rows:v,getCellContent:y,onCellClicked:b,onCellActivated:x,onFillPattern:S,onFinishedEditing:C,coercePasteValue:w,drawHeader:T,drawCell:E,editorBloom:D,onHeaderClicked:O,onColumnProposeMove:k,rangeSelectionColumnSpanning:A=!0,spanRangeBehavior:j=`default`,onGroupHeaderClicked:ee,onCellContextMenu:te,className:ne,onHeaderContextMenu:re,getCellsForSelection:ie,onGroupHeaderContextMenu:ae,onGroupHeaderRenamed:oe,onCellEdited:M,onCellsEdited:N,onSearchResultsChanged:se,searchResults:P,onSearchValueChange:ce,searchValue:le,onKeyDown:ue,onKeyUp:de,keybindings:fe,editOnType:pe=!0,onRowAppended:me,onColumnAppended:he,onColumnMoved:ge,validateCell:_e,highlightRegions:ve,rangeSelect:ye=`rect`,columnSelect:F=`multi`,rowSelect:be=`multi`,rangeSelectionBlending:xe=`exclusive`,columnSelectionBlending:Se=`exclusive`,rowSelectionBlending:I=`exclusive`,onDelete:Ce,onDragStart:L,onMouseMove:we,onPaste:R,copyHeaders:Te=!1,freezeColumns:z=0,cellActivationBehavior:B=`second-click`,rowSelectionMode:Ee=`auto`,columnSelectionMode:De=`auto`,onHeaderMenuClick:Oe,onHeaderIndicatorClick:V,getGroupDetails:ke,rowGrouping:Ae,onSearchClose:je,onItemHovered:H,onSelectionCleared:Me,showSearch:Ne,onVisibleRegionChanged:Pe,gridSelection:Fe,onGridSelectionChange:Ie,minColumnWidth:Le=50,maxColumnWidth:Re=500,maxColumnAutoWidth:ze,provideEditor:Be,trailingRowOptions:Ve,freezeTrailingRows:He=0,allowedFillDirections:Ue=`orthogonal`,scrollOffsetX:We,scrollOffsetY:Ge,verticalBorder:Ke,onDragOverCell:qe,onDrop:Je,onColumnResize:Ye,onColumnResizeEnd:Xe,onColumnResizeStart:Ze,customRenderers:Qe,fillHandle:$e,experimental:et,fixedShadowX:tt,fixedShadowY:nt,headerIcons:rt,imageWindowLoader:it,initialSize:at,isDraggable:ot,onDragLeave:st,onRowMoved:ct,overscrollX:lt,overscrollY:ut,preventDiagonalScrolling:dt,rightElement:ft,rightElementProps:pt,trapFocus:mt=!1,smoothScrollX:ht,smoothScrollY:gt,scaleToRem:_t=!1,rowHeight:vt=34,headerHeight:yt=36,groupHeaderHeight:bt=yt,theme:xt,isOutsideClick:St,renderers:Ct,resizeIndicator:wt,scrollToActiveCell:Tt=!0,drawFocusRing:Et=!0,portalElementRef:Dt}=e,Ot=Et===`no-editor`?i===void 0:Et,kt=typeof e.rowMarkers==`string`?void 0:e.rowMarkers,At=kt?.kind??e.rowMarkers??`none`,jt=kt?.width??e.rowMarkerWidth,Mt=kt?.startIndex??e.rowMarkerStartIndex??1,Nt=kt?.theme??e.rowMarkerTheme,Ft=kt?.headerTheme,It=kt?.headerAlwaysVisible,Rt=be!==`multi`||kt?.headerDisabled===!0,Vt=kt?.checkboxStyle??`square`,Gt=Math.max(Le,20),qt=Math.max(Re,Gt),Yt=Math.max(ze??qt,Gt),Xt=K.useMemo(()=>typeof window>`u`?{fontSize:`16px`}:window.getComputedStyle(document.documentElement),[]),{rows:W,rowNumberMapper:Qt,rowHeight:$t,getRowThemeOverride:an}=Zs(Ae,v,vt,p),{rowHeight:on,headerHeight:sn,groupHeaderHeight:cn,theme:ln,overscrollX:un,overscrollY:dn}=Ws({groupHeaderHeight:bt,headerHeight:yt,overscrollX:lt,overscrollY:ut,remSize:K.useMemo(()=>Number.parseFloat(Xt.fontSize),[Xt]),rowHeight:$t,scaleToRem:_t,theme:xt}),fn=qs(fe),pn=jt??(v>1e4?48:v>1e3?44:v>100?36:32),mn=At!==`none`,G=+!!mn,hn=Ve!==void 0,gn=Ve?.sticky===!0,[_n,vn]=K.useState(!1),yn=Ne??_n,bn=K.useCallback(()=>{je===void 0?vn(!1):je()},[je]),q=K.useMemo(()=>Fe===void 0?void 0:oc(Fe,G),[Fe,G])??n,xn=K.useRef();xn.current===void 0&&(xn.current=new AbortController),K.useEffect(()=>()=>xn?.current.abort(),[]);let[Sn,Cn]=Ss(ie,y,G,xn.current,W),wn=K.useCallback((e,t,n)=>{if(_e===void 0)return!0;let r=[e[0]-G,e[1]];return _e?.(r,t,n)},[G,_e]),Tn=K.useRef(Fe),En=K.useCallback((e,t)=>{t&&(e=Ns(e,Sn,G,j,xn.current)),Ie===void 0?r(e):(Tn.current=oc(e,-G),Ie(Tn.current))},[Ie,Sn,G,j]),Dn=Gn(Ye,K.useCallback((e,t,n,r)=>{Ye?.(_[n-G],t,n-G,r)},[Ye,G,_])),On=Gn(Xe,K.useCallback((e,t,n,r)=>{Xe?.(_[n-G],t,n-G,r)},[Xe,G,_])),kn=Gn(Ze,K.useCallback((e,t,n,r)=>{Ze?.(_[n-G],t,n-G,r)},[Ze,G,_])),An=Gn(T,K.useCallback((e,t)=>T?.({...e,columnIndex:e.columnIndex-G},t)??!1,[T,G])),jn=Gn(E,K.useCallback((e,t)=>E?.({...e,col:e.col-G},t)??!1,[E,G])),Mn=K.useCallback(e=>{if(Ce!==void 0){let t=Ce(oc(e,-G));return typeof t==`boolean`?t:oc(t,G)}return!0},[Ce,G]),[Nn,Pn,Fn]=xs(q,En,xe,Se,I,ye,A),In=K.useMemo(()=>zt(Zt(),ln),[ln]),[Ln,Rn]=K.useState([0,0,0]),zn=K.useMemo(()=>{if(Ct===void 0)return{};let e={};for(let t of Ct)e[t.kind]=t;return e},[Ct]),Bn=K.useCallback(e=>e.kind===U.Custom?Qe?.find(t=>t.isMatch(e)):zn[e.kind],[Qe,zn]),{sizedColumns:Vn,nonGrowWidth:Hn}=la(_,W,Cn,Ln[0]-(G===0?0:pn)-Ln[2],Gt,Yt,In,Bn,xn.current);At!==`none`&&(Hn+=pn);let Kn=K.useMemo(()=>Vn.some(e=>e.group!==void 0),[Vn]),qn=Kn?sn+cn:sn,Jn=q.rows.length,Yn=At===`none`?void 0:Jn===0?!1:Jn===W||void 0,Xn=K.useMemo(()=>At===`none`?Vn:[{title:``,width:pn,icon:void 0,hasMenu:!1,style:`normal`,themeOverride:Nt,rowMarker:Vt,rowMarkerChecked:Yn,headerRowMarkerTheme:Ft,headerRowMarkerAlwaysVisible:It,headerRowMarkerDisabled:Rt},...Vn],[At,Vn,pn,Nt,Vt,Yn,Ft,It,Rt]),Zn=K.useRef({height:1,width:1,x:0,y:0}),Qn=K.useRef(!1),{setVisibleRegion:$n,visibleRegion:er,scrollRef:tr}=nc(We,Ge,on,Zn,()=>Qn.current=!0);Zn.current=er;let nr=er.x+G,rr=er.y,ar=K.useRef(null),or=K.useCallback(e=>{e===!0?ar.current?.focus():window.requestAnimationFrame(()=>{ar.current?.focus()})},[]),sr=hn?W+1:W,cr=K.useCallback(e=>{let t=G===0?e:e.map(e=>({...e,location:[e.location[0]-G,e.location[1]]})),n=N?.(t);if(n!==!0)for(let e of t)M?.(e.location,e.value);return n},[M,N,G]),[lr,ur]=K.useState(),dr=q.current!==void 0&&q.current.range.width*q.current.range.height>1?q.current.range:void 0,fr=Ot?q.current?.cell:void 0,pr=fr?.[0],mr=fr?.[1],hr=K.useMemo(()=>{if((ve===void 0||ve.length===0)&&(dr??pr??mr??lr)===void 0)return;let e=[];if(ve!==void 0)for(let t of ve){let n=Xn.length-t.range.x-G;n>0&&e.push({color:t.color,range:{...t.range,x:t.range.x+G,width:Math.min(n,t.range.width)},style:t.style})}return lr!==void 0&&e.push({color:Ht(In.accentColor,0),range:lr,style:`dashed`}),dr!==void 0&&e.push({color:Ht(In.accentColor,.5),range:dr,style:`solid-outline`}),pr!==void 0&&mr!==void 0&&e.push({color:In.accentColor,range:{x:pr,y:mr,width:1,height:1},style:`solid-outline`}),e.length>0?e:void 0},[lr,dr,pr,mr,ve,Xn.length,In.accentColor,G]),gr=K.useRef(Xn);gr.current=Xn;let _r=K.useCallback(([e,t],n=!1)=>{let r=hn&&t===sr-1;if(e===0&&mn){if(r)return sc;let e=Qt(t);return e===void 0?sc:{kind:Wt.Marker,allowOverlay:!1,checkboxStyle:Vt,checked:q?.rows.hasIndex(t)===!0,markerKind:At===`clickable-number`?`number`:At,row:Mt+e,drawHandle:ct!==void 0,cursor:At===`clickable-number`?`pointer`:void 0}}else if(r){let t=e===G?Ve?.hint??``:``,n=gr.current[e];if(n?.trailingRowOptions?.disabled===!0)return sc;{let e=n?.trailingRowOptions?.hint??t,r=n?.trailingRowOptions?.addIcon??Ve?.addIcon;return{kind:Wt.NewRow,hint:e,allowOverlay:!1,icon:r}}}else{let r=e-G;if(n||et?.strict===!0){let e=Zn.current,n=e.x>r||r>e.x+e.width||e.y>t||t>e.y+e.height||t>=Tr.current,i=r===e.extras?.selected?.[0]&&t===e.extras?.selected[1],a=!1;if(e.extras?.freezeRegions!==void 0){for(let n of e.extras.freezeRegions)if(Za(n,r,t)){a=!0;break}}if(n&&!i&&!a)return sc}let i=y([r,t]);return G!==0&&i.span!==void 0&&(i={...i,span:[i.span[0]+G,i.span[1]+G]}),i}},[hn,sr,mn,Qt,Vt,q?.rows,At,Mt,ct,G,Ve?.hint,Ve?.addIcon,et?.strict,y]),vr=K.useCallback(e=>{let t=ke?.(e)??{name:e};return oe!==void 0&&e!==``&&(t={icon:t.icon,name:t.name,overrideTheme:t.overrideTheme,actions:[...t.actions??[],{title:`Rename`,icon:`renameIcon`,onClick:e=>J({group:t.name,bounds:e.bounds})}]}),t},[ke,oe]),yr=K.useCallback(e=>{let[t,n]=e.cell,r=Xn[t],i=r?.group===void 0?void 0:vr(r.group)?.overrideTheme,o=r?.themeOverride,s=an?.(n);a({...e,theme:zt(In,i,o,s,e.content.themeOverride)})},[an,Xn,vr,In]),br=K.useCallback((e,t,n)=>{if(q.current===void 0)return;let[r,i]=q.current.cell,a=_r([r,i]);if(a.kind!==U.Boolean&&a.allowOverlay){let o=a;if(n!==void 0)switch(o.kind){case U.Number:{let e=Pt(()=>n===`-`?-0:Number.parseFloat(n),0);o={...o,data:Number.isNaN(e)?0:e};break}case U.Text:case U.Markdown:case U.Uri:o={...o,data:n};break}yr({target:e,content:o,initialValue:n,cell:[r,i],highlight:n===void 0,forceEditMode:n!==void 0,activation:t})}else a.kind===U.Boolean&&t.inputType===`keyboard`&&a.readonly!==!0&&(cr([{location:q.current.cell,value:{...a,data:Ls(a.data)}}]),ar.current?.damage([{cell:q.current.cell}]))},[_r,q,cr,yr]),xr=K.useCallback((e,t)=>{let n=ar.current?.getBounds(e,t);if(n===void 0||tr.current===null)return;let r=_r([e,t]);r.allowOverlay&&yr({target:n,content:r,initialValue:void 0,highlight:!0,cell:[e,t],forceEditMode:!0,activation:{inputType:`keyboard`,key:`Enter`}})},[_r,tr,yr]),Sr=K.useCallback((e,t,n=`both`,r=0,i=0,a=void 0)=>{if(tr.current!==null){let o=ar.current,c=s.current,l=typeof e==`number`?e:e.unit===`cell`?e.amount:void 0,u=typeof t==`number`?t:t.unit===`cell`?t.amount:void 0,d=typeof e!=`number`&&e.unit===`px`?e.amount:void 0,f=typeof t!=`number`&&t.unit===`px`?t.amount:void 0;if(o!==null&&c!==null){let s={x:0,y:0,width:0,height:0},p=0,m=0;if((l!==void 0||u!==void 0)&&(s=o.getBounds((l??0)+G,u??0)??s,s.width===0||s.height===0))return;let h=c.getBoundingClientRect(),g=h.width/c.offsetWidth;if(d!==void 0&&(s={...s,x:d-h.left-tr.current.scrollLeft,width:1}),f!==void 0&&(s={...s,y:f+h.top-tr.current.scrollTop,height:1}),s!==void 0){let o={x:s.x-r,y:s.y-i,width:s.width+2*r,height:s.height+2*i},c=0;for(let e=0;e0&&(l=Ti(sr,u,on));let d=c*g+h.left+G*pn*g,f=h.right,_=h.top+qn*g,v=h.bottom-l*g,y=s.width+r*2;switch(a?.hAlign){case`start`:f=d+y;break;case`end`:d=f-y;break;case`center`:d=Math.floor((d+f)/2)-y/2,f=d+y;break}let b=s.height+i*2;switch(a?.vAlign){case`start`:v=_+b;break;case`end`:_=v-b;break;case`center`:_=Math.floor((_+v)/2)-b/2,v=_+b;break}d>o.x?p=o.x-d:fo.y?m=o.y-_:v=sr-u)&&(m=0),(p!==0||m!==0)&&(g!==1&&(p/=g,m/=g),tr.current.scrollTo({left:p+tr.current.scrollLeft,top:m+tr.current.scrollTop,behavior:a?.behavior??`auto`}))}}}},[G,He,pn,tr,qn,z,Vn,sr,gn,on]),Cr=K.useRef(xr),wr=K.useRef(y);Cr.current=xr,wr.current=y;let Tr=K.useRef(W);Tr.current=W;let Er=K.useRef(Xn.length);Er.current=Xn.length;let Dr=K.useCallback(async(e,t=!0,n)=>{if(Xn[e]?.trailingRowOptions?.disabled===!0)return;let r=me?.(),i,a=!0;r!==void 0&&(i=await r,i===`top`&&(a=!1),typeof i==`number`&&(a=!1));let o=0,s=()=>{if(Tr.current<=W){o<500&&window.setTimeout(s,o),o=50+o*2;return}let r=typeof i==`number`?i:a?W:0;ki.current(e-G,r,`both`,0,0,n?{behavior:n}:void 0),Nn({cell:[e,r],range:{x:e,y:r,width:1,height:1}},!1,!1,`edit`);let c=wr.current([e-G,r]);c.allowOverlay&&nn(c)&&c.readonly!==!0&&t&&window.setTimeout(()=>{Cr.current(e,r)},0)};s()},[Xn,me,G,W,Nn]),Or=K.useCallback(async(e,t=!0)=>{let n=he?.(),r,i=!0;n!==void 0&&(r=await n,r===`left`&&(i=!1),typeof r==`number`&&(i=!1));let a=0,o=()=>{if(Er.current<=Xn.length){a<500&&window.setTimeout(o,a),a=50+a*2;return}let n=typeof r==`number`?r:i?Xn.length:0;Sr(n-G,e),Nn({cell:[n,e],range:{x:n,y:e,width:1,height:1}},!1,!1,`edit`);let s=wr.current([n-G,e]);s.allowOverlay&&nn(s)&&s.readonly!==!0&&t&&window.setTimeout(()=>{Cr.current(n,e)},0)};o()},[Xn,he,G,Sr,Nn]),kr=K.useCallback(e=>{let t=Vn[e]?.trailingRowOptions?.targetColumn??Ve?.targetColumn;if(typeof t==`number`)return t+ +!!mn;if(typeof t==`object`){let e=_.indexOf(t);if(e>=0)return e+ +!!mn}},[Vn,_,mn,Ve?.targetColumn]),Ar=K.useRef(),jr=K.useRef(),Mr=K.useCallback((e,t)=>{let[n,r]=t;return zt(In,Xn[n]?.themeOverride,an?.(r),e.themeOverride)},[an,Xn,In]),{mapper:Nr}=Qs(Ae,v),Pr=Ae?.navigationBehavior,Fr=K.useCallback(e=>{let t=Ko.value?e.metaKey:e.ctrlKey,n=t&&be===`multi`,[r,i]=e.location,o=q.columns,s=q.rows,[c,l]=q.current?.cell??[];if(e.kind===`cell`){if(jr.current=void 0,Lr.current=[r,i],r===0&&mn){if(hn===!0&&i===W||At===`number`||be===`none`)return;let r=_r(e.location);if(r.kind!==Wt.Marker)return;if(ct!==void 0){let t=Bn(r);tn(t?.kind===Wt.Marker);let n=t?.onClick?.({...e,cell:r,posX:e.localEventX,posY:e.localEventY,bounds:e.bounds,theme:Mr(r,e.location),preventDefault:()=>void 0});if(n===void 0||n.checked===r.checked)return}a(void 0),or();let o=s.hasIndex(i),c=Ar.current;if(be===`multi`&&(e.shiftKey||e.isLongTouch===!0)&&c!==void 0&&s.hasIndex(c)){let e=[Math.min(c,i),Math.max(c,i)+1];n||Ee===`multi`?Pn(void 0,e,!0):Pn(Ut.fromSingleSelection(e),void 0,n)}else be===`multi`&&(n||e.isTouch||Ee===`multi`)?o?Pn(s.remove(i),void 0,!0):(Pn(void 0,i,!0),Ar.current=i):o&&s.length===1?Pn(Ut.empty(),void 0,t):(Pn(Ut.fromSingleSelection(i),void 0,t),Ar.current=i)}else if(r>=G&&hn&&i===W){let e=kr(r);Dr(e??r)}else if(c!==r||l!==i){let n=_r(e.location),o=Bn(n);if(o?.onSelect!==void 0){let t=!1;if(o.onSelect({...e,cell:n,posX:e.localEventX,posY:e.localEventY,bounds:e.bounds,preventDefault:()=>t=!0,theme:Mr(n,e.location)}),t)return}if(Pr===`block`&&Nr(i).isGroupHeader)return;let s=gn&&i===W,u=gn&&q!==void 0&&q.current?.cell[1]===W;if((e.shiftKey||e.isLongTouch===!0)&&c!==void 0&&l!==void 0&&q.current!==void 0&&!u){if(s)return;let e=Math.min(r,c),n=Math.max(r,c),a=Math.min(i,l),o=Math.max(i,l);Nn({...q.current,range:{x:e,y:a,width:n-e+1,height:o-a+1}},!0,t,`click`),Ar.current=void 0,or()}else Nn({cell:[r,i],range:{x:r,y:i,width:1,height:1}},!0,t,`click`),Ar.current=void 0,a(void 0),or()}}else if(e.kind===`header`)if(Lr.current=[r,i],a(void 0),mn&&r===0)Ar.current=void 0,jr.current=void 0,!Rt&&be===`multi`&&(s.length===W?Pn(Ut.empty(),void 0,t):Pn(Ut.fromSingleSelection([0,W]),void 0,t),or());else{let n=jr.current;if(F===`multi`&&(e.shiftKey||e.isLongTouch===!0)&&n!==void 0&&o.hasIndex(n)){let i=[Math.min(n,r),Math.max(n,r)+1];t||e.isTouch||De===`multi`?Fn(void 0,i,t):Fn(Ut.fromSingleSelection(i),void 0,t)}else F===`multi`&&(t||e.isTouch||De===`multi`)?(o.hasIndex(r)?Fn(o.remove(r),void 0,t):Fn(void 0,r,t),jr.current=r):F!==`none`&&(o.hasIndex(r)?Fn(o.remove(r),void 0,t):Fn(Ut.fromSingleSelection(r),void 0,t),jr.current=r);Ar.current=void 0,or()}else e.kind===`group-header`?Lr.current=[r,i]:e.kind===`out-of-bounds`&&!e.isMaybeScrollbar&&(En(cc,!1),a(void 0),or(),Me?.(),Ar.current=void 0,jr.current=void 0)},[be,F,q,mn,G,hn,W,At,_r,ct,or,Ee,De,Bn,Mr,Pn,kr,Dr,Pr,Nr,gn,Nn,Rt,Fn,En,Me]),Ir=K.useRef(!1),Lr=K.useRef(),Rr=K.useRef(er),zr=K.useRef(),Br=K.useCallback(e=>{if(Hr.current=!1,Rr.current=Zn.current,e.button!==0&&e.button!==1){zr.current=void 0;return}let t=performance.now();zr.current={button:e.button,time:t,location:e.location},e?.kind===`header`&&(Ir.current=!0);let n=e.kind===`cell`&&e.isFillHandle;!n&&e.kind!==`cell`&&e.isEdge||(l({previousSelection:q,fillHandle:n}),Lr.current=void 0,!e.isTouch&&e.button===0&&!n?Fr(e):!e.isTouch&&e.button===1&&(Lr.current=e.location))},[q,Fr]),[Vr,J]=K.useState(),Y=K.useCallback(e=>{if(e.kind!==`group-header`||F!==`multi`)return;let t=Ko.value?e.metaKey:e.ctrlKey,[n]=e.location,r=q.columns;if(n=G&&gi(i.group,Xn[e].group);e--)a--;for(let e=n+1;e{if(Sn!==void 0&&Dn!==void 0){let t=Zn.current.y,n=Zn.current.height,r=Sn({x:e,y:t,width:1,height:Math.min(n,W-t)},xn.current.signal);typeof r!=`object`&&(r=await r());let i=Vn[e-G],a=document.createElement(`canvas`).getContext(`2d`,{alpha:!1});if(a!==null){a.font=In.baseFontFull;let t=ca(a,In,i,0,r,Gt,qt,!1,Bn);Dn?.(i,t.width,e,t.width)}}},[Vn,Sn,qt,In,Gt,Dn,G,W,Bn]),[Wr,Gr]=K.useState(),Kr=K.useCallback(async(e,t)=>{let n=e.current?.range;if(n===void 0||Sn===void 0||t.current===void 0)return;let r=t.current.range;if(S!==void 0){let e=!1;if(S({fillDestination:{...r,x:r.x-G},patternSource:{...n,x:n.x-G},preventDefault:()=>e=!0}),e)return}let i=Sn(n,xn.current.signal);typeof i!=`object`&&(i=await i());let a=i,o=[];for(let e=0;e({cell:e.location})))},[Sn,cr,S,G]),qr=K.useCallback(()=>{if(q.current===void 0||q.current.range.width<=1)return;let e={...q,current:{...q.current,range:{...q.current.range,width:1}}};Kr(e,q)},[Kr,q]),Jr=K.useCallback(()=>{if(q.current===void 0||q.current.range.height<=1)return;let e={...q,current:{...q.current,range:{...q.current.range,height:1}}};Kr(e,q)},[Kr,q]),Yr=K.useCallback((e,t)=>{let n=c;if(l(void 0),ur(void 0),Gr(void 0),Ir.current=!1,t)return;if(n?.fillHandle===!0&&q.current!==void 0&&n.previousSelection?.current!==void 0){if(lr===void 0)return;let e={...q,current:{...q.current,range:Qa(n.previousSelection.current.range,lr)}};Kr(n.previousSelection,e),En(e,!0);return}let[r,i]=e.location,[a,o]=Lr.current??[],s=()=>{Hr.current=!0},u=t=>{let c=t.isTouch||a===r&&o===i;if(c&&b?.([r-G,i],{...t,preventDefault:s}),t.button===1)return!Hr.current;if(!Hr.current){let a=_r(e.location),o=Bn(a);if(o!==void 0&&o.onClick!==void 0&&c){let n=o.onClick({...t,cell:a,posX:t.localEventX,posY:t.localEventY,bounds:t.bounds,theme:Mr(a,e.location),preventDefault:s});n!==void 0&&!rn(n)&&en(n)&&(cr([{location:t.location,value:n}]),ar.current?.damage([{cell:t.location}]))}if(Hr.current||q.current===void 0)return!1;let l=!1;switch(a.activationBehaviorOverride??B){case`double-click`:case`second-click`:{if(n?.previousSelection?.current?.cell===void 0)break;let[e,a]=q.current.cell,[o,s]=n.previousSelection.current.cell;l=r===e&&r===o&&i===a&&i===s&&(t.isDoubleClick===!0||B===`second-click`);break}case`single-click`:l=!0;break}if(l){let e={inputType:`pointer`,pointerActivation:t.isDoubleClick===!0?`double-click`:a.activationBehaviorOverride??B,pointerType:t.isTouch?`touch`:`mouse`};return x?.([r-G,i],e),br(t.bounds,e),!0}}return!1},d=e.location[0]-G;if(e.isTouch){let t=Zn.current,n=Rr.current;if(t.x!==n.x||t.y!==n.y)return;if(e.isLongTouch===!0){if(e.kind===`cell`&&yi(q.current?.cell,e.location)){te?.([d,e.location[1]],{...e,preventDefault:s});return}else if(e.kind===`header`&&q.columns.hasIndex(r)){re?.(d,{...e,preventDefault:s});return}else if(e.kind===`group-header`){if(d<0)return;ae?.(d,{...e,preventDefault:s});return}}e.kind===`cell`?u(e)||Fr(e):e.kind===`group-header`?ee?.(d,{...e,preventDefault:s}):(e.kind===`header`&&O?.(d,{...e,preventDefault:s}),Fr(e));return}if(e.kind===`header`){if(d<0)return;e.isEdge?e.isDoubleClick===!0&&Ur(r):e.button===0&&r===a&&i===o&&O?.(d,{...e,preventDefault:s})}if(e.kind===`group-header`){if(d<0)return;e.button===0&&r===a&&i===o&&(ee?.(d,{...e,preventDefault:s}),Hr.current||Y(e))}e.kind===`cell`&&(e.button===0||e.button===1)&&u(e),Lr.current=void 0},[c,q,G,lr,Kr,En,b,_r,Bn,B,Mr,cr,x,br,te,re,ae,Fr,ee,O,Ur,Y]),Xr=K.useCallback(e=>{let t={...e,location:[e.location[0]-G,e.location[1]]};we?.(t),c!==void 0&&e.buttons===0&&(l(void 0),ur(void 0),Gr(void 0),Ir.current=!1),Gr(t=>Ir.current?[e.scrollEdge[0],0]:e.scrollEdge[0]===t?.[0]&&e.scrollEdge[1]===t[1]?t:c===void 0||(zr.current?.location[0]??0){Oe?.(e-G,t)},[Oe,G]),X=K.useCallback((e,t)=>{V?.(e-G,t)},[V,G]),Qr=q?.current?.cell,$r=K.useCallback((e,t,n,r,i,a)=>{Qn.current=!1;let o=Qr;o!==void 0&&(o=[o[0]-G,o[1]]);let s=z===0?void 0:{x:0,y:e.y,width:z,height:e.height},c=[];s!==void 0&&c.push(s),He>0&&(c.push({x:e.x-G,y:W-He,width:e.width,height:He}),z>0&&c.push({x:0,y:W-He,width:z,height:He}));let l={x:e.x-G,y:e.y,width:e.width,height:hn&&e.y+e.height>=W?e.height-1:e.height,tx:i,ty:a,extras:{selected:o,freezeRegion:s,freezeRegions:c}};Zn.current=l,$n(l),Rn([t,n,r]),Pe?.(l,l.tx,l.ty,l.extras)},[Qr,G,hn,W,z,He,$n,Pe]),ei=Gn(k,K.useCallback((e,t)=>k?.(e-G,t-G)!==!1,[k,G])),ti=Gn(ge,K.useCallback((e,t)=>{ge?.(e-G,t-G),F!==`none`&&Fn(Ut.fromSingleSelection(t),void 0,!0)},[F,ge,G,Fn])),ni=K.useRef(!1),ri=K.useCallback(e=>{if(e.location[0]===0&&G>0){e.preventDefault();return}L?.({...e,location:[e.location[0]-G,e.location[1]]}),e.defaultPrevented()||(ni.current=!0),l(void 0)},[L,G]),ii=K.useCallback(()=>{ni.current=!1},[]),ai=Ae?.selectionBehavior,oi=K.useCallback(e=>{if(ai!==`block-spanning`)return;let{isGroupHeader:t,path:n,groupRows:r}=Nr(e);if(t)return[e,e];let i=n[n.length-1];return[e-i,e+r-i-1]},[Nr,ai]),si=K.useRef(),ci=K.useCallback(e=>{if(!Qo(e,si.current)&&(si.current=e,!(zr?.current?.button!==void 0&&zr.current.button>=1))){if(e.buttons!==0&&c!==void 0&&zr.current?.location[0]===0&&G===1&&be===`multi`&&c.previousSelection&&!c.previousSelection.rows.hasIndex(zr.current.location[1])&&q.rows.hasIndex(zr.current.location[1])){let t=Math.min(zr.current.location[1],e.location[1]),n=Math.max(zr.current.location[1],e.location[1])+1;Pn(Ut.fromSingleSelection([t,n]),void 0,!1)}else if(e.buttons!==0&&c!==void 0&&q.current!==void 0&&!ni.current&&!Ir.current&&(ye===`rect`||ye===`multi-rect`)){let[t,n]=q.current.cell,[r,i]=e.location;if(i<0&&(i=Zn.current.y),c.fillHandle===!0&&c.previousSelection?.current!==void 0){let e=c.previousSelection.current.range;i=Math.min(i,hn?W-1:W);let t=Ya(e,r,i,Ue);ur(t)}else{if(hn&&n===W)return;if(hn&&i===W)if(e.kind===`out-of-bounds`)i--;else return;r=Math.max(r,G);let a=oi(n);i=a===void 0?i:(0,Aa.default)(i,a[0],a[1]);let o=r-t,s=i-n,c={x:o>=0?t:r,y:s>=0?n:i,width:Math.abs(o)+1,height:Math.abs(s)+1};Nn({...q.current,range:c},!0,!1,`drag`)}}H?.({...e,location:[e.location[0]-G,e.location[1]]})}},[c,G,be,q,ye,H,Pn,hn,W,Ue,oi,Nn]);Us(Wr,tr,K.useCallback(()=>{let e=si.current;if(e===void 0)return;let[t,n]=e.scrollEdge,[r,i]=e.location,a=Zn.current;t===-1?r=a.extras?.freezeRegion?.x??a.x:t===1&&(r=a.x+a.width),n===-1?i=Math.max(0,a.y):n===1&&(i=Math.min(W-1,a.y+a.height)),r=(0,Aa.default)(r,0,Xn.length-1),i=(0,Aa.default)(i,0,W-1),ci({...e,location:[r,i]})},[Xn.length,ci,W]));let li=K.useCallback(e=>{if(q.current===void 0)return;let[t,n]=e,[r,i]=q.current.cell,a=q.current.range,o=a.x,s=a.x+a.width,c=a.y,l=a.y+a.height,[u,d]=oi(i)??[0,W-1],f=d+1;if(n!==0)switch(n){case 2:l=f,c=i,Sr(0,l,`vertical`);break;case-2:c=u,l=i+1,Sr(0,c,`vertical`);break;case 1:ci+1?(l--,Sr(0,l,`vertical`)):(c=Math.max(u,c-1),Sr(0,c,`vertical`));break;default:Lt(n)}if(t!==0)if(t===2)s=Xn.length,o=r,Sr(s-1-G,0,`horizontal`);else if(t===-2)o=G,s=r+1,Sr(o-G,0,`horizontal`);else{let e=[];if(Sn!==void 0){let t=Sn({x:o,y:c,width:s-o-G,height:l-c},xn.current.signal);typeof t==`object`&&(e=ac(t))}if(t===1){let t=!1;if(o0){let n=(0,Na.default)(o+1,r+1).find(t=>!e.includes(t-G));n!==void 0&&(o=n,t=!0)}else o++,t=!0;t&&Sr(o,0,`horizontal`)}t||(s=Math.min(Xn.length,s+1),Sr(s-1-G,0,`horizontal`))}else if(t===-1){let t=!1;if(s>r+1){if(e.length>0){let n=(0,Na.default)(s-1,r,-1).find(t=>!e.includes(t-G));n!==void 0&&(s=n,t=!0)}else s--,t=!0;t&&Sr(s-G,0,`horizontal`)}t||(o=Math.max(G,o-1),Sr(o-G,0,`horizontal`))}else Lt(t)}Nn({cell:q.current.cell,range:{x:o,y:c,width:s-o,height:l-c}},!0,!1,`keyboard-select`)},[Sn,oi,q,Xn.length,G,W,Sr,Nn]),ui=K.useRef(Tt);ui.current=Tt;let di=K.useCallback((e,t,n,r)=>{let i=sr-+!n;e=(0,Aa.default)(e,G,Vn.length-1+G),t=(0,Aa.default)(t,0,i);let a=Qr?.[0],o=Qr?.[1];if(e===a&&t===o)return!1;if(r&&q.current!==void 0){let n=[...q.current.rangeStack];(q.current.range.width>1||q.current.range.height>1)&&n.push(q.current.range),En({...q,current:{cell:[e,t],range:{x:e,y:t,width:1,height:1},rangeStack:n}},!0)}else Nn({cell:[e,t],range:{x:e,y:t,width:1,height:1}},!0,!1,`keyboard-nav`);return u.current!==void 0&&u.current[0]===e&&u.current[1]===t&&(u.current=void 0),ui.current&&Sr(e-G,t),!0},[sr,G,Vn.length,Qr,q,Sr,En,Nn]),fi=K.useCallback((e,t)=>{i?.cell!==void 0&&e!==void 0&&en(e)&&(cr([{location:i.cell,value:e}]),window.requestAnimationFrame(()=>{ar.current?.damage([{cell:i.cell}])})),or(!0),a(void 0);let[n,r]=t;if(q.current!==void 0&&(n!==0||r!==0)){let t=q.current.cell[1]===sr-1&&e!==void 0,i=q.current.cell[0]===Xn.length-1&&e!==void 0,a=!0;if(t&&r===1&&me!==void 0){a=!1;let e=q.current.cell[0]+n,t=kr(e);Dr(t??e,!1)}if(i&&n===1&&he!==void 0){a=!1;let e=q.current.cell[1]+r;Or(e,!1)}a&&di((0,Aa.default)(q.current.cell[0]+n,0,Xn.length-1),(0,Aa.default)(q.current.cell[1]+r,0,sr-1),t,!1)}C?.(e,t)},[i?.cell,or,q,C,cr,sr,di,Xn.length,Dr,Or,me,he,kr]),pi=K.useMemo(()=>`gdg-overlay-${ic++}`,[]),mi=K.useCallback(e=>{or();let t=[];for(let n=e.x;n({cell:e.location})))},[or,y,Bn,cr,G]),_i=i!==void 0,bi=K.useCallback(e=>{let t=()=>{e.stopPropagation(),e.preventDefault()},n={didMatch:!1},{bounds:r}=e,i=q.columns,s=q.rows,c=fn;if(!_i&&Z(c.clear,e,n))En(cc,!1),Me?.();else if(!_i&&Z(c.selectAll,e,n))En({columns:Ut.empty(),rows:Ut.empty(),current:{cell:q.current?.cell??[G,0],range:{x:G,y:0,width:_.length,height:W},rangeStack:[]}},!1);else if(Z(c.search,e,n))o?.current?.focus({preventScroll:!0}),vn(!0);else if(Z(c.delete,e,n)){let e=Mn?.(q)??!0;if(e!==!1){let t=e===!0?q:e;if(t.current!==void 0){mi(t.current.range);for(let e of t.current.rangeStack)mi(e)}for(let e of t.rows)mi({x:G,y:e,width:_.length,height:1});for(let e of t.columns)mi({x:e,y:0,width:1,height:W})}}if(n.didMatch)return t(),!0;if(q.current===void 0)return!1;let[l,u]=q.current.cell,[,d]=q.current.cell,f=!1,p=!1;if(Z(c.scrollToSelectedCell,e,n))ki.current(l-G,u);else if(F!==`none`&&Z(c.selectColumn,e,n))i.hasIndex(l)?Fn(i.remove(l),void 0,!0):F===`single`?Fn(Ut.fromSingleSelection(l),void 0,!0):Fn(void 0,l,!0);else if(be!==`none`&&Z(c.selectRow,e,n))s.hasIndex(u)?Pn(s.remove(u),void 0,!0):be===`single`?Pn(Ut.fromSingleSelection(u),void 0,!0):Pn(void 0,u,!0);else if(!_i&&r!==void 0&&Z(c.activateCell,e,n))if(u===W&&hn)window.setTimeout(()=>{let e=kr(l);Dr(e??l)},0);else{let t={inputType:`keyboard`,key:e.key};x?.([l-G,u],t),br(r,t)}else q.current.range.height>1&&Z(c.downFill,e,n)?Jr():q.current.range.width>1&&Z(c.rightFill,e,n)?qr():Z(c.goToNextPage,e,n)?u+=Math.max(1,Zn.current.height-4):Z(c.goToPreviousPage,e,n)?u-=Math.max(1,Zn.current.height-4):Z(c.goToFirstCell,e,n)?(a(void 0),u=0,l=0):Z(c.goToLastCell,e,n)?(a(void 0),u=2**53-1,l=2**53-1):Z(c.selectToFirstCell,e,n)?(a(void 0),li([-2,-2])):Z(c.selectToLastCell,e,n)?(a(void 0),li([2,2])):_i?(Z(c.closeOverlay,e,n)&&a(void 0),Z(c.acceptOverlayDown,e,n)&&(a(void 0),u++),Z(c.acceptOverlayUp,e,n)&&(a(void 0),u--),Z(c.acceptOverlayLeft,e,n)&&(a(void 0),l--),Z(c.acceptOverlayRight,e,n)&&(a(void 0),l++)):(Z(c.goDownCell,e,n)?u+=1:Z(c.goUpCell,e,n)?--u:Z(c.goRightCell,e,n)?l+=1:Z(c.goLeftCell,e,n)?--l:Z(c.goDownCellRetainSelection,e,n)?(u+=1,f=!0):Z(c.goUpCellRetainSelection,e,n)?(--u,f=!0):Z(c.goRightCellRetainSelection,e,n)?(l+=1,f=!0):Z(c.goLeftCellRetainSelection,e,n)?(--l,f=!0):Z(c.goToLastRow,e,n)?u=W-1:Z(c.goToFirstRow,e,n)?u=-(2**53-1):Z(c.goToLastColumn,e,n)?l=2**53-1:Z(c.goToFirstColumn,e,n)?l=-(2**53-1):(ye===`rect`||ye===`multi-rect`)&&(Z(c.selectGrowDown,e,n)?li([0,1]):Z(c.selectGrowUp,e,n)?li([0,-1]):Z(c.selectGrowRight,e,n)?li([1,0]):Z(c.selectGrowLeft,e,n)?li([-1,0]):Z(c.selectToLastRow,e,n)?li([0,2]):Z(c.selectToFirstRow,e,n)?li([0,-2]):Z(c.selectToLastColumn,e,n)?li([2,0]):Z(c.selectToFirstColumn,e,n)&&li([-2,0])),p=n.didMatch);if(Pr!==void 0&&Pr!==`normal`&&u!==d){let e=Pr===`skip-up`||Pr===`skip`||Pr===`block`,t=Pr===`skip-down`||Pr===`skip`||Pr===`block`,n=u=0&&Nr(u).isGroupHeader;)u--;u<0&&(u=d)}else if(!n&&t){for(;u=W&&(u=d)}}let m=di(l,u,!1,f),h=n.didMatch;return h&&(m||!p||mt)&&t(),h},[Pr,_i,q,fn,F,be,ye,G,Nr,W,di,En,Me,_.length,Mn,mt,mi,Fn,Pn,hn,kr,Dr,x,br,Jr,qr,li]),xi=K.useCallback(e=>{let t=!1;if(ue!==void 0&&ue({...e,...e.location&&{location:[e.location[0]-G,e.location[1]]},cancel:()=>{t=!0}}),t||bi(e)||q.current===void 0)return;let[n,r]=q.current.cell,i=Zn.current;if(pe&&!e.metaKey&&!e.ctrlKey&&q.current!==void 0&&e.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(e.key)&&e.bounds!==void 0&&nn(y([n-G,Math.max(0,Math.min(r,W-1))]))){if((!hn||r!==W)&&(i.y>r||r>i.y+i.height||i.x>n||n>i.x+i.width))return;let t={inputType:`keyboard`,key:e.key};x?.([n-G,r],t),br(e.bounds,t,e.key),e.stopPropagation(),e.preventDefault()}},[pe,ue,bi,q,y,G,W,hn,x,br]),Si=K.useCallback((e,t)=>{let n=e.location[0]-G;if(e.kind===`header`&&re?.(n,{...e,preventDefault:t}),e.kind===`group-header`){if(n<0)return;ae?.(n,{...e,preventDefault:t})}if(e.kind===`cell`){let[r,i]=e.location;te?.([n,i],{...e,preventDefault:t}),hi(q,e.location)||di(r,i,!1,!1)}},[q,te,ae,re,G,di]),Ci=K.useCallback(async e=>{if(!fn.paste)return;function t(e,t,n,r){let i=typeof n==`object`?n?.join(` +`)??``:n?.toString()??``;if(!rn(e)&&nn(e)&&e.readonly!==!0){let a=w?.(i,e);if(a!==void 0&&en(a))return{location:t,value:a};let o=Bn(e);if(o===void 0)return;if(o.kind===U.Custom){tn(e.kind===U.Custom);let n=o.onPaste?.(i,e.data);return n===void 0?void 0:{location:t,value:{...e,data:n}}}else{let a=o.onPaste?.(i,e,{formatted:r,formattedString:typeof r==`string`?r:r?.join(` +`),rawValue:n});return a===void 0?void 0:(tn(a.kind===e.kind),{location:t,value:a})}}}let n=q.columns,r=q.rows,i=tr.current?.contains(document.activeElement)===!0||s.current?.contains(document.activeElement)===!0,a;if(q.current===void 0?n.length===1?a=[n.first()??0,0]:r.length===1&&(a=[G,r.first()??0]):a=[q.current.range.x,q.current.range.y],i&&a!==void 0){let n,r,i=`text/plain`,o=`text/html`;if(navigator.clipboard.read!==void 0){let e=await navigator.clipboard.read();for(let t of e){if(t.types.includes(o)){let e=Ms(await(await t.getType(o)).text());if(e!==void 0){n=e;break}}t.types.includes(i)&&(r=await(await t.getType(i)).text())}}else if(navigator.clipboard.readText!==void 0)r=await navigator.clipboard.readText();else if(e!==void 0&&e?.clipboardData!==null)e.clipboardData.types.includes(o)&&(n=Ms(e.clipboardData.getData(o))),n===void 0&&e.clipboardData.types.includes(i)&&(r=e.clipboardData.getData(i));else return;let[s,c]=a,l=[];do{if(R===void 0){let e=_r(a),i=r??n?.map(e=>e.map(e=>e.rawValue).join(` `)).join(` `)??``,o=t(e,a,i,void 0);o!==void 0&&l.push(o);break}if(n===void 0){if(r===void 0)return;n=Fs(r)}if(R===!1||typeof R==`function`&&R?.([a[0]-G,a[1]],n.map(e=>e.map(e=>e.rawValue?.toString()??``)))!==!0)return;for(let[e,r]of n.entries()){if(e+c>=W)break;for(let[n,i]of r.entries()){let r=[n+s,e+c],[a,o]=r;if(a>=Xn.length||o>=sr)continue;let u=t(_r(r),r,i.rawValue,i.formatted);u!==void 0&&l.push(u)}}}while(!1);cr(l),ar.current?.damage(l.map(e=>({cell:e.location})))}},[w,Bn,_r,q,fn.paste,tr,Xn.length,cr,sr,R,G,W]);Wn(`paste`,Ci,d,!1,!0);let wi=K.useCallback(async(e,t)=>{if(!fn.copy)return;let n=t===!0||tr.current?.contains(document.activeElement)===!0||s.current?.contains(document.activeElement)===!0,r=q.columns,i=q.rows,a=(t,n)=>{Is(Te?[n.map(e=>({kind:U.Text,data:_[e].title,displayData:_[e].title,allowOverlay:!1})),...t]:t,n,e)};if(n&&Sn!==void 0){if(q.current!==void 0){let e=Sn(q.current.range,xn.current.signal);typeof e!=`object`&&(e=await e()),a(e,(0,Na.default)(q.current.range.x-G,q.current.range.x+q.current.range.width-G))}else if(i!==void 0&&i.length>0){let e=[...i].map(e=>{let t=Sn({x:G,y:e,width:_.length,height:1},xn.current.signal);return typeof t==`object`?t[0]:t().then(e=>e[0])});e.some(e=>e instanceof Promise)?a(await Promise.all(e),(0,Na.default)(_.length)):a(e,(0,Na.default)(_.length))}else if(r.length>0){let e=[],t=[];for(let n of r){let r=Sn({x:n,y:0,width:1,height:W},xn.current.signal);typeof r!=`object`&&(r=await r()),e.push(r),t.push(n-G)}e.length===1?a(e[0],t):a(e.reduce((e,t)=>e.map((e,n)=>[...e,...t[n]])),t)}}},[_,Sn,q,fn.copy,G,tr,W,Te]);Wn(`copy`,wi,d,!1,!1),Wn(`cut`,K.useCallback(async e=>{if(fn.cut&&(tr.current?.contains(document.activeElement)===!0||s.current?.contains(document.activeElement)===!0)&&(await wi(e),q.current!==void 0)){let e={current:{cell:q.current.cell,range:q.current.range,rangeStack:[]},rows:Ut.empty(),columns:Ut.empty()},t=Mn?.(e);if(t===!1||(e=t===!0?e:t,e.current===void 0))return;mi(e.current.range)}},[mi,q,fn.cut,wi,tr,Mn]),d,!1,!1);let Ei=K.useCallback((e,t)=>{if(se!==void 0){G!==0&&(e=e.map(e=>[e[0]-G,e[1]])),se(e,t);return}if(e.length===0||t===-1)return;let[n,r]=e[t];u.current!==void 0&&u.current[0]===n&&u.current[1]===r||(u.current=[n,r],di(n,r,!1,!1))},[se,G,di]),[Di,Oi]=Fe?.current?.cell??[],ki=K.useRef(Sr);ki.current=Sr,K.useLayoutEffect(()=>{ui.current&&!Qn.current&&Di!==void 0&&Oi!==void 0&&(Di!==Tn.current?.current?.cell[0]||Oi!==Tn.current?.current?.cell[1])&&ki.current(Di,Oi),Qn.current=!1},[Di,Oi]);let Ai=q.current!==void 0&&(q.current.cell[0]>=Xn.length||q.current.cell[1]>=sr);K.useLayoutEffect(()=>{Ai&&En(cc,!1)},[Ai,En]);let ji=K.useMemo(()=>hn===!0&&Ve?.tint===!0?Ut.fromSingleSelection(sr-1):Ut.empty(),[sr,hn,Ve?.tint]),Mi=K.useCallback(e=>typeof Ke==`boolean`?Ke:Ke?.(e-G)??!0,[G,Ke]),Ni=K.useMemo(()=>{if(Vr===void 0||s.current===null)return null;let{bounds:e,group:t}=Vr,n=s.current.getBoundingClientRect();return K.createElement(vs,{bounds:e,group:t,canvasBounds:n,onClose:()=>J(void 0),onFinish:e=>{J(void 0),oe?.(t,e)}})},[oe,Vr]),Pi=Math.min(Xn.length,z+ +!!mn);K.useImperativeHandle(t,()=>({appendRow:(e,t)=>Dr(e+G,t),appendColumn:(e,t)=>Or(e,t),updateCells:e=>(G!==0&&(e=e.map(e=>({cell:[e.cell[0]+G,e.cell[1]]}))),ar.current?.damage(e)),getBounds:(e,t)=>{if(!(s?.current===null||tr?.current===null)){if(e===void 0&&t===void 0){let e=s.current.getBoundingClientRect(),t=e.width/tr.current.clientWidth;return{x:e.x-tr.current.scrollLeft*t,y:e.y-tr.current.scrollTop*t,width:tr.current.scrollWidth*t,height:tr.current.scrollHeight*t}}return ar.current?.getBounds((e??0)+G,t)}},focus:()=>ar.current?.focus(),emit:async e=>{switch(e){case`delete`:xi({bounds:void 0,cancel:()=>void 0,stopPropagation:()=>void 0,preventDefault:()=>void 0,ctrlKey:!1,key:`Delete`,keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case`fill-right`:xi({bounds:void 0,cancel:()=>void 0,stopPropagation:()=>void 0,preventDefault:()=>void 0,ctrlKey:!0,key:`r`,keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case`fill-down`:xi({bounds:void 0,cancel:()=>void 0,stopPropagation:()=>void 0,preventDefault:()=>void 0,ctrlKey:!0,key:`d`,keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case`copy`:await wi(void 0,!0);break;case`paste`:await Ci();break}},scrollTo:Sr,remeasureColumns:e=>{for(let t of e)Ur(t+G)},getMouseArgsForPosition:(e,t,n)=>{if(ar?.current===null)return;let r=ar.current.getMouseArgsForPosition(e,t,n);if(r!==void 0)return{...r,location:[r.location[0]-G,r.location[1]]}}}),[Dr,Or,Ur,tr,wi,xi,Ci,G,Sr]);let[Fi,Ii]=Qr??[],Li=K.useCallback(e=>{let[t,n]=e;if(n===-1){F!==`none`&&(Fn(Ut.fromSingleSelection(t),void 0,!1),or());return}Fi===t&&Ii===n||(Nn({cell:e,range:{x:t,y:n,width:1,height:1}},!0,!1,`keyboard-nav`),Sr(t,n))},[F,or,Sr,Fi,Ii,Nn,Fn]),[Ri,zi]=K.useState(!1),Bi=K.useRef((0,Un.default)(e=>{zi(e)},5)),Vi=K.useCallback(()=>{Bi.current(!0),q.current===void 0&&q.columns.length===0&&q.rows.length===0&&c===void 0&&Nn({cell:[G,rr],range:{x:G,y:rr,width:1,height:1}},!0,!1,`keyboard-select`)},[rr,q,c,G,Nn]),Hi=K.useCallback(()=>{Bi.current(!1)},[]),[Ui,Wi]=K.useMemo(()=>{let e,t=et?.scrollbarWidthOverride??ir(),n=W+ +!!hn;if(typeof on==`number`)e=qn+n*on;else{let t=0,r=Math.min(n,10);for(let e=0;et.width+e,0)+t;return[`${Math.min(1e5,r)}px`,`${Math.min(1e5,e)}px`]},[Xn,et?.scrollbarWidthOverride,on,W,hn,qn]),Gi=K.useMemo(()=>Kt(In),[In]);return K.createElement(Jt.Provider,{value:In},K.createElement(Bs,{style:Gi,className:ne,inWidth:h??Ui,inHeight:g??Wi},K.createElement(gs,{fillHandle:$e,drawFocusRing:Ot,experimental:et,fixedShadowX:tt,fixedShadowY:nt,getRowThemeOverride:an,headerIcons:rt,imageWindowLoader:it,initialSize:at,isDraggable:ot,onDragLeave:st,onRowMoved:ct,overscrollX:un,overscrollY:dn,preventDiagonalScrolling:dt,rightElement:ft,rightElementProps:pt,smoothScrollX:ht,smoothScrollY:gt,className:ne,enableGroups:Kn,onCanvasFocused:Vi,onCanvasBlur:Hi,canvasRef:s,onContextMenu:Si,theme:In,cellXOffset:nr,cellYOffset:rr,accessibilityHeight:er.height,onDragEnd:ii,columns:Xn,nonGrowWidth:Hn,drawHeader:An,onColumnProposeMove:ei,drawCell:jn,disabledRows:ji,freezeColumns:Pi,lockColumns:G,firstColAccessible:G===0,getCellContent:_r,minColumnWidth:Gt,maxColumnWidth:qt,searchInputRef:o,showSearch:yn,onSearchClose:bn,highlightRegions:hr,getCellsForSelection:Sn,getGroupDetails:vr,headerHeight:sn,isFocused:Ri,groupHeaderHeight:Kn?cn:0,freezeTrailingRows:He+(hn&&Ve?.sticky===!0?1:0),hasAppendRow:hn,onColumnResize:Dn,onColumnResizeEnd:On,onColumnResizeStart:kn,onCellFocused:Li,onColumnMoved:ti,onDragStart:ri,onHeaderMenuClick:Zr,onHeaderIndicatorClick:X,onItemHovered:ci,isFilling:c?.fillHandle===!0,onMouseMove:Xr,onKeyDown:xi,onKeyUp:de,onMouseDown:Br,onMouseUp:Yr,onDragOverCell:qe,onDrop:Je,onSearchResultsChanged:Ei,onVisibleRegionChanged:$r,clientSize:Ln,rowHeight:on,searchResults:P,searchValue:le,onSearchValueChange:ce,rows:sr,scrollRef:tr,selection:q,translateX:er.tx,translateY:er.ty,verticalBorder:Mi,gridRef:ar,getCellRenderer:Bn,resizeIndicator:wt}),Ni,i!==void 0&&K.createElement(K.Suspense,{fallback:null},K.createElement(rc,{...i,validateCell:wn,bloom:D,id:pi,getCellRenderer:Bn,className:et?.isSubGrid===!0?`click-outside-ignore`:void 0,provideEditor:Be,imageEditorOverride:f,portalElementRef:Dt,onFinishEditing:fi,markdownDivCreateNode:m,isOutsideClick:St,customEventTarget:et?.eventTarget}))))});function uc(e){let{cell:t,posX:n,posY:r,bounds:i,theme:a}=e,{width:o,height:s,x:c,y:l}=i,u=t.maxSize??a.checkboxMaxSize,d=Math.floor(i.y+s/2),f=Xn(u,s,a.cellVerticalPadding),p=Jn(Yn(t.contentAlign??`center`,c,o,a.cellHorizontalPadding,f),d,f),m=Zn(c+n,l+r,p);return Rt(t)&&m}var dc={getAccessibilityString:e=>e.data?.toString()??`false`,kind:U.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>fc(e,e.cell.data,Rt(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{uc(e)&&e.preventDefault()},onClick:e=>{if(uc(e))return{...e.cell,data:Ls(e.cell.data)}},onPaste:(e,t)=>{let n=null;return e.toLowerCase()===`true`?n=!0:e.toLowerCase()===`false`?n=!1:e.toLowerCase()===`indeterminate`&&(n=void 0),n===t.data?void 0:{...t,data:n}}};function fc(e,t,n,r,i){if(!n&&t===null)return;let{ctx:a,hoverAmount:o,theme:s,rect:c,highlighted:l,hoverX:u,hoverY:d,cell:{contentAlign:f}}=e,{x:p,y:m,width:h,height:g}=c,_=!1;if(i>0){let e=n?1-i+i*o:.4;if(t===null&&(e*=o),e===0)return;e<1&&(_=!0,a.globalAlpha=e)}uo(a,s,t,p,m,h,g,l,u,d,r,f),_&&(a.globalAlpha=1)}var pc=an(`div`)({name:`BubblesOverlayEditorStyle`,class:`gdg-b1ygi5by`,propsAsIs:!1}),mc=e=>{let{bubbles:t}=e;return K.createElement(pc,null,t.map((e,t)=>K.createElement(`div`,{key:t,className:`boe-bubble`},e)),K.createElement(`textarea`,{className:`gdg-input`,autoFocus:!0}))},hc={getAccessibilityString:e=>sr(e.data),kind:U.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{let r=t.data.reduce((t,r)=>e.measureText(r).width+t+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>gc(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return K.createElement(mc,{bubbles:t.data})},onPaste:()=>void 0};function gc(e,t){let{rect:n,theme:r,ctx:i,highlighted:a}=e,{x:o,y:s,width:c,height:l}=n,u=o+r.cellHorizontalPadding,d=[];for(let e of t){if(u>o+c)break;let t=Pi(e,i,r.baseFontFull).width;d.push({x:u,width:t}),u+=t+r.bubblePadding*2+r.bubbleMargin}i.beginPath();for(let e of d)Ji(i,e.x,s+(l-r.bubbleHeight)/2,e.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);i.fillStyle=a?r.bgBubbleSelected:r.bgBubble,i.fill();for(let[e,n]of d.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[e],n.x+r.bubblePadding,s+l/2+Ii(i,r))}var _c=an(`div`)({name:`DrilldownOverlayEditorStyle`,class:`gdg-d4zsq0x`,propsAsIs:!1}),vc=e=>{let{drilldowns:t}=e;return K.createElement(_c,null,t.map((e,t)=>K.createElement(`div`,{key:t,className:`doe-bubble`},e.img!==void 0&&K.createElement(`img`,{src:e.img}),K.createElement(`div`,null,e.text))))},yc={getAccessibilityString:e=>sr(e.data.map(e=>e.text)),kind:U.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((t,r)=>e.measureText(r.text).width+t+n.bubblePadding*2+n.bubbleMargin+(r.img===void 0?0:18),0)+2*n.cellHorizontalPadding-4,draw:e=>Sc(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return K.createElement(vc,{drilldowns:t.data})},onPaste:()=>void 0},bc={};function xc(e,t,n,r){let i=Math.ceil(window.devicePixelRatio),a=n-10,o=n*i,s=r+5,c=r*3,l=(c+10)*i,u=`${e},${t},${i},${n}`;if(bc[u]!==void 0)return{el:bc[u],height:o,width:l,middleWidth:4*i,sideWidth:s*i,padding:5*i,dpr:i};let d=document.createElement(`canvas`),f=d.getContext(`2d`);return f===null?null:(d.width=l,d.height=o,f.scale(i,i),bc[u]=d,f.beginPath(),Ji(f,5,5,c,a,r),f.shadowColor=`rgba(24, 25, 34, 0.4)`,f.shadowBlur=1,f.fillStyle=e,f.fill(),f.shadowColor=`rgba(24, 25, 34, 0.3)`,f.shadowOffsetY=1,f.shadowBlur=5,f.fillStyle=e,f.fill(),f.shadowOffsetY=0,f.shadowBlur=0,f.shadowBlur=0,f.beginPath(),Ji(f,5.5,5.5,c,a,r),f.strokeStyle=t,f.lineWidth=1,f.stroke(),{el:d,height:o,width:l,sideWidth:s*i,middleWidth:r*i,padding:5*i,dpr:i})}function Sc(e,t){let{rect:n,theme:r,ctx:i,imageLoader:a,col:o,row:s}=e,{x:c,width:l}=n,u=r.baseFontFull,d=Wi(i,u),f=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),p=Math.floor(n.y+(n.height-f)/2),m=f-10,h=r.bubblePadding,g=r.bubbleMargin,_=c+r.cellHorizontalPadding,v=r.roundingRadius??6,y=xc(r.bgCell,r.drilldownBorder,f,v),b=[];for(let e of t){if(_>c+l)break;let t=Pi(e.text,i,u).width,n=0;e.img!==void 0&&a.loadOrGetImage(e.img,o,s)!==void 0&&(n=m-8+4);let r=t+n+h*2;b.push({x:_,width:r}),_+=r+g}if(y!==null){let{el:e,height:t,middleWidth:n,sideWidth:r,width:a,dpr:o,padding:s}=y,c=r/o,l=s/o;for(let o of b){let s=Math.floor(o.x),u=Math.floor(o.width),d=u-(c-l)*2;i.imageSmoothingEnabled=!1,i.drawImage(e,0,0,r,t,s-l,p,c,f),d>0&&i.drawImage(e,r,0,n,t,s+(c-l),p,d,f),i.drawImage(e,a-r,0,r,t,s+u-(c-l),p,c,f),i.imageSmoothingEnabled=!0}}i.beginPath();for(let[e,n]of b.entries()){let c=t[e],l=n.x+h;if(c.img!==void 0){let e=a.loadOrGetImage(c.img,o,s);if(e!==void 0){let t=m-8,n=0,a=0,o=e.width,s=e.height;o>s?(n+=(o-s)/2,o=s):s>o&&(a+=(s-o)/2,s=o),i.beginPath(),Ji(i,l,p+f/2-t/2,t,t,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(e,n,a,o,s,l,p+f/2-t/2,t,t),i.restore(),l+=t+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(c.text,l,p+f/2+Ii(i,r))}}var Cc={getAccessibilityString:e=>e.data.join(`, `),kind:U.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Tc(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{let{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,i=r??ur;return K.createElement(i,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:e=>{n({...t,data:[e]})}})},onPaste:(e,t)=>{e=e.trim();let n=e.split(`,`).map(e=>{try{return new URL(e),e}catch{return}}).filter(e=>e!==void 0);if(!(n.length===t.data.length&&n.every((e,n)=>e===t.data[n])))return{...t,data:n}}},wc=4;function Tc(e,t,n,r){let{rect:i,col:a,row:o,theme:s,ctx:c,imageLoader:l}=e,{x:u,y:d,height:f,width:p}=i,m=f-s.cellVerticalPadding*2,h=[],g=0;for(let e=0;e0&&(c.beginPath(),Ji(c,_,d+s.cellVerticalPadding,t,m,n),c.save(),c.clip()),c.drawImage(e,_,d+s.cellVerticalPadding,t,m),n>0&&c.restore(),_+=t+wc}}function Ec(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}var Dc={getAccessibilityString:()=>``,kind:U.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{let{cell:t,col:n,row:r,ctx:i,rect:a,theme:o}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(Ec(n,r)*t.skeletonWidthVariability));let c=o.cellHorizontalPadding;s+c*2>=a.width&&(s=a.width-c*2-1);let l=t.skeletonHeight??Math.min(18,a.height-2*o.cellVerticalPadding);Ji(i,a.x+c,a.y+(a.height-l)/2,s,l,o.roundingRadius??3),i.fillStyle=Ht(o.textDark,.1),i.fill()},onPaste:()=>void 0},Oc=an(`div`)({name:`MarkdownOverlayEditorStyle`,class:`gdg-m1pnx84e`,propsAsIs:!1,vars:{"m1pnx84e-0":[e=>e.targetWidth,`px`]}}),kc=e=>{let{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:a,onFinish:o,validatedSelection:s}=e,c=t.data,l=t.readonly===!0,[u,d]=K.useState(c===``||r),f=K.useCallback(()=>{d(e=>!e)},[]),p=c?`gdg-ml-6`:``;return u?K.createElement(Oc,{targetWidth:a.width-20},K.createElement(ii,{autoFocus:!0,highlight:!1,validatedSelection:s,value:c,onKeyDown:e=>{e.key===`Enter`&&e.stopPropagation()},onChange:n}),K.createElement(`div`,{className:`gdg-edit-icon gdg-checkmark-hover ${p}`,onClick:()=>o(t)},K.createElement($n,null))):K.createElement(Oc,{targetWidth:a.width},K.createElement($r,{contents:c,createNode:i}),!l&&K.createElement(K.Fragment,null,K.createElement(`div`,{className:`spacer`}),K.createElement(`div`,{className:`gdg-edit-icon gdg-edit-hover ${p}`,onClick:f},K.createElement(Qn,null))),K.createElement(`textarea`,{className:`gdg-md-edit-textarea gdg-input`,autoFocus:!0}))},Ac={getAccessibilityString:e=>e.data?.toString()??``,kind:U.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Vi,measure:(e,t,n)=>{let r=t.data.split(` +`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>qi(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:``}),provideEditor:()=>e=>{let{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:a,forceEditMode:o,validatedSelection:s}=e;return K.createElement(kc,{onFinish:i,targetRect:r,value:n,validatedSelection:s,onChange:e=>t({...n,data:e.target.value}),forceEditMode:o,createNode:a})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},jc={getAccessibilityString:e=>e.row.toString(),kind:Wt.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Mc,measure:()=>44,draw:e=>Pc(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{let{bounds:t,cell:n,posX:r,posY:i}=e,{width:a,height:o}=t,s=n.drawHandle?7+(a-7)/2:a/2,c=o/2;if(Math.abs(r-s)<=10&&Math.abs(i-c)<=10)return{...n,checked:!n.checked}},onPaste:()=>void 0};function Mc(e,t){let{ctx:n,theme:r}=e,i=r.markerFontFull,a=t??{};return a?.font!==i&&(n.font=i,a.font=i),a.deprep=Nc,n.textAlign=`center`,a}function Nc(e){let{ctx:t}=e;t.textAlign=`start`}function Pc(e,t,n,r,i,a){let{ctx:o,rect:s,hoverAmount:c,theme:l}=e,{x:u,y:d,width:f,height:p}=s,m=n?1:r===`checkbox-visible`?.6+.4*c:c;if(r!==`number`&&m>0){o.globalAlpha=m;let e=7*(n?c:1);if(uo(o,l,n,i?u+e:u,d,i?f-e:f,p,!0,void 0,void 0,l.checkboxMaxSize,`center`,a),i){o.globalAlpha=c,o.beginPath();for(let e of[3,6])for(let t of[-5,-1,3])o.rect(u+e,d+p/2+t,2,2);o.fillStyle=l.textLight,o.fill(),o.beginPath()}o.globalAlpha=1}if(r===`number`||r===`both`&&!n){let e=t.toString(),n=l.markerFontFull,i=u+f/2;r===`both`&&c!==0&&(o.globalAlpha=1-c),o.fillStyle=l.textLight,o.font=n,o.fillText(e,i,d+p/2+Ii(o,n)),c!==0&&(o.globalAlpha=1)}}var Fc={getAccessibilityString:()=>``,kind:Wt.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Ic(e,e.cell.hint,e.cell.icon),onPaste:()=>void 0};function Ic(e,t,n){let{ctx:r,rect:i,hoverAmount:a,theme:o,spriteManager:s}=e,{x:c,y:l,width:u,height:d}=i;r.beginPath(),r.globalAlpha=a,r.rect(c+1,l+1,u,d-2),r.fillStyle=o.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();let f=t!==``,p=0;if(n!==void 0){let e=d-8,t=c+8/2,i=l+8/2;s.drawSprite(n,`normal`,r,t,i,e,o,f?1:a),p=e}else{p=24;let e=f?12:a*12,t=f?0:(1-a)*12*.5,n=o.cellHorizontalPadding+4;e>0&&(r.moveTo(c+n+t,l+d/2),r.lineTo(c+n+t+e,l+d/2),r.moveTo(c+n+t+e*.5,l+d/2-e*.5),r.lineTo(c+n+t+e*.5,l+d/2+e*.5),r.lineWidth=2,r.strokeStyle=o.bgIconHeader,r.lineCap=`round`,r.stroke())}r.fillStyle=o.textMedium,r.fillText(t,p+c+o.cellHorizontalPadding+.5,l+d/2+Ii(r,o)),r.beginPath()}function Lc(e,t,n,r,i,a,o){e.textBaseline=`alphabetic`;let s=Rc(e,i,r,t,n?.fullSize??!1);e.beginPath(),Ji(e,s.x,s.y,s.width,s.height,t.roundingRadius??4),e.globalAlpha=a,e.fillStyle=n?.bgColor??Ht(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline=`middle`,o?.(`text`)}function Rc(e,t,n,r,i){let a=r.cellHorizontalPadding,o=r.cellVerticalPadding;if(i)return{x:t.x+a/2,y:t.y+o/2+1,width:t.width-a,height:t.height-o-1};let s=Pi(n,e,r.baseFontFull,`alphabetic`),c=t.height-o,l=Math.min(c,s.actualBoundingBoxAscent*2.5);return{x:t.x+a/2,y:t.y+(t.height-l)/2+1,width:s.width+a*3,height:l-1}}var zc=K.lazy(async()=>await Be(()=>import(`./number-overlay-editor.B2gNG5Q4.js`),__vite__mapDeps([7,1,2,6]),import.meta.url)),Bc={getAccessibilityString:e=>e.data?.toString()??``,kind:U.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:Vi,draw:e=>{let{hoverAmount:t,cell:n,ctx:r,theme:i,rect:a,overrideCursor:o}=e,{hoverEffect:s,displayData:c,hoverEffectTheme:l}=n;s===!0&&t>0&&Lc(r,i,l,c,a,t,o),qi(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{let{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return K.createElement(K.Suspense,{fallback:null},K.createElement(zc,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:e=>n({...r,data:Number.isNaN(e.floatValue??0)?0:e.floatValue})}))},onPaste:(e,t,n)=>{let r=typeof n.rawValue==`number`?n.rawValue:Number.parseFloat(typeof n.rawValue==`string`?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},Vc={getAccessibilityString:()=>``,measure:()=>108,kind:U.Protected,needsHover:!1,needsHoverPosition:!1,draw:Hc,onPaste:()=>void 0};function Hc(e){let{ctx:t,theme:n,rect:r}=e,{x:i,y:a,height:o}=r;t.beginPath();let s=2.5,c=i+n.cellHorizontalPadding+s,l=a+o/2,u=Math.cos(qn(30))*s,d=Math.sin(qn(30))*s;for(let e=0;e<12;e++)t.moveTo(c,l-s),t.lineTo(c,l+s),t.moveTo(c+u,l-d),t.lineTo(c-u,l+d),t.moveTo(c-u,l-d),t.lineTo(c+u,l+d),c+=8;t.lineWidth=1.1,t.lineCap=`square`,t.strokeStyle=n.textLight,t.stroke()}var Uc={getAccessibilityString:e=>e.data?.toString()??``,kind:U.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Vi(e,t,e.theme.textLight),draw:e=>qi(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{let{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return K.createElement(ii,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:e=>n({...r,data:e.target.value})})},onPaste:()=>void 0},Wc={getAccessibilityString:e=>e.data?.toString()??``,kind:U.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Vi,useLabel:!0,draw:e=>{let{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:a,theme:o,overrideCursor:s}=e,{displayData:c,contentAlign:l,hoverEffect:u,allowWrapping:d,hoverEffectTheme:f}=t;u===!0&&n>0&&Lc(i,o,f,c,a,n,s),qi(e,c,l,d,r)},measure:(e,t,n)=>{let r=t.displayData.split(` +`,t.allowWrapping===!0?void 0:1),i=0;for(let t of r)i=Math.max(i,e.measureText(t).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:``}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{let{isHighlighted:n,onChange:r,value:i,validatedSelection:a}=t;return K.createElement(ii,{style:e.allowWrapping===!0?{padding:`3px 8.5px`}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:a,onChange:e=>r({...i,data:e.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Gc=an(`div`)({name:`UriOverlayEditorStyle`,class:`gdg-u1rrojo`,propsAsIs:!1}),Kc=e=>{let{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:a,preview:o}=e,[s,c]=K.useState(!i&&(t===``||r)),l=K.useCallback(()=>{c(!0)},[]);return s?K.createElement(ii,{validatedSelection:a,highlight:!0,autoFocus:!0,value:t,onChange:n}):K.createElement(Gc,null,K.createElement(`a`,{className:`gdg-link-area`,href:t,target:`_blank`,rel:`noopener noreferrer`},o),!i&&K.createElement(`div`,{className:`gdg-edit-icon`,onClick:l},K.createElement(Qn,null)),K.createElement(`textarea`,{className:`gdg-input`,autoFocus:!0}))};function qc(e,t,n,r){let i=n.cellHorizontalPadding,a=t.height/2-e.actualBoundingBoxAscent/2,o=e.width,s=e.actualBoundingBoxAscent;return r===`right`?i=t.width-o-n.cellHorizontalPadding:r===`center`&&(i=t.width/2-o/2),{x:i,y:a,width:o,height:s}}function Jc(e){let{cell:t,bounds:n,posX:r,posY:i,theme:a}=e,o=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;let s=Fi(o,a.baseFontFull);if(s===void 0)return!1;let c=qc(s,n,a,t.contentAlign);return Za({x:c.x-4,y:c.y-4,width:c.width+8,height:c.height+8},r,i)}var Yc=[jc,Fc,dc,hc,yc,Cc,Dc,Ac,Bc,Vc,Uc,Wc,{getAccessibilityString:e=>e.data?.toString()??``,kind:U.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:Vi,draw:e=>{let{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:a,rect:o,ctx:s}=e,c=t.displayData??t.data,l=t.hoverEffect===!0;if(r!==void 0&&l&&i!==void 0&&a!==void 0){let{x:l,y:u,width:d,height:f}=qc(Pi(c,s,n.baseFontFull),o,n,t.contentAlign);if(i>=l-4&&i<=l-4+d+8&&a>=u-4&&a<=u-4+f+8){let i=Ii(s,n.baseFontFull);r(`pointer`);let a=u-i;s.beginPath(),s.moveTo(o.x+l,Math.floor(o.y+a+f+5)+.5),s.lineTo(o.x+l+d,Math.floor(o.y+a+f+5)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,qi({...e,rect:{...o,x:o.x-1}},c,t.contentAlign),qi({...e,rect:{...o,x:o.x-2}},c,t.contentAlign),qi({...e,rect:{...o,x:o.x+1}},c,t.contentAlign),qi({...e,rect:{...o,x:o.x+2}},c,t.contentAlign),s.restore()}}s.fillStyle=l?n.linkColor:n.textDark,qi(e,c,t.contentAlign)},onSelect:e=>{Jc(e)&&e.preventDefault()},onClick:e=>{let{cell:t}=e;Jc(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:``}),provideEditor:e=>t=>{let{onChange:n,value:r,forceEditMode:i,validatedSelection:a}=t;return K.createElement(Kc,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:a,readonly:r.readonly===!0,onChange:e=>n({...r,data:e.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}}],Xc=t(r(((e,t)=>{var n=Hn(),r=lt(),i=`Expected a function`;function a(e,t,a){var o=!0,s=!0;if(typeof e!=`function`)throw TypeError(i);return r(a)&&(o=`leading`in a?!!a.leading:o,s=`trailing`in a?!!a.trailing:s),n(e,t,{leading:o,maxWait:t,trailing:s})}t.exports=a}))(),1),Zc=[],Qc=class extends ra{imageLoaded=()=>void 0;loadedLocations=[];cache={};setCallback(e){this.imageLoaded=e}sendLoaded=(0,Xc.default)(()=>{this.imageLoaded(new aa(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{let e=Object.keys(this.cache);for(let t of e){let e=this.cache[t],n=!1;for(let t=0;t{o||(o=!0,Zc.length<12?Zc.unshift(a):i||(a.src=``))}},c=new Promise(e=>a.addEventListener(`load`,()=>e(null)));requestAnimationFrame(async()=>{try{a.src=e,await c,await a.decode();let t=this.cache[r];if(t!==void 0&&!o){t.img=a;for(let e of t.cells)this.loadedLocations.push(na(e));i=!0,this.sendLoaded()}}catch{s.cancel()}}),this.cache[r]=s}loadOrGetImage(e,t,n){let r=e,i=this.cache[r];if(i!==void 0){let e=$i(t,n);return i.cells.includes(e)||i.cells.push(e),i.img}else this.loadImage(e,t,n,r)}},$c=K.forwardRef((e,t)=>{let n=K.useMemo(()=>({...Va,...e.headerIcons}),[e.headerIcons]),r=K.useMemo(()=>e.renderers??Yc,[e.renderers]),i=K.useMemo(()=>e.imageWindowLoader??new Qc,[e.imageWindowLoader]);return K.createElement(lc,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})});function el(e,t){let n=(0,K.useRef)(),r=(0,K.useRef)(e);(0,K.useEffect)(()=>{r.current=e},[e]);let{clear:i,restart:a}=Ue(()=>{n.current&&=(r.current(...n.current),void 0)},t,{autoStart:!1}),o=(0,K.useCallback)(()=>{i(),n.current=void 0},[i]);return{debouncedCallback:(0,K.useCallback)((...e)=>{n.current=e,a()},[a]),cancel:o}}var tl=r(((t,n)=>{(function(r,i){if(typeof define==`function`&&define.amd)define([`moment`],i);else if(typeof t==`object`)try{n.exports=i((on(),e(sn)))}catch{n.exports=i}r&&(r.momentDurationFormatSetup=r.moment?i(r.moment):i)})(t,function(e){var t=!1,n=!1,r=!1,i=!1,a=`escape years months weeks days hours minutes seconds milliseconds general`.split(` `),o=[{type:`seconds`,targets:[{type:`minutes`,value:60},{type:`hours`,value:3600},{type:`days`,value:86400},{type:`weeks`,value:604800},{type:`months`,value:2678400},{type:`years`,value:31536e3}]},{type:`minutes`,targets:[{type:`hours`,value:60},{type:`days`,value:1440},{type:`weeks`,value:10080},{type:`months`,value:44640},{type:`years`,value:525600}]},{type:`hours`,targets:[{type:`days`,value:24},{type:`weeks`,value:168},{type:`months`,value:744},{type:`years`,value:8760}]},{type:`days`,targets:[{type:`weeks`,value:7},{type:`months`,value:31},{type:`years`,value:365}]},{type:`months`,targets:[{type:`years`,value:12}]}];function s(e,t){return t.length>e.length?!1:e.indexOf(t)!==-1}function c(e){for(var t=``;e;)t+=`0`,--e;return t}function l(e){for(var t=e.split(``).reverse(),n=0,r=!0;r&&n0&&(v.maximumSignificantDigits=p),r){if(!i){var y=O({},t);y.useGrouping=!1,y.decimalSeparator=`.`,e=parseFloat(d(e,y),10)}return u(a,v).format(e)}else{if(!n){var y=O({},t);y.useGrouping=!1,y.decimalSeparator=`.`,e=parseFloat(d(e,y),10)}return e.toLocaleString(a,v)}}var b=p?e.toPrecision(p+1):e.toFixed(h+1),x,S,C,w=b.split(`e`);C=w[1]||``,w=w[0].split(`.`),S=w[1]||``,x=w[0]||``;var T=x.length,E=S.length,D=T+E,k=x+S;(p&&D===p+1||!p&&E===h+1)&&(k=l(k),k.length===D+1&&(T+=1),E&&(k=k.slice(0,-1)),x=k.slice(0,T),S=k.slice(T)),p&&(S=S.replace(/0*$/,``));var A=parseInt(C,10);A>0?S.length<=A?(S+=c(A-S.length),x+=S,S=``):(x+=S.slice(0,A),S=S.slice(A)):A<0&&(S=c(Math.abs(A)-x.length)+x+S,x=`0`),p||(S=S.slice(0,h),S.lengtht.label.length?-1:+(e.label.length0,me=pe?i.precision:0,he=me,ge=i.minValue,_e=!1,ve=i.maxValue,ye=!1,F=i.useToLocaleString,be=i.groupingSeparator,xe=i.decimalSeparator,Se=i.grouping;F&&=t||r;var I=i.trim;g(I)&&(I=I.join(` `)),I===null&&(oe||ve||pe)&&(I=`all`),(I===null||I===!0||I===`left`||I===`right`)&&(I=`large`),I===!1&&(I=``);var Ce=function(e){return e.test(I)},L=/large/,we=/small/,R=/both/,Te=/mid/,z=/^all|[^sm]all/,B=/final/,Ee=oe>0||A([L,R,z],Ce),De=A([we,R,z],Ce),Oe=A([Te,z],Ce),V=A([B,z],Ce),ke=x(re.match(ne),function(e,t){var n=te(e);return e.slice(0,1)===`*`&&(e=e.slice(1),n!==`escape`&&n!==`general`&&M.push(n)),{index:t,length:e.length,text:``,token:n===`escape`?e.replace(ee.escape,`$1`):e,type:n===`escape`||n===`general`?null:n}}),Ae={index:0,length:0,token:``,text:``,type:null},je=[];P&&ke.reverse(),b(ke,function(e){if(e.type){(Ae.type||Ae.text)&&je.push(Ae),Ae=e;return}P?Ae.text=e.token+Ae.text:Ae.text+=e.token}),(Ae.type||Ae.text)&&je.push(Ae),P&&je.reverse();var H=T(a,w(C(S(je,`type`))));if(!H.length)return S(je,`text`).join(``);H=x(H,function(e,t){var n=t+1===H.length,r=!t,a=e===`years`||e===`months`?v.as(e):m.as(e),o=Math.floor(a),s=a-o,c=y(je,function(t){return e===t.type});return r&&ve&&a>ve&&(ye=!0),n&&ge&&Math.abs(i.duration.as(e))1&&(ue=!0),m.subtract(o,e),v.subtract(o,e),{rawValue:a,wholeValue:o,decimalValue:n?s:0,isSmallest:n,isLargest:r,type:e,tokenLength:c.length}});var Me=fe?Math.floor:Math.round,Ne=function(e,t){var n=10**t;return Me(e*n)/n},Pe=!1,Fe=!1,Ie=function(e,t){var n={useGrouping:de,groupingSeparator:be,decimalSeparator:xe,grouping:Se,useToLocaleString:F};return pe&&(me<=0?(e.rawValue=0,e.wholeValue=0,e.decimalValue=0):(n.maximumSignificantDigits=me,e.significantDigits=me)),ye&&!Fe&&(e.isLargest?(e.wholeValue=ve,e.decimalValue=0):(e.wholeValue=0,e.decimalValue=0)),_e&&!Fe&&(e.isSmallest?(e.wholeValue=ge,e.decimalValue=0):(e.wholeValue=0,e.decimalValue=0)),e.isSmallest||e.significantDigits&&e.significantDigits-e.wholeValue.toString().length<=0?le<0?e.value=Ne(e.wholeValue,le):le===0?e.value=Me(e.wholeValue+e.decimalValue):pe?(fe?e.value=Ne(e.rawValue,me-e.wholeValue.toString().length):e.value=e.rawValue,e.wholeValue&&(me-=e.wholeValue.toString().length)):(n.fractionDigits=le,fe?e.value=e.wholeValue+Ne(e.decimalValue,le):e.value=e.wholeValue+e.decimalValue):pe&&e.wholeValue?(e.value=Math.round(Ne(e.wholeValue,e.significantDigits-e.wholeValue.toString().length)),me-=e.wholeValue.toString().length):e.value=e.wholeValue,e.tokenLength>1&&(ue||Pe)&&(n.minimumIntegerDigits=e.tokenLength,Fe&&n.maximumSignificantDigits0||I===``||y(M,e.type)||y(ie,e.type))&&(Pe=!0),e.formattedValue=d(e.value,n,se),n.useGrouping=!1,n.decimalSeparator=`.`,e.formattedValueEn=d(e.value,n,`en`),e.tokenLength===2&&e.type===`milliseconds`&&(e.formattedValueMS=d(e.value,{minimumIntegerDigits:3,useGrouping:!1},`en`).slice(0,2)),e};if(H=x(H,Ie),H=C(H),H.length>1){var Le=function(e){return y(H,function(t){return t.type===e})};b(o,function(e){var t=Le(e.type);t&&b(e.targets,function(e){var n=Le(e.type);n&&parseInt(t.formattedValueEn,10)===e.value&&(t.rawValue=0,t.wholeValue=0,t.decimalValue=0,n.rawValue+=1,n.wholeValue+=1,n.decimalValue=0,n.formattedValueEn=n.wholeValue.toString(),Fe=!0)})})}return Fe&&(Pe=!1,me=he,H=x(H,Ie),H=C(H)),ie&&!(ye&&!i.trim)?(H=x(H,function(e){return y(ie,function(t){return e.type===t})?e:null}),H=C(H)):(Ee&&(H=E(H,function(e){return!e.isSmallest&&!e.wholeValue&&!y(M,e.type)})),oe&&H.length&&(H=H.slice(0,oe)),De&&H.length>1&&(H=D(H,function(e){return!e.wholeValue&&!y(M,e.type)&&!e.isLargest})),Oe&&(H=x(H,function(e,t){return t>0&&t `,ye=!1,_e=!1),u&&(t.value>0||I===``||y(M,t.type)||y(ie,t.type))&&(n+=`-`,u=!1),e.type===`milliseconds`&&t.formattedValueMS?n+=t.formattedValueMS:n+=t.formattedValue,P||(n+=e.text),n}),je.join(``).replace(/(,| |:|\.)*$/,``).replace(/^(,| |:|\.)*/,``))}function ae(){var e=this.duration,t=function(t){return e._data[t]},n=y(this.types,t),r=v(this.types,t);switch(n){case`milliseconds`:return`S __`;case`seconds`:case`minutes`:return`*_MS_`;case`hours`:return`_HMS_`;case`days`:if(n===r)return`d __`;case`weeks`:return n===r?`w __`:(this.trim===null&&(this.trim=`both`),`w __, d __, h __`);case`months`:if(n===r)return`M __`;case`years`:return n===r?`y __`:(this.trim===null&&(this.trim=`both`),`y __, M __, d __`);default:return this.trim===null&&(this.trim=`both`),`y __, d __, h __, m __, s __`}}function oe(e){if(!e)throw`Moment Duration Format init cannot find moment instance.`;e.duration.format=re,e.duration.fn.format=ie,e.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:ae,useToLocaleString:!0,groupingSeparator:`,`,decimalSeparator:`.`,grouping:[3]},e.updateLocale(`en`,h)}var M=function(e,t,n){return e.toLocaleString(t,n)};t=ee()&&ne(M),n=t&&te(M);var N=function(e,t,n){if(typeof window<`u`&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(t,n).format(e)};return r=ne(N),i=r&&te(N),oe(e),oe})}));on(),tl();var nl=t(ne(),1),rl=[`true`,`t`,`yes`,`y`,`on`,`1`],il=[`false`,`f`,`no`,`n`,`off`,`0`];function al(e,t=``){return{kind:U.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:`faded`}}function ol(e){return Object.hasOwn(e,`isError`)&&e.isError}function sl(e){return Object.hasOwn(e,`tooltip`)&&e.tooltip!==``}function cl(e){return Object.hasOwn(e,`isMissingValue`)&&e.isMissingValue}function ll(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:e.length===t.length&&e.every((e,n)=>e===t[n])}function ul(e,t,n){if(w(e)&&w(t))return!0;if(w(e)||w(t))return!1;if(n.valuesEqual)try{return n.valuesEqual(e,t)}catch{return Object.is(e,t)}return Object.is(e,t)}function dl(e=!1){return e?{kind:U.Loading,allowOverlay:!1,isMissingValue:!0,copyData:``}:{kind:U.Loading,allowOverlay:!1,copyData:``}}function fl(e,t){let n=t?`faded`:`normal`;return{kind:U.Text,data:``,displayData:``,allowOverlay:!0,readonly:e,style:n}}function pl(e){return{id:e.id,title:e.title,hasMenu:!1,menuIcon:`dots`,themeOverride:e.themeOverride,icon:e.icon,group:e.group,...e.isStretched&&!e.isPinned&&{grow:1},...e.width&&{width:e.width}}}function ml(e,t){return w(e)?t||{}:w(t)?e||{}:D(e,t)}function hl(e){if(w(e))return[];if(typeof e==`number`||typeof e==`boolean`)return[e];if(typeof e==`string`){if(e===``)return[];if(e.trim().startsWith(`[`)&&e.trim().endsWith(`]`))try{return JSON.parse(e)}catch{return[e]}else return e.split(`,`)}try{let t=JSON.parse(JSON.stringify(e,(e,t)=>typeof t==`bigint`?Number(t):t));return Array.isArray(t)?t.map(e=>[`string`,`number`,`boolean`,`null`].includes(typeof e)?e:$(e)):[$(t)]}catch{return[$(e)]}}function gl(e){return typeof e==`string`||e instanceof String?!0:(e instanceof St&&(e=Array.from(e)),Array.isArray(e)&&e.every(e=>typeof e==`string`||e instanceof String))}function _l(e){return typeof e==`string`&&e.startsWith(`{`)&&e.endsWith(`}`)}function $(e){try{try{return E(e)}catch{return JSON.stringify(e,(e,t)=>typeof t==`bigint`?Number(t):t)}}catch{return`[${typeof e}]`}}function vl(e){if(w(e))return null;if(typeof e==`boolean`)return e;let t=$(e).toLowerCase().trim();if(t===``)return null;if(rl.includes(t))return!0;if(il.includes(t))return!1}function yl(e){if(w(e))return null;if(Array.isArray(e))return NaN;if(typeof e==`string`){if(e.trim().length===0)return null;try{let t=ln.unformat(e.trim());if(C(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function bl(e){return w(e)?``:$(e.map(e=>typeof e==`string`&&e.includes(`,`)?e.replace(/,/g,` `):e))}function xl(e){if(w(e))return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,(e,t)=>typeof t==`bigint`?Number(t):t)}catch{return $(e)}}function Sl(e){if(w(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if(typeof e==`string`&&e.trim().length===0)return null;try{let t=Number(e);if(!isNaN(t)){let e=t;t>=10**18?e=t/1e3**3:t>=10**15?e=t/1e3**2:t>=10**12&&(e=t/1e3);let n=cn.unix(e).utc();if(n.isValid())return n.toDate()}if(typeof e==`string`){let t=cn.utc(e);if(t.isValid())return t.toDate();let n=cn.utc(e,[cn.HTML5_FMT.TIME_MS,cn.HTML5_FMT.TIME_SECONDS,cn.HTML5_FMT.TIME]);if(n.isValid())return n.toDate()}}catch{return}}function Cl(e){if(e%1==0)return 0;let t=e.toString();return t.indexOf(`e`)!==-1&&(t=e.toLocaleString(`fullwide`,{useGrouping:!1,maximumFractionDigits:20})),t.indexOf(`.`)===-1?0:t.split(`.`)[1].length}function wl(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);let n=10**t,r=e*n,i=2**-52*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*i)/n}var Tl=new RegExp(/(\r\n|\n|\r)/gm);function El(e){return e.indexOf(` +`)===-1?e:e.replace(Tl,` `)}function Dl(e,t){if(w(t))return``;try{let n=t.match(e);return n?.[1]===void 0?t:decodeURIComponent(n[1].replace(/\+/g,`%20`))}catch{return t}}function Ol(e){let t=(e.columnTypeOptions||{}).button_type??`secondary`,n={kind:U.Custom,allowOverlay:!1,copyData:``,readonly:!0,data:{kind:`button-cell`,data:null,buttonType:t,alignment:e.contentAlignment}};return{...e,kind:`button`,typeIcon:`:material/smart_button:`,sortMode:`default`,isEditable:!1,getCell(e){if(w(e))return{...n,data:{...n.data,data:null}};let t;if(typeof e==`string`&&!(e.trim().startsWith(`[`)&&e.trim().endsWith(`]`)))t=e;else{let n=hl(e).map(e=>$(e));t=n.length===1?n[0]:n}return{...n,copyData:Array.isArray(t)?t.join(`, `):t,data:{...n.data,data:t}}},getCellValue(e){return e.data.data}}}Ol.isEditableType=!1;var kl=20,Al=7,jl=20,Ml=4;function Nl(e){return Math.max(Ml,e/2)}function Pl(e){return`${e.baseFontStyle} ${e.fontFamily}`}function Fl(e){let{icon:t,text:n}=V(e);return t&&ke(t)?{icon:Oe(t).icon,text:n.trim()}:{icon:null,text:e}}function Il(e,t,n){let r=`${n.baseFontStyle} '${f.iconFont}'`,i=Nl(n.cellHorizontalPadding);if(!t)return e.font=r,e.measureText(`more_vert`).width;let{icon:a,text:o}=Fl(t),s=0;return a&&(e.font=r,s+=e.measureText(a).width,o&&(s+=i)),o&&(e.font=Pl(n),s+=e.measureText(o).width),s}var Ll;function Rl(e){return e===void 0?(Ll===void 0&&(Ll=typeof document>`u`?null:document.createElement(`canvas`).getContext(`2d`)),Ll??void 0):e}function zl(e,t,n){if(t)return kl;if(!e)return 0;let{icon:r,text:i}=Fl(e);return i.length*Al+(r?jl:0)+(r&&i?Nl(n.cellHorizontalPadding):0)}function Bl(e,t,n,r){let i=Rl(r);return i?Il(i,e,n):zl(e,t,n)}function Vl(e){return typeof e==`string`?e:Array.isArray(e)&&e.length===1?e[0]:null}var Hl={left:(e,t)=>t,center:(e,t,n)=>(e-n)/2,right:(e,t,n)=>e-n-t};function Ul(e,t,n,r,i=`center`){let a=r+n*2,o=Math.floor(n*.5),s=Math.ceil(t-o*2);return{x:Hl[i](e,n,a),y:o,width:a,height:s}}function Wl(e,t,n){return t===void 0||n===void 0?!1:t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Gl(e){return e.kind===U.Custom&&e.data?.kind===`button-cell`}function Kl(e,{bounds:t,posX:n,posY:r,theme:i,measureContext:a}){let{data:o,alignment:s}=e.data;if(!o)return;let c=Vl(o),l=Array.isArray(o)&&o.length>1;if(!l&&!c)return;let u=Bl(c,l,i,a);if(Wl(Ul(t.width,t.height,i.cellHorizontalPadding,u,s),n,r)){if(c)return{kind:`button`,label:c};if(l)return{kind:`menu`,actions:o,bounds:{...t,clickX:t.x+(n??t.width/2),clickY:t.y+(r??t.height/2)}}}}var ql={kind:U.Custom,isMatch:Gl,needsHover:!0,needsHoverPosition:!0,onSelect:e=>e.preventDefault(),drawPrep:e=>{let{ctx:t}=e;return t.textAlign=`center`,t.textBaseline=`middle`,{deprep:e=>{e.ctx.textAlign=`start`,e.ctx.textBaseline=`alphabetic`}}},draw:(e,t)=>{let{ctx:n,theme:r,rect:i,hoverX:a,hoverY:o}=e,{data:s,buttonType:c,alignment:l}=t.data,u=r.cellHorizontalPadding,d=Vl(s),p=Array.isArray(s)&&s.length>1;if(!p&&!d)return!0;let m=Il(n,d,r),h=Ul(i.width,i.height,u,m,l),g=Math.floor(i.x+h.x),_=Math.floor(i.y+h.y),v=h.width,y=h.height;if(v<=0||y<=0)return!0;let b=Wl(h,a,o);b&&e.overrideCursor?.(`pointer`);let x,S,C,w=r.accentColor,T=I(r.accentColor,.15);switch(c){case`primary`:x=b?T:w,S=void 0,C=`#ffffff`;break;case`secondary`:x=b?r.bgHeaderHovered:`transparent`,S=r.borderColor,C=r.textDark;break;default:x=`transparent`,S=void 0,C=b?r.accentColor:r.textDark;break}let E=r.roundingRadius??4;x&&x!==`transparent`&&(n.beginPath(),Ji(n,g,_,v,y,E),n.fillStyle=x,n.fill()),S&&(n.beginPath(),Ji(n,g+.5,_+.5,v-1,y-1,E),n.strokeStyle=S,n.lineWidth=1,n.stroke());let D=g+v/2,O=i.y+i.height/2,k=Ii(n,r.baseFontFull),A=`${r.baseFontStyle} '${f.iconFont}'`,j=Nl(r.cellHorizontalPadding);if(p)n.font=A,n.fillStyle=C,n.fillText(`more_vert`,D,O+k);else if(d){let{icon:e,text:t}=Fl(d);if(n.fillStyle=C,e&&t){n.font=r.baseFontFull;let i=n.measureText(t).width;n.font=A;let a=n.measureText(e).width,o=D-(a+j+i)/2;n.fillText(e,o+a/2,O+k),n.font=r.baseFontFull,n.fillText(t,o+a+j+i/2,O+k)}else e?(n.font=A,n.fillText(e,D,O+k)):(n.font=r.baseFontFull,n.fillText(t,D,O+k))}return!0},measure:(e,t,n)=>{let{data:r}=t.data,i=Vl(r);return!(Array.isArray(r)&&r.length>1)&&!i?n.cellHorizontalPadding*2:Il(e,i,n)+n.cellHorizontalPadding*4},provideEditor:void 0},Jl=t(un(),1),Yl=c(`div`,{target:`e1e9geyc0`})(({theme:e})=>({overflowY:`auto`,padding:e.spacing.sm,".react-json-view .copy-icon svg":{fontSize:`0.9em !important`,marginRight:`${e.spacing.threeXS} !important`,verticalAlign:`middle !important`}})),Xl=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e==`string`?Jl.default.parse(e):Jl.default.parse(Jl.default.stringify(e))}catch{n=void 0}return w(n)?o(ii,{highlight:!0,autoFocus:!1,disabled:!0,value:xl(e)??``,onChange:()=>void 0}):o(Yl,{"data-testid":`stJsonColumnViewer`,children:o(dn,{src:n,collapsed:2,theme:xe(t.bgCell)>.5?`rjv-default`:`monokai`,displayDataTypes:!1,displayObjectSize:!1,name:!1,enableClipboard:!0,showComma:!1,style:{fontFamily:t.fontFamily,fontSize:t.baseFontStyle,backgroundColor:t.bgCell,whiteSpace:`pre-wrap`}})})},Zl=e=>{let t=e.theme,n=e.value.data;return o(Xl,{jsonValue:n.value||n.displayValue,theme:t})},Ql=e=>{let t=e.theme,n=e.value;return o(Xl,{jsonValue:n.data,theme:t})},$l={kind:U.Custom,isMatch:e=>e.data.kind===`json-cell`,draw:(e,t)=>{let{value:n,displayValue:r}=t.data;return Hi(e,r??xl(n)??``,t.contentAlign),!0},measure:(e,t,n)=>{let{value:r,displayValue:i}=t.data,a=i??xl(r)??``;return(a?e.measureText(a).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Zl})},eu=c(`div`,{target:`e1gco0vs0`})(({theme:e,isEditing:t})=>({position:`relative`,display:`flex`,flexDirection:`column`,width:`100%`,height:`100%`,minHeight:t?`18.75rem`:`12.5rem`,maxHeight:t?`min(31.25rem, 70vh)`:`25rem`,fontFamily:e.genericFonts.bodyFont,fontSize:e.fontSizes.sm})),tu=`opacity 300ms 150ms`,nu=`${tu}, visibility 0ms linear 450ms`,ru=`${tu}, visibility 0ms linear 150ms`,iu=c(`div`,{target:`e1gco0vs1`})(({theme:e,locked:t})=>({opacity:+!!t,padding:`${e.spacing.sm} ${e.spacing.sm} 0 0`,top:0,right:0,position:`absolute`,zIndex:e.zIndices.sidebar+1,pointerEvents:`auto`,transition:t?ru:nu,"&:focus-within":{opacity:1}})),au=c(`div`,{target:`e1gco0vs2`})({position:`relative`,display:`flex`,flexDirection:`column`,flex:1,backgroundColor:`var(--gdg-bg-cell)`}),ou=c(Fe,{target:`e1gco0vs3`})({pointerEvents:`auto`}),su=c(`div`,{target:`e1gco0vs4`})(({theme:e})=>({position:`relative`,flex:1,overflowY:`auto`,padding:e.spacing.lg,paddingBottom:e.spacing.twoXL,backgroundColor:`var(--gdg-bg-cell)`,color:e.colors.bodyText,"&:hover, &:focus-visible, &:focus-within:has(:focus-visible)":{".stMarkdownCellToolbar":{opacity:1,visibility:`visible`,pointerEvents:`auto`,transition:ru}}})),cu=c(`textarea`,{target:`e1gco0vs5`})(({theme:e})=>({flex:1,padding:e.spacing.lg,paddingBottom:e.spacing.twoXL,border:`none`,resize:`none`,backgroundColor:`var(--gdg-bg-cell)`,color:e.colors.bodyText,fontFamily:e.genericFonts.codeFont,fontSize:e.fontSizes.sm,lineHeight:1.5,"&:focus":{outline:`none`}})),lu=c(`div`,{target:`e1gco0vs6`})(({theme:e})=>({color:e.colors.fadedText40,fontStyle:`italic`})),uu=({value:e,initialValue:t,onChange:n,onFinishedEditing:r})=>{let i=e.data.value??``,s=t!==void 0&&t!==``,[c,l]=(0,K.useState)(s),[u,d]=(0,K.useState)(s&&i===``?t:i);(0,K.useEffect)(()=>{if(s&&i===``&&t){let r=t;n({...e,copyData:r,data:{...e.data,value:r,displayValue:El(r)}})}},[]);let f=p()?`⌘`:`Ctrl`,m=(0,K.useCallback)(t=>{let r=t.target.value;d(r),n({...e,copyData:r,data:{...e.data,value:r,displayValue:El(r)}})},[e,n]),h=(0,K.useCallback)(()=>{r({...e,copyData:u,data:{...e.data,value:u,displayValue:El(u)}},[0,0])},[e,u,r]),g=(0,K.useCallback)(()=>{r(void 0,[0,0])},[r]),_=(0,K.useCallback)(e=>{e.stopPropagation(),e.key===`Enter`&&(e.ctrlKey||e.metaKey)?h():e.key===`Escape`&&g()},[h,g]),v=(0,K.useCallback)(()=>{d(e.data.value??``),l(!0)},[e.data.value]);if(c)return o(eu,{"data-testid":`stMarkdownColumnEditor`,isEditing:!0,children:a(au,{children:[o(iu,{locked:!0,children:a(ou,{children:[o(et,{label:`Save (${f}+Enter)`,icon:Ye,onClick:h}),o(et,{label:`Cancel (Escape)`,icon:Xe,onClick:g})]})}),o(cu,{value:u,onChange:m,onKeyDown:_,autoFocus:!0,placeholder:`Enter markdown text...`,"aria-label":`Edit markdown content`})]})});let y=!!e.data.value;return o(eu,{"data-testid":`stMarkdownColumnViewer`,children:a(su,{tabIndex:0,"aria-label":`Markdown content`,children:[!e.readonly&&o(iu,{className:`stMarkdownCellToolbar`,children:o(ou,{children:o(et,{label:`Edit`,icon:yn,onClick:v})})}),y?o(k,{source:e.data.value??``,allowHTML:!1}):o(lu,{children:`No content`})]})})},du={kind:U.Custom,isMatch:e=>e.data.kind===`markdown-cell`,draw:(e,t)=>{let{displayValue:n}=t.data;return Hi(e,n,t.contentAlign),!0},measure:(e,t,n)=>{let{displayValue:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:uu,disablePadding:!0,styleOverride:{minWidth:`min(37.5rem, 90vw)`}}),onPaste:(e,t)=>({...t,value:e,displayValue:El(e)})},fu={audio:`audio_file`,video:`video_file`},pu=c(`audio`,{target:`e1uyu91s0`})({width:`100%`,minWidth:`18.75rem`}),mu=c(`video`,{target:`e1uyu91s1`})({maxWidth:`25rem`,maxHeight:`18.75rem`,width:`100%`}),hu=e=>{let{src:t,mediaType:n}=e.value.data;return t?n===`audio`?o(pu,{src:t,controls:!0,autoPlay:!1,"aria-label":`Audio player`}):o(mu,{src:t,controls:!0,autoPlay:!1,"aria-label":`Video player`}):null},gu={kind:U.Custom,isMatch:e=>e.data.kind===`media-cell`,draw:(e,t)=>{let{ctx:n,theme:r,rect:i}=e,{src:a,mediaType:o}=t.data;if(!a)return!0;let s=fu[o];n.save(),n.font=`${r.bubbleHeight}px ${f.iconFont}`,n.fillStyle=r.textLight,n.textAlign=t.contentAlign||`center`,n.textBaseline=`middle`;let c;switch(t.contentAlign){case`left`:c=i.x+r.cellHorizontalPadding;break;case`right`:c=i.x+i.width-r.cellHorizontalPadding;break;default:c=i.x+i.width/2}let l=i.y+i.height/2;return n.fillText(s,c,l),n.restore(),!0},measure:(e,t,n)=>{let r=fu[t.data.mediaType];return e.font=`${n.bubbleHeight}px ${f.iconFont}`,e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:hu})},_u=[`defaultInputValue`,`defaultMenuIsOpen`,`defaultValue`,`inputValue`,`menuIsOpen`,`onChange`,`onInputChange`,`onMenuClose`,`onMenuOpen`,`value`];function vu(e){var t=e.defaultInputValue,n=t===void 0?``:t,r=e.defaultMenuIsOpen,i=r!==void 0&&r,a=e.defaultValue,o=a===void 0?null:a,s=e.inputValue,c=e.menuIsOpen,l=e.onChange,u=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,p=e.value,m=qe(e,_u),h=Et((0,K.useState)(s===void 0?n:s),2),g=h[0],_=h[1],v=Et((0,K.useState)(c===void 0?i:c),2),y=v[0],b=v[1],x=Et((0,K.useState)(p===void 0?o:p),2),S=x[0],C=x[1],w=(0,K.useCallback)(function(e,t){typeof l==`function`&&l(e,t),C(e)},[l]),T=(0,K.useCallback)(function(e,t){var n;typeof u==`function`&&(n=u(e,t)),_(n===void 0?e:n)},[u]),E=(0,K.useCallback)(function(){typeof f==`function`&&f(),b(!0)},[f]),D=(0,K.useCallback)(function(){typeof d==`function`&&d(),b(!1)},[d]),O=s===void 0?g:s,k=c===void 0?y:c,A=p===void 0?S:p;return B(B({},m),{},{inputValue:O,menuIsOpen:k,onChange:w,onInputChange:T,onMenuClose:D,onMenuOpen:E,value:A})}function yu(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var bu=K.useLayoutEffect,xu=[`className`,`clearValue`,`cx`,`getStyles`,`getClassNames`,`getValue`,`hasValue`,`isMulti`,`isRtl`,`options`,`selectOption`,`selectProps`,`setValue`,`theme`],Su=function(){};function Cu(e,t){return t?t[0]===`-`?e+t:e+`__`+t:e}function wu(e,t){var n=[...arguments].slice(2),r=[].concat(n);if(t&&e)for(var i in t)t.hasOwnProperty(i)&&t[i]&&r.push(`${Cu(e,i)}`);return r.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(` `)}var Tu=function(e){return Wu(e)?e.filter(Boolean):Ge(e)===`object`&&e!==null?[e]:[]},Eu=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,B({},qe(e,xu))},Du=function(e,t,n){var r=e.cx,i=e.getStyles,a=e.getClassNames,o=e.className;return{css:i(t,e),className:r(n??{},a(t,e),o)}};function Ou(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function ku(e){return Ou(e)?window.innerHeight:e.clientHeight}function Au(e){return Ou(e)?window.pageYOffset:e.scrollTop}function ju(e,t){if(Ou(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Mu(e){var t=getComputedStyle(e),n=t.position===`absolute`,r=/(auto|scroll)/;if(t.position===`fixed`)return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position===`static`)&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function Nu(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Pu(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Su,i=Au(e),a=t-i,o=10,s=0;function c(){s+=o,ju(e,Nu(s,i,a,n)),sn.bottom?ju(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i=p)return{placement:`bottom`,maxHeight:t};if(C>=p&&!o)return a&&Pu(c,w,E),{placement:`bottom`,maxHeight:t};if(!o&&C>=r||o&&x>=r)return a&&Pu(c,w,E),{placement:`bottom`,maxHeight:o?x-v:C-v};if(i===`auto`||o){var D=t,O=o?b:S;return O>=r&&(D=Math.min(O-v-s,t)),{placement:`top`,maxHeight:D}}if(i===`bottom`)return a&&ju(c,w),{placement:`bottom`,maxHeight:t};break;case`top`:if(b>=p)return{placement:`top`,maxHeight:t};if(S>=p&&!o)return a&&Pu(c,T,E),{placement:`top`,maxHeight:t};if(!o&&S>=r||o&&b>=r){var k=t;return(!o&&S>=r||o&&b>=r)&&(k=o?b-y:S-y),a&&Pu(c,T,E),{placement:`top`,maxHeight:k}}return{placement:`bottom`,maxHeight:t};default:throw Error(`Invalid placement provided "${i}".`)}return l}function Qu(e){return e?{bottom:`top`,top:`bottom`}[e]:`bottom`}var $u=function(e){return e===`auto`?`bottom`:e},ed=function(e,t){var n,r=e.placement,i=e.theme,a=i.borderRadius,o=i.spacing,s=i.colors;return B((n={label:`menu`},Ke(n,Qu(r),`100%`),Ke(n,`position`,`absolute`),Ke(n,`width`,`100%`),Ke(n,`zIndex`,1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:a,boxShadow:`0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)`,marginBottom:o.menuGutter,marginTop:o.menuGutter})},td=(0,K.createContext)(null),nd=function(e){var t=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,i=e.menuPlacement,a=e.menuPosition,o=e.menuShouldScrollIntoView,s=e.theme,c=((0,K.useContext)(td)||{}).setPortalPlacement,l=(0,K.useRef)(null),u=Et((0,K.useState)(r),2),d=u[0],f=u[1],p=Et((0,K.useState)(null),2),m=p[0],h=p[1],g=s.spacing.controlHeight;return bu(function(){var e=l.current;if(e){var t=a===`fixed`,s=Zu({maxHeight:r,menuEl:e,minHeight:n,placement:i,shouldScroll:o&&!t,isFixedPosition:t,controlHeight:g});f(s.maxHeight),h(s.placement),c?.(s.placement)}},[r,i,a,o,n,c,g]),t({ref:l,placerProps:B(B({},e),{},{placement:m||$u(i),maxHeight:d})})},rd=function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return b(`div`,l({},Du(e,`menu`,{menu:!0}),{ref:n},r),t)},id=function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return B({maxHeight:n,overflowY:`auto`,position:`relative`,WebkitOverflowScrolling:`touch`},t?{}:{paddingBottom:r,paddingTop:r})},ad=function(e){var t=e.children,n=e.innerProps,r=e.innerRef,i=e.isMulti;return b(`div`,l({},Du(e,`menuList`,{"menu-list":!0,"menu-list--is-multi":i}),{ref:r},n),t)},od=function(e,t){var n=e.theme,r=n.spacing.baseUnit,i=n.colors;return B({textAlign:`center`},t?{}:{color:i.neutral40,padding:`${r*2}px ${r*3}px`})},sd=od,cd=od,ld=function(e){var t=e.children,n=t===void 0?`No options`:t,r=e.innerProps;return b(`div`,l({},Du(B(B({},qe(e,Yu)),{},{children:n,innerProps:r}),`noOptionsMessage`,{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},ud=function(e){var t=e.children,n=t===void 0?`Loading...`:t,r=e.innerProps;return b(`div`,l({},Du(B(B({},qe(e,Xu)),{},{children:n,innerProps:r}),`loadingMessage`,{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},dd=function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},fd=function(e){var t=e.appendTo,n=e.children,r=e.controlElement,i=e.innerProps,a=e.menuPlacement,o=e.menuPosition,s=(0,K.useRef)(null),c=(0,K.useRef)(null),u=Et((0,K.useState)($u(a)),2),d=u[0],f=u[1],p=(0,K.useMemo)(function(){return{setPortalPlacement:f}},[]),m=Et((0,K.useState)(null),2),h=m[0],g=m[1],_=(0,K.useCallback)(function(){if(r){var e=Iu(r),t=o===`fixed`?0:window.pageYOffset,n=e[d]+t;(n!==h?.offset||e.left!==h?.rect.left||e.width!==h?.rect.width)&&g({offset:n,rect:e})}},[r,o,d,h?.offset,h?.rect.left,h?.rect.width]);bu(function(){_()},[_]);var v=(0,K.useCallback)(function(){typeof c.current==`function`&&(c.current(),c.current=null),r&&s.current&&(c.current=Ie(r,s.current,_,{elementResize:`ResizeObserver`in window}))},[r,_]);bu(function(){v()},[v]);var y=(0,K.useCallback)(function(e){s.current=e,v()},[v]);if(!t&&o!==`fixed`||!h)return null;var x=b(`div`,l({ref:y},Du(B(B({},e),{},{offset:h.offset,position:o,rect:h.rect}),`menuPortal`,{"menu-portal":!0}),i),n);return b(td.Provider,{value:p},t?(0,Sn.createPortal)(x,t):x)},pd=function(e){var t=e.isDisabled;return{label:`container`,direction:e.isRtl?`rtl`:void 0,pointerEvents:t?`none`:void 0,position:`relative`}},md=function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,i=e.isRtl;return b(`div`,l({},Du(e,`container`,{"--is-disabled":r,"--is-rtl":i}),n),t)},hd=function(e,t){var n=e.theme.spacing,r=e.isMulti,i=e.hasValue,a=e.selectProps.controlShouldRenderValue;return B({alignItems:`center`,display:r&&i&&a?`flex`:`grid`,flex:1,flexWrap:`wrap`,WebkitOverflowScrolling:`touch`,position:`relative`,overflow:`hidden`},t?{}:{padding:`${n.baseUnit/2}px ${n.baseUnit*2}px`})},gd=function(e){var t=e.children,n=e.innerProps,r=e.isMulti,i=e.hasValue;return b(`div`,l({},Du(e,`valueContainer`,{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":i}),n),t)},_d=function(){return{alignItems:`center`,alignSelf:`stretch`,display:`flex`,flexShrink:0}},vd=function(e){var t=e.children,n=e.innerProps;return b(`div`,l({},Du(e,`indicatorsContainer`,{indicators:!0}),n),t)},yd,bd=[`size`],xd=[`innerProps`,`isRtl`,`size`],Sd={name:`8mmkcg`,styles:`display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0`},Cd=function(e){var t=e.size,n=qe(e,bd);return b(`svg`,l({height:t,width:t,viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,css:Sd},n))},wd=function(e){return b(Cd,l({size:20},e),b(`path`,{d:`M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z`}))},Td=function(e){return b(Cd,l({size:20},e),b(`path`,{d:`M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z`}))},Ed=function(e,t){var n=e.isFocused,r=e.theme,i=r.spacing.baseUnit,a=r.colors;return B({label:`indicatorContainer`,display:`flex`,transition:`color 150ms`},t?{}:{color:n?a.neutral60:a.neutral20,padding:i*2,":hover":{color:n?a.neutral80:a.neutral40}})},Dd=Ed,Od=function(e){var t=e.children,n=e.innerProps;return b(`div`,l({},Du(e,`dropdownIndicator`,{indicator:!0,"dropdown-indicator":!0}),n),t||b(Td,null))},kd=Ed,Ad=function(e){var t=e.children,n=e.innerProps;return b(`div`,l({},Du(e,`clearIndicator`,{indicator:!0,"clear-indicator":!0}),n),t||b(wd,null))},jd=function(e,t){var n=e.isDisabled,r=e.theme,i=r.spacing.baseUnit,a=r.colors;return B({label:`indicatorSeparator`,alignSelf:`stretch`,width:1},t?{}:{backgroundColor:n?a.neutral10:a.neutral20,marginBottom:i*2,marginTop:i*2})},Md=function(e){var t=e.innerProps;return b(`span`,l({},t,Du(e,`indicatorSeparator`,{"indicator-separator":!0})))},Nd=v(yd||=yu([` + 0%, 80%, 100% { opacity: 0; } + 40% { opacity: 1; } +`])),Pd=function(e,t){var n=e.isFocused,r=e.size,i=e.theme,a=i.colors,o=i.spacing.baseUnit;return B({label:`loadingIndicator`,display:`flex`,transition:`color 150ms`,alignSelf:`center`,fontSize:r,lineHeight:1,marginRight:r,textAlign:`center`,verticalAlign:`middle`},t?{}:{color:n?a.neutral60:a.neutral20,padding:o*2})},Fd=function(e){var t=e.delay,n=e.offset;return b(`span`,{css:y({animation:`${Nd} 1s ease-in-out ${t}ms infinite;`,backgroundColor:`currentColor`,borderRadius:`1em`,display:`inline-block`,marginLeft:n?`1em`:void 0,height:`1em`,verticalAlign:`top`,width:`1em`},``,``)})},Id=function(e){var t=e.innerProps,n=e.isRtl,r=e.size,i=r===void 0?4:r;return b(`div`,l({},Du(B(B({},qe(e,xd)),{},{innerProps:t,isRtl:n,size:i}),`loadingIndicator`,{indicator:!0,"loading-indicator":!0}),t),b(Fd,{delay:0,offset:n}),b(Fd,{delay:160,offset:!0}),b(Fd,{delay:320,offset:!n}))},Ld=function(e,t){var n=e.isDisabled,r=e.isFocused,i=e.theme,a=i.colors,o=i.borderRadius,s=i.spacing;return B({label:`control`,alignItems:`center`,cursor:`default`,display:`flex`,flexWrap:`wrap`,justifyContent:`space-between`,minHeight:s.controlHeight,outline:`0 !important`,position:`relative`,transition:`all 100ms`},t?{}:{backgroundColor:n?a.neutral5:a.neutral0,borderColor:n?a.neutral10:r?a.primary:a.neutral20,borderRadius:o,borderStyle:`solid`,borderWidth:1,boxShadow:r?`0 0 0 1px ${a.primary}`:void 0,"&:hover":{borderColor:r?a.primary:a.neutral30}})},Rd=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,i=e.innerRef,a=e.innerProps,o=e.menuIsOpen;return b(`div`,l({ref:i},Du(e,`control`,{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":o}),a,{"aria-disabled":n||void 0}),t)},zd=[`data`],Bd=function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},Vd=function(e){var t=e.children,n=e.cx,r=e.getStyles,i=e.getClassNames,a=e.Heading,o=e.headingProps,s=e.innerProps,c=e.label,u=e.theme,d=e.selectProps;return b(`div`,l({},Du(e,`group`,{group:!0}),s),b(a,l({},o,{selectProps:d,theme:u,getStyles:r,getClassNames:i,cx:n}),c),b(`div`,null,t))},Hd=function(e,t){var n=e.theme,r=n.colors,i=n.spacing;return B({label:`group`,cursor:`default`,display:`block`},t?{}:{color:r.neutral40,fontSize:`75%`,fontWeight:500,marginBottom:`0.25em`,paddingLeft:i.baseUnit*3,paddingRight:i.baseUnit*3,textTransform:`uppercase`})},Ud=function(e){var t=Eu(e);t.data;var n=qe(t,zd);return b(`div`,l({},Du(e,`groupHeading`,{"group-heading":!0}),n))},Wd=Vd,Gd=[`innerRef`,`isDisabled`,`isHidden`,`inputClassName`],Kd=function(e,t){var n=e.isDisabled,r=e.value,i=e.theme,a=i.spacing,o=i.colors;return B(B({visibility:n?`hidden`:`visible`,transform:r?`translateZ(0)`:``},Jd),t?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:o.neutral80})},qd={gridArea:`1 / 2`,font:`inherit`,minWidth:`2px`,border:0,margin:0,outline:0,padding:0},Jd={flex:`1 1 auto`,display:`inline-grid`,gridArea:`1 / 1 / 2 / 3`,gridTemplateColumns:`0 min-content`,"&:after":B({content:`attr(data-value) " "`,visibility:`hidden`,whiteSpace:`pre`},qd)},Yd=function(e){return B({label:`input`,color:`inherit`,background:0,opacity:+!e,width:`100%`},qd)},Xd=function(e){var t=e.cx,n=e.value,r=Eu(e),i=r.innerRef,a=r.isDisabled,o=r.isHidden,s=r.inputClassName,c=qe(r,Gd);return b(`div`,l({},Du(e,`input`,{"input-container":!0}),{"data-value":n||``}),b(`input`,l({className:t({input:!0},s),ref:i,style:Yd(o),disabled:a},c)))},Zd=function(e,t){var n=e.theme,r=n.spacing,i=n.borderRadius,a=n.colors;return B({label:`multiValue`,display:`flex`,minWidth:0},t?{}:{backgroundColor:a.neutral10,borderRadius:i/2,margin:r.baseUnit/2})},Qd=function(e,t){var n=e.theme,r=n.borderRadius,i=n.colors,a=e.cropWithEllipsis;return B({overflow:`hidden`,textOverflow:a||a===void 0?`ellipsis`:void 0,whiteSpace:`nowrap`},t?{}:{borderRadius:r/2,color:i.neutral80,fontSize:`85%`,padding:3,paddingLeft:6})},$d=function(e,t){var n=e.theme,r=n.spacing,i=n.borderRadius,a=n.colors,o=e.isFocused;return B({alignItems:`center`,display:`flex`},t?{}:{borderRadius:i/2,backgroundColor:o?a.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},ef=function(e){var t=e.children,n=e.innerProps;return b(`div`,n,t)},tf=ef,nf=ef;function rf(e){var t=e.children,n=e.innerProps;return b(`div`,l({role:`button`},n),t||b(wd,{size:14}))}var af=function(e){var t=e.children,n=e.components,r=e.data,i=e.innerProps,a=e.isDisabled,o=e.removeProps,s=e.selectProps,c=n.Container,l=n.Label,u=n.Remove;return b(c,{data:r,innerProps:B(B({},Du(e,`multiValue`,{"multi-value":!0,"multi-value--is-disabled":a})),i),selectProps:s},b(l,{data:r,innerProps:B({},Du(e,`multiValueLabel`,{"multi-value__label":!0})),selectProps:s},t),b(u,{data:r,innerProps:B(B({},Du(e,`multiValueRemove`,{"multi-value__remove":!0})),{},{"aria-label":`Remove ${t||`option`}`},o),selectProps:s}))},of=function(e,t){var n=e.isDisabled,r=e.isFocused,i=e.isSelected,a=e.theme,o=a.spacing,s=a.colors;return B({label:`option`,cursor:`default`,display:`block`,fontSize:`inherit`,width:`100%`,userSelect:`none`,WebkitTapHighlightColor:`rgba(0, 0, 0, 0)`},t?{}:{backgroundColor:i?s.primary:r?s.primary25:`transparent`,color:n?s.neutral20:i?s.neutral0:`inherit`,padding:`${o.baseUnit*2}px ${o.baseUnit*3}px`,":active":{backgroundColor:n?void 0:i?s.primary:s.primary50}})},sf=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,i=e.isSelected,a=e.innerRef,o=e.innerProps;return b(`div`,l({},Du(e,`option`,{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":i}),{ref:a,"aria-disabled":n},o),t)},cf=function(e,t){var n=e.theme,r=n.spacing,i=n.colors;return B({label:`placeholder`,gridArea:`1 / 1 / 2 / 3`},t?{}:{color:i.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},lf=function(e){var t=e.children,n=e.innerProps;return b(`div`,l({},Du(e,`placeholder`,{placeholder:!0}),n),t)},uf=function(e,t){var n=e.isDisabled,r=e.theme,i=r.spacing,a=r.colors;return B({label:`singleValue`,gridArea:`1 / 1 / 2 / 3`,maxWidth:`100%`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},t?{}:{color:n?a.neutral40:a.neutral80,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},df={ClearIndicator:Ad,Control:Rd,DropdownIndicator:Od,DownChevron:Td,CrossIcon:wd,Group:Wd,GroupHeading:Ud,IndicatorsContainer:vd,IndicatorSeparator:Md,Input:Xd,LoadingIndicator:Id,Menu:rd,MenuList:ad,MenuPortal:fd,LoadingMessage:ud,NoOptionsMessage:ld,MultiValue:af,MultiValueContainer:tf,MultiValueLabel:nf,MultiValueRemove:rf,Option:sf,Placeholder:lf,SelectContainer:md,SingleValue:function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return b(`div`,l({},Du(e,`singleValue`,{"single-value":!0,"single-value--is-disabled":n}),r),t)},ValueContainer:gd},ff=function(e){return B(B({},df),e.components)},pf=Number.isNaN||function(e){return typeof e==`number`&&e!==e};function mf(e,t){return!!(e===t||pf(e)&&pf(t))}function hf(e,t){if(e.length!==t.length)return!1;for(var n=0;n1?`s`:``} ${i.join(`,`)}, selected.`;case`select-option`:return a?`option ${r} is disabled. Select another option.`:`option ${r}, selected.`;default:return``}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,i=e.label,a=i===void 0?``:i,o=e.selectValue,s=e.isDisabled,c=e.isSelected,l=e.isAppleDevice,u=function(e,t){return e&&e.length?`${e.indexOf(t)+1} of ${e.length}`:``};return t===`value`&&o?`value ${a} focused, ${u(o,n)}.`:t===`menu`&&l?`${a}${`${c?` selected`:``}${s?` disabled`:``}`}, ${u(r,n)}.`:``},onFilter:function(e){var t=e.inputValue;return`${e.resultsMessage}${t?` for search term `+t:``}.`}},bf=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,i=e.focusableOptions,a=e.isFocused,o=e.selectValue,s=e.selectProps,c=e.id,l=e.isAppleDevice,u=s.ariaLiveMessages,d=s.getOptionLabel,f=s.inputValue,p=s.isMulti,m=s.isOptionDisabled,h=s.isSearchable,g=s.menuIsOpen,_=s.options,v=s.screenReaderStatus,y=s.tabSelectsValue,x=s.isLoading,S=s[`aria-label`],C=s[`aria-live`],w=(0,K.useMemo)(function(){return B(B({},yf),u||{})},[u]),T=(0,K.useMemo)(function(){var e=``;if(t&&w.onChange){var n=t.option,r=t.options,i=t.removedValue,a=t.removedValues,s=t.value,c=i||n||function(e){return Array.isArray(e)?null:e}(s),l=c?d(c):``,u=r||a||void 0,f=u?u.map(d):[],p=B({isDisabled:c&&m(c,o),label:l,labels:f},t);e=w.onChange(p)}return e},[t,w,m,o,d]),E=(0,K.useMemo)(function(){var e=``,t=n||r,a=!!(n&&o&&o.includes(n));if(t&&w.onFocus){var s={focused:t,label:d(t),isDisabled:m(t,o),isSelected:a,options:i,context:t===n?`menu`:`value`,selectValue:o,isAppleDevice:l};e=w.onFocus(s)}return e},[n,r,d,m,w,i,o,l]),D=(0,K.useMemo)(function(){var e=``;if(g&&_.length&&!x&&w.onFilter){var t=v({count:i.length});e=w.onFilter({inputValue:f,resultsMessage:t})}return e},[i,f,g,w,_,v,x]),O=t?.action===`initial-input-focus`,k=(0,K.useMemo)(function(){var e=``;if(w.guidance){var t=r?`value`:g?`menu`:`input`;e=w.guidance({"aria-label":S,context:t,isDisabled:n&&m(n,o),isMulti:p,isSearchable:h,tabSelectsValue:y,isInitialFocus:O})}return e},[S,n,r,p,m,h,g,w,o,y,O]),A=b(K.Fragment,null,b(`span`,{id:`aria-selection`},T),b(`span`,{id:`aria-focused`},E),b(`span`,{id:`aria-results`},D),b(`span`,{id:`aria-guidance`},k));return b(K.Fragment,null,b(vf,{id:c},O&&A),b(vf,{"aria-live":C,"aria-atomic":`false`,"aria-relevant":`additions text`,role:`log`},a&&!O&&A))},xf=[{base:`A`,letters:`AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ`},{base:`AA`,letters:`Ꜳ`},{base:`AE`,letters:`ÆǼǢ`},{base:`AO`,letters:`Ꜵ`},{base:`AU`,letters:`Ꜷ`},{base:`AV`,letters:`ꜸꜺ`},{base:`AY`,letters:`Ꜽ`},{base:`B`,letters:`BⒷBḂḄḆɃƂƁ`},{base:`C`,letters:`CⒸCĆĈĊČÇḈƇȻꜾ`},{base:`D`,letters:`DⒹDḊĎḌḐḒḎĐƋƊƉꝹ`},{base:`DZ`,letters:`DZDŽ`},{base:`Dz`,letters:`DzDž`},{base:`E`,letters:`EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ`},{base:`F`,letters:`FⒻFḞƑꝻ`},{base:`G`,letters:`GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ`},{base:`H`,letters:`HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ`},{base:`I`,letters:`IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ`},{base:`J`,letters:`JⒿJĴɈ`},{base:`K`,letters:`KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ`},{base:`L`,letters:`LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ`},{base:`LJ`,letters:`LJ`},{base:`Lj`,letters:`Lj`},{base:`M`,letters:`MⓂMḾṀṂⱮƜ`},{base:`N`,letters:`NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ`},{base:`NJ`,letters:`NJ`},{base:`Nj`,letters:`Nj`},{base:`O`,letters:`OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ`},{base:`OI`,letters:`Ƣ`},{base:`OO`,letters:`Ꝏ`},{base:`OU`,letters:`Ȣ`},{base:`P`,letters:`PⓅPṔṖƤⱣꝐꝒꝔ`},{base:`Q`,letters:`QⓆQꝖꝘɊ`},{base:`R`,letters:`RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ`},{base:`S`,letters:`SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ`},{base:`T`,letters:`TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ`},{base:`TZ`,letters:`Ꜩ`},{base:`U`,letters:`UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ`},{base:`V`,letters:`VⓋVṼṾƲꝞɅ`},{base:`VY`,letters:`Ꝡ`},{base:`W`,letters:`WⓌWẀẂŴẆẄẈⱲ`},{base:`X`,letters:`XⓍXẊẌ`},{base:`Y`,letters:`YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ`},{base:`Z`,letters:`ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ`},{base:`a`,letters:`aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ`},{base:`aa`,letters:`ꜳ`},{base:`ae`,letters:`æǽǣ`},{base:`ao`,letters:`ꜵ`},{base:`au`,letters:`ꜷ`},{base:`av`,letters:`ꜹꜻ`},{base:`ay`,letters:`ꜽ`},{base:`b`,letters:`bⓑbḃḅḇƀƃɓ`},{base:`c`,letters:`cⓒcćĉċčçḉƈȼꜿↄ`},{base:`d`,letters:`dⓓdḋďḍḑḓḏđƌɖɗꝺ`},{base:`dz`,letters:`dzdž`},{base:`e`,letters:`eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ`},{base:`f`,letters:`fⓕfḟƒꝼ`},{base:`g`,letters:`gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ`},{base:`h`,letters:`hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ`},{base:`hv`,letters:`ƕ`},{base:`i`,letters:`iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı`},{base:`j`,letters:`jⓙjĵǰɉ`},{base:`k`,letters:`kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ`},{base:`l`,letters:`lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ`},{base:`lj`,letters:`lj`},{base:`m`,letters:`mⓜmḿṁṃɱɯ`},{base:`n`,letters:`nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ`},{base:`nj`,letters:`nj`},{base:`o`,letters:`oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ`},{base:`oi`,letters:`ƣ`},{base:`ou`,letters:`ȣ`},{base:`oo`,letters:`ꝏ`},{base:`p`,letters:`pⓟpṕṗƥᵽꝑꝓꝕ`},{base:`q`,letters:`qⓠqɋꝗꝙ`},{base:`r`,letters:`rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ`},{base:`s`,letters:`sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ`},{base:`t`,letters:`tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ`},{base:`tz`,letters:`ꜩ`},{base:`u`,letters:`uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ`},{base:`v`,letters:`vⓥvṽṿʋꝟʌ`},{base:`vy`,letters:`ꝡ`},{base:`w`,letters:`wⓦwẁẃŵẇẅẘẉⱳ`},{base:`x`,letters:`xⓧxẋẍ`},{base:`y`,letters:`yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ`},{base:`z`,letters:`zⓩzźẑżžẓẕƶȥɀⱬꝣ`}],Sf=RegExp(`[`+xf.map(function(e){return e.letters}).join(``)+`]`,`g`),Cf={},wf=0;wf-1}},Mf=[`innerRef`];function Nf(e){var t=e.innerRef,n=Ju(qe(e,Mf),`onExited`,`in`,`enter`,`exit`,`appear`);return b(`input`,l({ref:t},n,{css:y({label:`dummyInput`,background:0,border:0,caretColor:`transparent`,fontSize:`inherit`,gridArea:`1 / 1 / 2 / 3`,outline:0,padding:0,width:1,color:`transparent`,left:-100,opacity:0,position:`relative`,transform:`scale(.01)`},``,``)}))}var Pf=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Ff(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,a=e.onTopLeave,o=(0,K.useRef)(!1),s=(0,K.useRef)(!1),c=(0,K.useRef)(0),l=(0,K.useRef)(null),u=(0,K.useCallback)(function(e,t){if(l.current!==null){var c=l.current,u=c.scrollTop,d=c.scrollHeight,f=c.clientHeight,p=l.current,m=t>0,h=d-f-u,g=!1;h>t&&o.current&&(r&&r(e),o.current=!1),m&&s.current&&(a&&a(e),s.current=!1),m&&t>h?(n&&!o.current&&n(e),p.scrollTop=d,g=!0,o.current=!0):!m&&-t>u&&(i&&!s.current&&i(e),p.scrollTop=0,g=!0,s.current=!0),g&&Pf(e)}},[n,r,i,a]),d=(0,K.useCallback)(function(e){u(e,e.deltaY)},[u]),f=(0,K.useCallback)(function(e){c.current=e.changedTouches[0].clientY},[]),p=(0,K.useCallback)(function(e){u(e,c.current-e.changedTouches[0].clientY)},[u]),m=(0,K.useCallback)(function(e){if(e){var t=Hu?{passive:!1}:!1;e.addEventListener(`wheel`,d,t),e.addEventListener(`touchstart`,f,t),e.addEventListener(`touchmove`,p,t)}},[p,f,d]),h=(0,K.useCallback)(function(e){e&&(e.removeEventListener(`wheel`,d,!1),e.removeEventListener(`touchstart`,f,!1),e.removeEventListener(`touchmove`,p,!1))},[p,f,d]);return(0,K.useEffect)(function(){if(t){var e=l.current;return m(e),function(){h(e)}}},[t,m,h]),function(e){l.current=e}}var If=[`boxSizing`,`height`,`overflow`,`paddingRight`,`position`],Lf={boxSizing:`border-box`,overflow:`hidden`,position:`relative`,height:`100%`};function Rf(e){e.cancelable&&e.preventDefault()}function zf(e){e.stopPropagation()}function Bf(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Vf(){return`ontouchstart`in window||navigator.maxTouchPoints}var Hf=!!(typeof window<`u`&&window.document&&window.document.createElement),Uf=0,Wf={capture:!1,passive:!1};function Gf(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0||n,i=(0,K.useRef)({}),a=(0,K.useRef)(null),o=(0,K.useCallback)(function(e){if(Hf){var t=document.body,n=t&&t.style;if(r&&If.forEach(function(e){var t=n&&n[e];i.current[e]=t}),r&&Uf<1){var a=parseInt(i.current.paddingRight,10)||0,o=document.body?document.body.clientWidth:0,s=window.innerWidth-o+a||0;Object.keys(Lf).forEach(function(e){var t=Lf[e];n&&(n[e]=t)}),n&&(n.paddingRight=`${s}px`)}t&&Vf()&&(t.addEventListener(`touchmove`,Rf,Wf),e&&(e.addEventListener(`touchstart`,Bf,Wf),e.addEventListener(`touchmove`,zf,Wf))),Uf+=1}},[r]),s=(0,K.useCallback)(function(e){if(Hf){var t=document.body,n=t&&t.style;Uf=Math.max(Uf-1,0),r&&Uf<1&&If.forEach(function(e){var t=i.current[e];n&&(n[e]=t)}),t&&Vf()&&(t.removeEventListener(`touchmove`,Rf,Wf),e&&(e.removeEventListener(`touchstart`,Bf,Wf),e.removeEventListener(`touchmove`,zf,Wf)))}},[r]);return(0,K.useEffect)(function(){if(t){var e=a.current;return o(e),function(){s(e)}}},[t,o,s]),function(e){a.current=e}}var Kf=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},qf={name:`1kfdb0e`,styles:`position:fixed;left:0;bottom:0;right:0;top:0`};function Jf(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0||r,a=e.onBottomArrive,o=e.onBottomLeave,s=e.onTopArrive,c=e.onTopLeave,l=Ff({isEnabled:i,onBottomArrive:a,onBottomLeave:o,onTopArrive:s,onTopLeave:c}),u=Gf({isEnabled:n});return b(K.Fragment,null,n&&b(`div`,{onClick:Kf,css:qf}),t(function(e){l(e),u(e)}))}var Yf={name:`1a0ro4n-requiredInput`,styles:`label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%`},Xf=function(e){var t=e.name,n=e.onFocus;return b(`input`,{required:!0,name:t,tabIndex:-1,"aria-hidden":`true`,onFocus:n,css:Yf,value:``,onChange:function(){}})};function Zf(e){return typeof window<`u`&&window.navigator!=null&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function Qf(){return Zf(/^iPhone/i)}function $f(){return Zf(/^Mac/i)}function ep(){return Zf(/^iPad/i)||$f()&&navigator.maxTouchPoints>1}function tp(){return Qf()||ep()}function np(){return $f()||tp()}var rp=function(e){return e.label},ip=function(e){return e.label},ap=function(e){return e.value},op=function(e){return!!e.isDisabled},sp={clearIndicator:kd,container:pd,control:Ld,dropdownIndicator:Dd,group:Bd,groupHeading:Hd,indicatorsContainer:_d,indicatorSeparator:jd,input:Kd,loadingIndicator:Pd,loadingMessage:cd,menu:ed,menuList:id,menuPortal:dd,multiValue:Zd,multiValueLabel:Qd,multiValueRemove:$d,noOptionsMessage:sd,option:of,placeholder:cf,singleValue:uf,valueContainer:hd},cp={primary:`#2684FF`,primary75:`#4C9AFF`,primary50:`#B2D4FF`,primary25:`#DEEBFF`,danger:`#DE350B`,dangerLight:`#FFBDAD`,neutral0:`hsl(0, 0%, 100%)`,neutral5:`hsl(0, 0%, 95%)`,neutral10:`hsl(0, 0%, 90%)`,neutral20:`hsl(0, 0%, 80%)`,neutral30:`hsl(0, 0%, 70%)`,neutral40:`hsl(0, 0%, 60%)`,neutral50:`hsl(0, 0%, 50%)`,neutral60:`hsl(0, 0%, 40%)`,neutral70:`hsl(0, 0%, 30%)`,neutral80:`hsl(0, 0%, 20%)`,neutral90:`hsl(0, 0%, 10%)`},lp=4,up=4,dp={borderRadius:lp,colors:cp,spacing:{baseUnit:up,controlHeight:38,menuGutter:up*2}},fp={"aria-live":`polite`,backspaceRemovesValue:!0,blurInputOnSelect:Lu(),captureMenuScroll:!Lu(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:jf(),formatGroupLabel:rp,getOptionLabel:ip,getOptionValue:ap,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:op,loadingMessage:function(){return`Loading...`},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:`bottom`,menuPosition:`absolute`,menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Ru(),noOptionsMessage:function(){return`No options`},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:`Select...`,screenReaderStatus:function(e){var t=e.count;return`${t} result${t===1?``:`s`} available`},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function pp(e,t,n,r){return{type:`option`,data:t,isDisabled:wp(e,t,n),isSelected:Tp(e,t,n),label:Sp(e,t),value:Cp(e,t),index:r}}function mp(e,t){return e.options.map(function(n,r){if(`options`in n){var i=n.options.map(function(n,r){return pp(e,n,t,r)}).filter(function(t){return vp(e,t)});return i.length>0?{type:`group`,data:n,options:i,index:r}:void 0}var a=pp(e,n,t,r);return vp(e,a)?a:void 0}).filter(Uu)}function hp(e){return e.reduce(function(e,t){return t.type===`group`?e.push.apply(e,Ze(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function gp(e,t){return e.reduce(function(e,n){return n.type===`group`?e.push.apply(e,Ze(n.options.map(function(e){return{data:e.data,id:`${t}-${n.index}-${e.index}`}}))):e.push({data:n.data,id:`${t}-${n.index}`}),e},[])}function _p(e,t){return hp(mp(e,t))}function vp(e,t){var n=e.inputValue,r=n===void 0?``:n,i=t.data,a=t.isSelected,o=t.label,s=t.value;return(!Dp(e)||!a)&&Ep(e,{label:o,value:s,data:i},r)}function yp(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r-1?n:t[0]}var xp=function(e,t){return e.find(function(e){return e.data===t})?.id||null},Sp=function(e,t){return e.getOptionLabel(t)},Cp=function(e,t){return e.getOptionValue(t)};function wp(e,t,n){return typeof e.isOptionDisabled==`function`&&e.isOptionDisabled(t,n)}function Tp(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected==`function`)return e.isOptionSelected(t,n);var r=Cp(e,t);return n.some(function(t){return Cp(e,t)===r})}function Ep(e,t,n){return!e.filterOption||e.filterOption(t,n)}var Dp=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return t===void 0?n:t},Op=1,kp=function(e){kt(n,e);var t=At(n);function n(e){var r;if(Dt(this,n),r=t.call(this,e),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:``,isAppleDevice:!1},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,i=n.onChange;t.name=n.name,r.ariaOnChange(e,t),i(e,t)},r.setValue=function(e,t,n){var i=r.props,a=i.closeMenuOnSelect,o=i.isMulti,s=i.inputValue;r.onInputChange(``,{action:`set-value`,prevInputValue:s}),a&&(r.setState({inputIsHiddenAfterUpdate:!o}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,i=t.isMulti,a=t.name,o=r.state.selectValue,s=i&&r.isOptionSelected(e,o),c=r.isOptionDisabled(e,o);if(s){var l=r.getOptionValue(e);r.setValue(qu(o.filter(function(e){return r.getOptionValue(e)!==l})),`deselect-option`,e)}else if(!c)i?r.setValue(qu([].concat(Ze(o),[e])),`select-option`,e):r.setValue(Ku(e),`select-option`);else{r.ariaOnChange(Ku(e),{action:`select-option`,option:e,name:a});return}n&&r.blurInput()},r.removeValue=function(e){var t=r.props.isMulti,n=r.state.selectValue,i=r.getOptionValue(e),a=n.filter(function(e){return r.getOptionValue(e)!==i}),o=Gu(t,a,a[0]||null);r.onChange(o,{action:`remove-value`,removedValue:e}),r.focusInput()},r.clearValue=function(){var e=r.state.selectValue;r.onChange(Gu(r.props.isMulti,[],null),{action:`clear`,removedValues:e})},r.popValue=function(){var e=r.props.isMulti,t=r.state.selectValue,n=t[t.length-1],i=t.slice(0,t.length-1),a=Gu(e,i,i[0]||null);n&&r.onChange(a,{action:`pop-value`,removedValue:n})},r.getFocusedOptionId=function(e){return xp(r.state.focusableOptionsWithIds,e)},r.getFocusableOptionsWithIds=function(){return gp(mp(r.props,r.state.selectValue),r.getElementId(`option`))},r.getValue=function(){return r.state.selectValue},r.cx=function(){var e=[...arguments];return wu.apply(void 0,[r.props.classNamePrefix].concat(e))},r.getOptionLabel=function(e){return Sp(r.props,e)},r.getOptionValue=function(e){return Cp(r.props,e)},r.getStyles=function(e,t){var n=r.props.unstyled,i=sp[e](t,n);i.boxSizing=`border-box`;var a=r.props.styles[e];return a?a(i,t):i},r.getClassNames=function(e,t){var n;return(n=r.props.classNames)[e]?.call(n,t)},r.getElementId=function(e){return`${r.state.instancePrefix}-${e}`},r.getComponents=function(){return ff(r.props)},r.buildCategorizedOptions=function(){return mp(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return hp(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(e,t){r.setState({ariaSelection:B({value:e},t)})},r.onMenuMouseDown=function(e){e.button===0&&(e.stopPropagation(),e.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(e){r.blockOptionHover=!1},r.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?e.target.tagName!==`INPUT`&&e.target.tagName!==`TEXTAREA`&&r.onMenuClose():t&&r.openMenu(`first`):(t&&(r.openAfterFocus=!0),r.focusInput()),e.target.tagName!==`INPUT`&&e.target.tagName!==`TEXTAREA`&&e.preventDefault()}},r.onDropdownIndicatorMouseDown=function(e){if(!(e&&e.type===`mousedown`&&e.button!==0)&&!r.props.isDisabled){var t=r.props,n=t.isMulti,i=t.menuIsOpen;r.focusInput(),i?(r.setState({inputIsHiddenAfterUpdate:!n}),r.onMenuClose()):r.openMenu(`first`),e.preventDefault()}},r.onClearIndicatorMouseDown=function(e){e&&e.type===`mousedown`&&e.button!==0||(r.clearValue(),e.preventDefault(),r.openAfterFocus=!1,e.type===`touchend`?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(e){typeof r.props.closeMenuOnScroll==`boolean`?e.target instanceof HTMLElement&&Ou(e.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll==`function`&&r.props.closeMenuOnScroll(e)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(r.initialTouchX=n.clientX,r.initialTouchY=n.clientY,r.userIsDragging=!1)},r.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var i=Math.abs(n.clientX-r.initialTouchX),a=Math.abs(n.clientY-r.initialTouchY),o=5;r.userIsDragging=i>o||a>o}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=r.props.inputValue,n=e.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(n,{action:`input-change`,prevInputValue:t}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){r.props.onFocus&&r.props.onFocus(e),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu(`first`),r.openAfterFocus=!1},r.onInputBlur=function(e){var t=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(e),r.onInputChange(``,{action:`input-blur`,prevInputValue:t}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(e){if(!(r.blockOptionHover||r.state.focusedOption===e)){var t=r.getFocusableOptions().indexOf(e);r.setState({focusedOption:e,focusedOptionId:t>-1?r.getFocusedOptionId(e):null})}},r.shouldHideSelectedOptions=function(){return Dp(r.props)},r.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),r.focus()},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,i=t.backspaceRemovesValue,a=t.escapeClearsValue,o=t.inputValue,s=t.isClearable,c=t.isDisabled,l=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,f=t.openMenuOnFocus,p=r.state,m=p.focusedOption,h=p.focusedValue,g=p.selectValue;if(!c&&!(typeof u==`function`&&(u(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case`ArrowLeft`:if(!n||o)return;r.focusValue(`previous`);break;case`ArrowRight`:if(!n||o)return;r.focusValue(`next`);break;case`Delete`:case`Backspace`:if(o)return;if(h)r.removeValue(h);else{if(!i)return;n?r.popValue():s&&r.clearValue()}break;case`Tab`:if(r.isComposing||e.shiftKey||!l||!d||!m||f&&r.isOptionSelected(m,g))return;r.selectOption(m);break;case`Enter`:if(e.keyCode===229)break;if(l){if(!m||r.isComposing)return;r.selectOption(m);break}return;case`Escape`:l?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(``,{action:`menu-close`,prevInputValue:o}),r.onMenuClose()):s&&a&&r.clearValue();break;case` `:if(o)return;if(!l){r.openMenu(`first`);break}if(!m)return;r.selectOption(m);break;case`ArrowUp`:l?r.focusOption(`up`):r.openMenu(`last`);break;case`ArrowDown`:l?r.focusOption(`down`):r.openMenu(`first`);break;case`PageUp`:if(!l)return;r.focusOption(`pageup`);break;case`PageDown`:if(!l)return;r.focusOption(`pagedown`);break;case`Home`:if(!l)return;r.focusOption(`first`);break;case`End`:if(!l)return;r.focusOption(`last`);break;default:return}e.preventDefault()}},r.state.instancePrefix=`react-select-`+(r.props.instanceId||++Op),r.state.selectValue=Tu(e.value),e.menuIsOpen&&r.state.selectValue.length){var i=r.getFocusableOptionsWithIds(),a=r.buildFocusableOptions(),o=a.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=i,r.state.focusedOption=a[o],r.state.focusedOptionId=xp(i,a[o])}return r}return Ot(n,[{key:`componentDidMount`,value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener(`scroll`,this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Fu(this.menuListRef,this.focusedOptionRef),np()&&this.setState({isAppleDevice:!0})}},{key:`componentDidUpdate`,value:function(e){var t=this.props,n=t.isDisabled,r=t.menuIsOpen,i=this.state.isFocused;(i&&!n&&e.isDisabled||i&&r&&!e.menuIsOpen)&&this.focusInput(),i&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!i&&!n&&e.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Fu(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:`componentWillUnmount`,value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener(`scroll`,this.onScroll,!0)}},{key:`onMenuOpen`,value:function(){this.props.onMenuOpen()}},{key:`onMenuClose`,value:function(){this.onInputChange(``,{action:`menu-close`,prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:`onInputChange`,value:function(e,t){this.props.onInputChange(e,t)}},{key:`focusInput`,value:function(){this.inputRef&&this.inputRef.focus()}},{key:`blurInput`,value:function(){this.inputRef&&this.inputRef.blur()}},{key:`openMenu`,value:function(e){var t=this,n=this.state,r=n.selectValue,i=n.isFocused,a=this.buildFocusableOptions(),o=e===`first`?0:a.length-1;if(!this.props.isMulti){var s=a.indexOf(r[0]);s>-1&&(o=s)}this.scrollToFocusedOptionOnUpdate=!(i&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:a[o],focusedOptionId:this.getFocusedOptionId(a[o])},function(){return t.onMenuOpen()})}},{key:`focusValue`,value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var i=n.indexOf(r);r||(i=-1);var a=n.length-1,o=-1;if(n.length){switch(e){case`previous`:o=i===0?0:i===-1?a:i-1;break;case`next`:i>-1&&i0&&arguments[0]!==void 0?arguments[0]:`first`,t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var i=0,a=r.indexOf(n);n||(a=-1),e===`up`?i=a>0?a-1:r.length-1:e===`down`?i=(a+1)%r.length:e===`pageup`?(i=a-t,i<0&&(i=0)):e===`pagedown`?(i=a+t,i>r.length-1&&(i=r.length-1)):e===`last`&&(i=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[i],focusedValue:null,focusedOptionId:this.getFocusedOptionId(r[i])})}}},{key:`getTheme`,value:function(){return this.props.theme?typeof this.props.theme==`function`?this.props.theme(dp):B(B({},dp),this.props.theme):dp}},{key:`getCommonProps`,value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getClassNames,i=this.getValue,a=this.selectOption,o=this.setValue,s=this.props,c=s.isMulti,l=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:r,getValue:i,hasValue:this.hasValue(),isMulti:c,isRtl:l,options:u,selectOption:a,selectProps:s,setValue:o,theme:this.getTheme()}}},{key:`hasValue`,value:function(){return this.state.selectValue.length>0}},{key:`hasOptions`,value:function(){return!!this.getFocusableOptions().length}},{key:`isClearable`,value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return t===void 0?n:t}},{key:`isOptionDisabled`,value:function(e,t){return wp(this.props,e,t)}},{key:`isOptionSelected`,value:function(e,t){return Tp(this.props,e,t)}},{key:`filterOption`,value:function(e,t){return Ep(this.props,e,t)}},{key:`formatOptionLabel`,value:function(e,t){if(typeof this.props.formatOptionLabel==`function`){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}else return this.getOptionLabel(e)}},{key:`formatGroupLabel`,value:function(e){return this.props.formatGroupLabel(e)}},{key:`startListeningComposition`,value:function(){document&&document.addEventListener&&(document.addEventListener(`compositionstart`,this.onCompositionStart,!1),document.addEventListener(`compositionend`,this.onCompositionEnd,!1))}},{key:`stopListeningComposition`,value:function(){document&&document.removeEventListener&&(document.removeEventListener(`compositionstart`,this.onCompositionStart),document.removeEventListener(`compositionend`,this.onCompositionEnd))}},{key:`startListeningToTouch`,value:function(){document&&document.addEventListener&&(document.addEventListener(`touchstart`,this.onTouchStart,!1),document.addEventListener(`touchmove`,this.onTouchMove,!1),document.addEventListener(`touchend`,this.onTouchEnd,!1))}},{key:`stopListeningToTouch`,value:function(){document&&document.removeEventListener&&(document.removeEventListener(`touchstart`,this.onTouchStart),document.removeEventListener(`touchmove`,this.onTouchMove),document.removeEventListener(`touchend`,this.onTouchEnd))}},{key:`renderInput`,value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,i=e.inputValue,a=e.tabIndex,o=e.form,s=e.menuIsOpen,c=e.required,u=this.getComponents().Input,d=this.state,f=d.inputIsHidden,p=d.ariaSelection,m=this.commonProps,h=r||this.getElementId(`input`),g=B(B(B({"aria-autocomplete":`list`,"aria-expanded":s,"aria-haspopup":!0,"aria-errormessage":this.props[`aria-errormessage`],"aria-invalid":this.props[`aria-invalid`],"aria-label":this.props[`aria-label`],"aria-labelledby":this.props[`aria-labelledby`],"aria-required":c,role:`combobox`,"aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||``},s&&{"aria-controls":this.getElementId(`listbox`)}),!n&&{"aria-readonly":!0}),this.hasValue()?p?.action===`initial-input-focus`&&{"aria-describedby":this.getElementId(`live-region`)}:{"aria-describedby":this.getElementId(`placeholder`)});return n?K.createElement(u,l({},m,{autoCapitalize:`none`,autoComplete:`off`,autoCorrect:`off`,id:h,innerRef:this.getInputRef,isDisabled:t,isHidden:f,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:`false`,tabIndex:a,form:o,type:`text`,value:i},g)):K.createElement(Nf,l({id:h,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Su,onFocus:this.onInputFocus,disabled:t,tabIndex:a,inputMode:`none`,form:o,value:``},g))}},{key:`renderPlaceholderOrValue`,value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,i=t.MultiValueLabel,a=t.MultiValueRemove,o=t.SingleValue,s=t.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,f=u.isDisabled,p=u.isMulti,m=u.inputValue,h=u.placeholder,g=this.state,_=g.selectValue,v=g.focusedValue,y=g.isFocused;if(!this.hasValue()||!d)return m?null:K.createElement(s,l({},c,{key:`placeholder`,isDisabled:f,isFocused:y,innerProps:{id:this.getElementId(`placeholder`)}}),h);if(p)return _.map(function(t,o){var s=t===v,u=`${e.getOptionLabel(t)}-${e.getOptionValue(t)}`;return K.createElement(n,l({},c,{components:{Container:r,Label:i,Remove:a},isFocused:s,isDisabled:f,key:u,index:o,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,`value`))});if(m)return null;var b=_[0];return K.createElement(o,l({},c,{data:b,isDisabled:f}),this.formatOptionLabel(b,`value`))}},{key:`renderClearIndicator`,value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,a=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||i)return null;var o={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":`true`};return K.createElement(e,l({},t,{innerProps:o,isFocused:a}))}},{key:`renderLoadingIndicator`,value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,a=this.state.isFocused;return!e||!i?null:K.createElement(e,l({},t,{innerProps:{"aria-hidden":`true`},isDisabled:r,isFocused:a}))}},{key:`renderIndicatorSeparator`,value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,i=this.props.isDisabled,a=this.state.isFocused;return K.createElement(n,l({},r,{isDisabled:i,isFocused:a}))}},{key:`renderDropdownIndicator`,value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":`true`};return K.createElement(e,l({},t,{innerProps:i,isDisabled:n,isFocused:r}))}},{key:`renderMenu`,value:function(){var e=this,t=this.getComponents(),n=t.Group,r=t.GroupHeading,i=t.Menu,a=t.MenuList,o=t.MenuPortal,s=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,d=this.commonProps,f=this.state.focusedOption,p=this.props,m=p.captureMenuScroll,h=p.inputValue,g=p.isLoading,_=p.loadingMessage,v=p.minMenuHeight,y=p.maxMenuHeight,b=p.menuIsOpen,x=p.menuPlacement,S=p.menuPosition,C=p.menuPortalTarget,w=p.menuShouldBlockScroll,T=p.menuShouldScrollIntoView,E=p.noOptionsMessage,D=p.onMenuScrollToTop,O=p.onMenuScrollToBottom;if(!b)return null;var k=function(t,n){var r=t.type,i=t.data,a=t.isDisabled,o=t.isSelected,s=t.label,c=t.value,p=f===i,m=a?void 0:function(){return e.onOptionHover(i)},h=a?void 0:function(){return e.selectOption(i)},g=`${e.getElementId(`option`)}-${n}`,_={id:g,onClick:h,onMouseMove:m,onMouseOver:m,tabIndex:-1,role:`option`,"aria-selected":e.state.isAppleDevice?void 0:o};return K.createElement(u,l({},d,{innerProps:_,data:i,isDisabled:a,isSelected:o,key:g,label:s,type:r,value:c,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,`menu`))},A;if(this.hasOptions())A=this.getCategorizedOptions().map(function(t){if(t.type===`group`){var i=t.data,a=t.options,o=t.index,s=`${e.getElementId(`group`)}-${o}`,c=`${s}-heading`;return K.createElement(n,l({},d,{key:s,data:i,options:a,Heading:r,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return k(e,`${o}-${e.index}`)}))}else if(t.type===`option`)return k(t,`${t.index}`)});else if(g){var j=_({inputValue:h});if(j===null)return null;A=K.createElement(s,d,j)}else{var ee=E({inputValue:h});if(ee===null)return null;A=K.createElement(c,d,ee)}var te={minMenuHeight:v,maxMenuHeight:y,menuPlacement:x,menuPosition:S,menuShouldScrollIntoView:T},ne=K.createElement(nd,l({},d,te),function(t){var n=t.ref,r=t.placerProps,o=r.placement,s=r.maxHeight;return K.createElement(i,l({},d,te,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:o}),K.createElement(Jf,{captureEnabled:m,onTopArrive:D,onBottomArrive:O,lockEnabled:w},function(t){return K.createElement(a,l({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:`listbox`,"aria-multiselectable":d.isMulti,id:e.getElementId(`listbox`)},isLoading:g,maxHeight:s,focusedOption:f}),A)}))});return C||S===`fixed`?K.createElement(o,l({},d,{appendTo:C,controlElement:this.controlRef,menuPlacement:x,menuPosition:S}),ne):ne}},{key:`renderFormField`,value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,i=t.isMulti,a=t.name,o=t.required,s=this.state.selectValue;if(o&&!this.hasValue()&&!r)return K.createElement(Xf,{name:a,onFocus:this.onValueInputFocus});if(!(!a||r))if(i)if(n){var c=s.map(function(t){return e.getOptionValue(t)}).join(n);return K.createElement(`input`,{name:a,type:`hidden`,value:c})}else{var l=s.length>0?s.map(function(t,n){return K.createElement(`input`,{key:`i-${n}`,name:a,type:`hidden`,value:e.getOptionValue(t)})}):K.createElement(`input`,{name:a,type:`hidden`,value:``});return K.createElement(`div`,null,l)}else{var u=s[0]?this.getOptionValue(s[0]):``;return K.createElement(`input`,{name:a,type:`hidden`,value:u})}}},{key:`renderLiveRegion`,value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,a=t.isFocused,o=t.selectValue,s=this.getFocusableOptions();return K.createElement(bf,l({},e,{id:this.getElementId(`live-region`),ariaSelection:n,focusedOption:r,focusedValue:i,isFocused:a,selectValue:o,focusableOptions:s,isAppleDevice:this.state.isAppleDevice}))}},{key:`render`,value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,i=e.ValueContainer,a=this.props,o=a.className,s=a.id,c=a.isDisabled,u=a.menuIsOpen,d=this.state.isFocused,f=this.commonProps=this.getCommonProps();return K.createElement(r,l({},f,{className:o,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),K.createElement(t,l({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),K.createElement(i,l({},f,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),K.createElement(n,l({},f,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:`getDerivedStateFromProps`,value:function(e,t){var n=t.prevProps,r=t.clearFocusValueOnUpdate,i=t.inputIsHiddenAfterUpdate,a=t.ariaSelection,o=t.isFocused,s=t.prevWasFocused,c=t.instancePrefix,l=e.options,u=e.value,d=e.menuIsOpen,f=e.inputValue,p=e.isMulti,m=Tu(u),h={};if(n&&(u!==n.value||l!==n.options||d!==n.menuIsOpen||f!==n.inputValue)){var g=d?_p(e,m):[],_=d?gp(mp(e,m),`${c}-option`):[],v=r?yp(t,m):null,y=bp(t,g);h={selectValue:m,focusedOption:y,focusedOptionId:xp(_,y),focusableOptionsWithIds:_,focusedValue:v,clearFocusValueOnUpdate:!1}}var b=i!=null&&e!==n?{inputIsHidden:i,inputIsHiddenAfterUpdate:void 0}:{},x=a,S=o&&s;return o&&!S&&(x={value:Gu(p,m,m[0]||null),options:m,action:`initial-input-focus`},S=!s),a?.action===`initial-input-focus`&&(x=null),B(B(B({},h),b),{},{prevProps:e,ariaSelection:x,prevWasFocused:S})}}]),n}(K.Component);kp.defaultProps=fp;var Ap=(0,K.forwardRef)(function(e,t){var n=vu(e);return K.createElement(kp,l({ref:t},n))}),jp=[`allowCreateWhileLoading`,`createOptionPosition`,`formatCreateLabel`,`isValidNewOption`,`getNewOptionData`,`onCreateOption`,`options`,`onChange`],Mp=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=String(e).toLowerCase(),i=String(n.getOptionValue(t)).toLowerCase(),a=String(n.getOptionLabel(t)).toLowerCase();return i===r||a===r},Np={formatCreateLabel:function(e){return`Create "${e}"`},isValidNewOption:function(e,t,n,r){return!(!e||t.some(function(t){return Mp(e,t,r)})||n.some(function(t){return Mp(e,t,r)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};function Pp(e){var t=e.allowCreateWhileLoading,n=t!==void 0&&t,r=e.createOptionPosition,i=r===void 0?`last`:r,a=e.formatCreateLabel,o=a===void 0?Np.formatCreateLabel:a,s=e.isValidNewOption,c=s===void 0?Np.isValidNewOption:s,l=e.getNewOptionData,u=l===void 0?Np.getNewOptionData:l,d=e.onCreateOption,f=e.options,p=f===void 0?[]:f,m=e.onChange,h=qe(e,jp),g=h.getOptionValue,_=g===void 0?ap:g,v=h.getOptionLabel,y=v===void 0?ip:v,b=h.inputValue,x=h.isLoading,S=h.isMulti,C=h.value,w=h.name,T=(0,K.useMemo)(function(){return c(b,Tu(C),p,{getOptionValue:_,getOptionLabel:y})?u(b,o(b)):void 0},[o,u,y,_,b,c,p,C]),E=(0,K.useMemo)(function(){return(n||!x)&&T?i===`first`?[T].concat(Ze(p)):[].concat(Ze(p),[T]):p},[n,i,x,T,p]),D=(0,K.useCallback)(function(e,t){if(t.action!==`select-option`)return m(e,t);var n=Array.isArray(e)?e:[e];if(n[n.length-1]===T){if(d)d(b);else{var r=u(b,b),i={action:`create-option`,name:w,option:r};m(Gu(S,[].concat(Ze(Tu(C)),[r]),r),i)}return}m(e,t)},[u,b,S,w,T,d,m,C]);return B(B({},h),{},{options:E,onChange:D})}var Fp=(0,K.forwardRef)(function(e,t){var n=Pp(vu(e));return K.createElement(kp,l({ref:t},n))}),Ip=`__value`,Lp=RegExp(`^${Ip}\\d+__`),Rp=c(`div`,{target:`e12sxbnz0`})(`display:flex;flex-direction:column;align-items:stretch;margin-top:auto;margin-bottom:auto;.gdg-multi-select{font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);}`),zp=c(`div`,{target:`e12sxbnz1`})(`font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);color:var(--gdg-text-dark);> div{border-radius:0.25rem;border:1px solid var(--gdg-border-color);}`),Bp=e=>e.map(e=>typeof e==`string`?{value:e,label:e,color:void 0}:w(e)?{value:``,label:``,color:void 0}:{value:e.value,label:e.label??e.value??``,color:e.color}),Vp=(e,t,n)=>w(e)?[]:e.map((e,r)=>{let i=n?`${Ip}${r}__`:``,a=t.find(t=>t.value===e);return a?{...a,value:`${i}${a.value}`}:{value:`${i}${e}`,label:e}}),Hp=e=>{let{Menu:t}=df,{children:n,...r}=e;return o(t,{...r,children:n})},Up=e=>{let t=e.innerProps,n={...t,onMouseDown:e=>{e.stopPropagation(),t?.onMouseDown?.(e)},onTouchEnd:e=>{e.stopPropagation(),t?.onTouchEnd?.(e)}};return o(df.MultiValueLabel,{...e,innerProps:n})},Wp=()=>null,Gp=()=>null,Kp=e=>e.selectProps?.menuDisabled?null:o(zp,{children:o(Hp,{...e,className:[e.className,`click-outside-ignore`].filter(Boolean).join(` `)})}),qp=e=>{let{value:t,initialValue:n,onChange:r,onFinishedEditing:i}=e,{options:a,values:s,allowCreation:c,allowDuplicates:l}=t.data,u=Yt(),[d,f]=(0,K.useState)(s),[p,m]=(0,K.useState)(!0),[h,g]=(0,K.useState)(n??``),[_]=(0,K.useState)(()=>document.getElementById(Ee)),v=(0,K.useMemo)(()=>Bp(a??[]),[a]),y=c&&l&&v.length===0,b=(0,K.useCallback)(e=>{p&&e.stopPropagation()},[p]),x=(0,K.useCallback)(()=>m(!0),[]),S=(0,K.useCallback)(()=>m(!1),[]),C=(0,K.useCallback)(e=>c&&l&&e.inputValue?`Create "${e.inputValue}"`:void 0,[c,l]),w=(0,K.useMemo)(()=>({control:(e,t)=>({...e,border:0,boxShadow:`none`,backgroundColor:u.bgCell,pointerEvents:t.isDisabled?`auto`:e.pointerEvents,cursor:t.isDisabled?`default`:e.cursor}),valueContainer:e=>({...e,flexWrap:e.flexWrap??`wrap`,overflowX:`auto`,overflowY:`hidden`}),menu:e=>({...e,backgroundColor:u.bgCell}),option:(e,t)=>({...e,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark,...t.isFocused?{backgroundColor:u.accentLight,cursor:`pointer`}:{},":active":{...e[`:active`],color:u.accentFg,backgroundColor:u.accentColor}}),input:(e,{isDisabled:t})=>t?{display:`none`}:{...e,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark},placeholder:e=>({...e,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),noOptionsMessage:e=>({...e,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),clearIndicator:e=>({...e,color:u.textLight,":hover":{color:u.textDark,cursor:`pointer`}}),multiValue:(e,{data:t})=>({...e,backgroundColor:t.color??u.bgBubble,borderRadius:`${u.roundingRadius??u.bubbleHeight/2}px`,flexShrink:0,whiteSpace:`nowrap`}),multiValueLabel:(e,{data:t,isDisabled:n})=>({...e,paddingRight:n?u.bubblePadding:0,paddingLeft:u.bubblePadding,paddingTop:0,paddingBottom:0,color:t.color?qt(t.color)>.5?`black`:`white`:u.textBubble,fontSize:u.editorFontSize,fontFamily:u.fontFamily,justifyContent:`center`,alignItems:`center`,display:`flex`,height:u.bubbleHeight,whiteSpace:`nowrap`}),multiValueRemove:(e,{data:t,isDisabled:n,isFocused:r})=>n?{display:`none`}:{...e,color:t.color?qt(t.color)>.5?`black`:`white`:u.textBubble,backgroundColor:void 0,borderRadius:r?`${u.roundingRadius??u.bubbleHeight/2}px`:void 0,":hover":{cursor:`pointer`}}}),[u]),T=(0,K.useCallback)(e=>{let n=e.map(e=>l&&e.startsWith(Ip)?e.replace(new RegExp(Lp),``):e);f(n),r({...t,data:{...t.data,values:n}})},[t,r,l]),E=e=>{switch(e.key){case`Enter`:case`Tab`:if(!h){i(t,[0,1]);return}l&&c&&(g(``),T([...d??[],h]),m(!1),e.preventDefault())}},D=(0,K.useMemo)(()=>({DropdownIndicator:Wp,IndicatorSeparator:Gp,MultiValueLabel:Up,Menu:Kp}),[]),O=(0,K.useCallback)(e=>{e===null||!Array.isArray(e)||T(e.map(e=>e.value))},[T]);return o(Rp,{onKeyDown:b,"data-testid":`multi-select-cell`,children:o(c?Fp:Ap,{className:`gdg-multi-select`,isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:h,onInputChange:g,options:v,placeholder:t.readonly?``:c?`Add...`:void 0,noOptionsMessage:C,menuIsOpen:!t.readonly&&p,onMenuOpen:x,onMenuClose:S,value:Vp(d,v,l),onKeyDown:t.readonly?void 0:E,menuPlacement:`auto`,menuPortalTarget:_,autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:w,components:D,onChange:O,menuDisabled:y})})},Jp={kind:U.Custom,isMatch:e=>e.data.kind===`multi-select-cell`,draw:(e,t)=>{let{ctx:n,theme:r,rect:i,highlighted:a}=e,{values:o,options:s}=t.data;if(w(o))return!0;let c=Bp(s??[]),l={x:i.x+r.cellHorizontalPadding,y:i.y+r.cellVerticalPadding,width:i.width-2*r.cellHorizontalPadding,height:i.height-2*r.cellVerticalPadding},u=Math.max(1,Math.floor(l.height/(r.bubbleHeight+r.bubblePadding))),{x:d}=l,f=1,p=u===1?l.y+(l.height-r.bubbleHeight)/2:l.y+(l.height-u*r.bubbleHeight-(u-1)*r.bubblePadding)/2;for(let e of o){let t=c.find(t=>t.value===e),i=t?.color??(a?r.bgBubbleSelected:r.bgBubble),o=t?.label??e,s=Pi(o,n).width+r.bubblePadding*2,m=r.bubbleHeight/2;if(d!==l.x&&d+s>l.x+l.width&&f.5?`#000000`:`#ffffff`:r.textBubble,n.fillText(o,d+r.bubblePadding,p+m+Ii(n,r)),d+=s+r.bubbleMargin,d>l.x+l.width+r.cellHorizontalPadding&&f>=u)break}return!0},measure:(e,t,n)=>{let{values:r,options:i}=t.data;if(!r)return n.cellHorizontalPadding*2;let a=Vp(r,Bp(i??[]),t.data.allowDuplicates).map(e=>e.label??e.value),o=a.reduce((t,r)=>e.measureText(r).width+t+n.bubblePadding*2+n.bubbleMargin,0);return a.length===0?n.cellHorizontalPadding*2:o+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:qp,disablePadding:!0,deletedValue:e=>({...e,copyData:``,data:{...e.data,values:[]}})}),onPaste:(e,t)=>{if(!e?.trim())return{...t,values:[]};let n=e.split(`,`).map(e=>e.trim());if(t.allowDuplicates||(n=n.filter((e,t)=>n.indexOf(e)===t)),!t.allowCreation){let e=Bp(t.options??[]);n=n.filter(t=>e.find(e=>e.value===t))}if(n.length!==0)return{...t,values:n}}},Yp=`line_chart`,Xp=`area_chart`,Zp=`bar_chart`;function Qp(e,t,n,r){let i=ml({y_min:null,y_max:null,color:void 0},t.columnTypeOptions),a;a=i.color===`auto`||i.color===`auto-inverse`?r.colors.greenColor:i.color?Ce(i.color,r):void 0;let o={kind:U.Custom,allowOverlay:!1,copyData:``,contentAlign:t.contentAlignment,data:{kind:`sparkline-cell`,values:[],displayValues:[],graphKind:n,color:a,yAxis:[i.y_min??0,i.y_max??1]}};return{...t,kind:e,typeIcon:e===`line_chart`?`:material/show_chart:`:e===`bar_chart`?`:material/bar_chart:`:`:material/area_chart:`,sortMode:`default`,isEditable:!1,getCell(e){if(w(e))return dl();let t=hl(e),n=[],s;if(t.length===0)return dl();let c=-(2**53-1),l=2**53-1;for(let e=0;ec&&(c=r),r=0?0:c)}else u=i.y_max??c,d=i.y_min??l;if(w(d)||w(u)||Number.isNaN(d)||Number.isNaN(u)||d>=u)return al(`Invalid min/max y-axis configuration`,`The y_min (${d}) and y_max (${u}) configuration options must be valid numbers.`);s=n.length>0&&(c>u||lc-l===0?c>(u||1)?u:d:(u-d)*((e-l)/(c-l))+d):n;let f=a;return(i.color===`auto`&&s[0]>s[s.length-1]||i.color===`auto-inverse`&&s[0]fn(e)),yAxis:[d,u],color:f},isMissingValue:w(e)}},getCellValue(e){return e.kind===U.Loading||e.data?.values===void 0?null:e.data?.values}}}function $p(e,t){return Qp(Yp,e,`line`,t)}$p.isEditableType=!1;function em(e,t){return Qp(Zp,e,`bar`,t)}em.isEditableType=!1;function tm(e,t){return Qp(Xp,e,`area`,t)}tm.isEditableType=!1;function nm(e,t){let n={kind:U.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:`normal`};return{...e,kind:`checkbox`,typeIcon:`:material/check_box:`,sortMode:`default`,themeOverride:{roundingRadius:Math.round(Math.min(m(t.radii.sm),m(t.radii.maxCheckbox)))},getCell(e){let t=vl(e);return t===void 0?al($(e),`The value cannot be interpreted as boolean.`):{...n,data:t,isMissingValue:w(t)}},getCellValue(e){return e.data===void 0?null:e.data}}}nm.isEditableType=!0;function rm(e,t){return e=t.startsWith(`+`)||t.startsWith(`-`)?e.utcOffset(t,!1):e.tz(t),e}function im(e,t,n,r,i,a,o){let s=ml({format:n,step:r,timezone:o},t.columnTypeOptions),c;if(C(s.timezone))try{c=rm((0,nl.default)(),s.timezone)?.utcOffset()||void 0}catch{}let l;C(s.min_value)&&(l=Sl(s.min_value)||void 0);let u;C(s.max_value)&&(u=Sl(s.max_value)||void 0);let d={kind:U.Custom,allowOverlay:!0,copyData:``,readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isPinned?`faded`:`normal`,data:{kind:`date-picker-cell`,date:void 0,displayDate:``,step:s.step?.toString()||`1`,format:i,min:l,max:u}},f=e=>{let n=Sl(e);return n===null?!t.isRequired:!(n===void 0||C(l)&&a(n)a(u))};return{...t,kind:e,typeIcon:e===`date`?`:material/calendar_month:`:e===`time`?`:material/access_time:`:`:material/calendar_today:`,sortMode:`default`,validateInput:f,getCell(t,r){if(r===!0){let e=f(t);if(e===!1)return al($(t),`Invalid input.`);e instanceof Date&&(t=e)}let i=Sl(t),a=``,o=``,l=c;if(i===void 0)return al($(t),`The value cannot be interpreted as a datetime object.`);if(i!==null){let t=nl.default.utc(i);if(!t.isValid())return al($(i),`Invalid moment date. This should never happen. Please report this bug. \nError: ${t.toString()}`);if(s.timezone){try{t=rm(t,s.timezone)}catch(e){return al(t.toISOString(),`Failed to adjust to the provided timezone: ${s.timezone}. \nError: ${e}`)}l=t.utcOffset()}try{o=pn(t,s.format||n,e)}catch(e){return al(t.toISOString(),`Failed to format the date for rendering with: ${s.format}. \nError: ${e}`)}a=pn(t,n,e)}return{...d,copyData:a,isMissingValue:w(i),data:{...d.data,date:i,displayDate:o,timezoneOffset:l}}},getCellValue(e){return w(e?.data?.date)?null:a(e.data.date)},valuesEqual(e,t){let n=Date.parse(String(e)),r=Date.parse(String(t));return!Number.isNaN(n)&&!Number.isNaN(r)?n===r:Object.is(e,t)}}}function am(e){let t=`YYYY-MM-DD HH:mm:ss`,n=e.columnTypeOptions?.step;n!==void 0&&n>=60?t=`YYYY-MM-DD HH:mm`:n!==void 0&&n<1&&(t=`YYYY-MM-DD HH:mm:ss.SSS`);let r=ie(e.arrowType),i=C(r)||C(e?.columnTypeOptions?.timezone);return im(`datetime`,e,i?t+`Z`:t,1,`datetime-local`,e=>i?e.toISOString():e.toISOString().replace(`Z`,``),r)}am.isEditableType=!0;function om(e){let t=`HH:mm:ss`,n=e.columnTypeOptions?.step;return n!==void 0&&n>=60?t=`HH:mm`:n!==void 0&&n<1&&(t=`HH:mm:ss.SSS`),im(`time`,e,t,1,`time`,e=>e.toISOString().split(`T`)[1].replace(`Z`,``))}om.isEditableType=!0;function sm(e){return im(`date`,e,`YYYY-MM-DD`,1,`date`,e=>e.toISOString().split(`T`)[0])}sm.isEditableType=!0;function cm(e){let t={kind:U.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||`center`,style:`normal`};return{...e,kind:`image`,typeIcon:`:material/image:`,sortMode:`default`,isEditable:!1,getCell(e){let n=C(e)?[$(e)]:[];return{...t,data:n,isMissingValue:!C(e),displayData:n}},getCellValue(e){return e.data===void 0||e.data.length===0?null:e.data[0]}}}cm.isEditableType=!1;function lm(e){let t={kind:U.Custom,allowOverlay:!0,contentAlign:e.contentAlignment,readonly:!0,style:e.isPinned?`faded`:`normal`,copyData:``,data:{kind:`json-cell`,value:``}};return{...e,kind:`json`,typeIcon:`:material/code_blocks:`,sortMode:`default`,isEditable:!1,getCell(e){try{let n=C(e)?El(xl(e)):``;return{...t,copyData:n,isMissingValue:w(e),data:{...t.data,value:e,displayValue:n}}}catch(t){return al($(e),`The value cannot be interpreted as a JSON string. Error: ${t}`)}},getCellValue(e){return e.data?.value??null},valuesEqual(e,t){return(typeof e==`string`?e:JSON.stringify(e))===(typeof t==`string`?t:JSON.stringify(t))}}}lm.isEditableType=!1;function um(e){let t=e.columnTypeOptions||{},n;if(t.validate)try{n=new RegExp(t.validate,`us`)}catch(e){n=`Invalid validate regex: ${t.validate}.\nError: ${e}`}let r=!1,i=t.display_text,a;if(!w(i)){if(i.startsWith(`:material/`)&&ke(i))i=Oe(i).icon,r=!0;else if(i.includes(`(`)&&i.includes(`)`))try{a=new RegExp(i,`us`)}catch{a=void 0}}let o={kind:U.Uri,readonly:!e.isEditable,allowOverlay:!r,contentAlign:e.contentAlignment??(r?`center`:void 0),style:`normal`,hoverEffect:!0,data:``,displayData:``,copyData:``,...r&&{themeOverride:{fontFamily:f.iconFont,linkColor:void 0}}},s=r=>{if(w(r))return!e.isRequired;let i=$(r);return!(t.max_chars&&i.length>t.max_chars||n instanceof RegExp&&n.test(i)===!1)};return{...e,kind:`link`,typeIcon:`:material/link:`,sortMode:`default`,validateInput:s,getCell(e,t){if(w(e))return{...o,data:null,isMissingValue:!0,onClickUri:()=>{},themeOverride:void 0};let r=$(e);if(typeof n==`string`)return al($(r),n);if(t&&s(r)===!1)return al($(r),`Invalid input.`);let c=``;return r&&(c=a===void 0?i||r:Dl(a,r)),{...o,data:r,displayData:c,isMissingValue:w(r),onClickUri:e=>{window.open(r.startsWith(`www.`)?`https://${r}`:r,`_blank`,`noopener,noreferrer`),e.preventDefault()},copyData:r}},getCellValue(e){return w(e.data)?null:e.data}}}um.isEditableType=!0;function dm(e){let t={kind:U.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:`normal`,copyData:``,data:{kind:`multi-select-cell`,values:[],options:void 0,allowCreation:!0,allowDuplicates:!0}};return{...e,kind:`list`,sortMode:`default`,typeIcon:`:material/list:`,getCell(n){if(w(n))return{...t,data:{...t.data,values:null},isMissingValue:!0,copyData:``};let r=hl(n);return{...t,data:{...t.data,values:r},copyData:bl(r),...e.isEditable&&!gl(n)&&{readonly:!0,isError:!0,errorDetails:`Editing of arrays with non-string values is not supported. Please disable editing or convert all values to strings.`}}},getCellValue(e){return w(e.data?.values)?null:e.data.values},valuesEqual:ll}}dm.isEditableType=!0;function fm(e){let t={kind:U.Custom,allowOverlay:!0,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?`faded`:`normal`,copyData:``,data:{kind:`markdown-cell`,value:null,displayValue:``}},n=t=>!(w(t)&&e.isRequired);return{...e,kind:`markdown`,sortMode:`default`,typeIcon:`:material/markdown:`,validateInput:n,getCell(e,r){if(r&&!n(e))return al($(e),`Invalid input.`);let i=C(e)?$(e):null;return{...t,copyData:i??``,isMissingValue:w(i),data:{...t.data,value:i,displayValue:i?El(i):``}}},getCellValue(e){return e.data?.value??null}}}fm.isEditableType=!0;var pm={audio:`:material/audio_file:`,video:`:material/video_file:`};function mm(e,t){let n={kind:U.Custom,allowOverlay:!0,contentAlign:t.contentAlignment||`center`,readonly:!0,copyData:``,data:{kind:`media-cell`,mediaType:e,src:null}};return{...t,kind:e,typeIcon:pm[e],sortMode:`default`,isEditable:!1,getCell(t){let r=C(t)?$(t):null;return{...n,copyData:r??``,isMissingValue:w(t),data:{kind:`media-cell`,mediaType:e,src:r}}},getCellValue(e){return e.data?.src??null}}}function hm(e){return mm(`audio`,e)}hm.isEditableType=!1;function gm(e){return mm(`video`,e)}gm.isEditableType=!1;var _m=(e,t)=>{if(w(e))return[];let n=t.colors.chartCategoricalColors,r=Se(t),i=0;return e.filter(e=>e!==null&&e!==``).map(e=>{if(typeof e==`string`)return{value:$(e).trim(),label:void 0,color:void 0};let a;e.color===`auto`?(a=be(n[i%n.length],r?.7:.6),i+=1):e.color&&(a=L(e.color,t));let o=a?_(a,t.colors.bgColor):void 0;return{value:$(e.value).trim(),label:e.label??void 0,color:o}})};function vm(e,t){let n=ml({options:[],accept_new_options:!1},e.columnTypeOptions),r=_m(n.options,t),i=new Set(r.map(e=>e.value)),a={kind:U.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?`faded`:`normal`,data:{kind:`multi-select-cell`,values:[],options:r,allowCreation:n.accept_new_options??!1,allowDuplicates:!1},copyData:``};return{...e,kind:`multiselect`,sortMode:`default`,typeIcon:`:material/checklist:`,getCell(t,r){if(w(t))return{...a,data:{...a.data,values:null},isMissingValue:!0,copyData:``};let o=hl(t).map(e=>$(e).trim());return r&&o.length>0&&n.accept_new_options===!1&&(o=o.filter(e=>i.has(e)),o.length===0)?al($(t),`The values could not be matched with the configured options.`):{...a,data:{...a.data,values:o},copyData:bl(o),...e.isEditable&&!gl(t)&&{readonly:!0,isError:!0,errorDetails:`Editing of arrays with non-string values is not supported. Please disable editing or convert all values to strings.`}}},getCellValue(e){return w(e.data?.values)?null:e.data.values},valuesEqual:ll}}vm.isEditableType=!0;function ym(e){let t=ml({step:te(e.arrowType)?1:void 0,min_value:ee(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(N(e.arrowType)||_e(e.arrowType)),r=w(t.min_value)||t.min_value<0,i=C(t.step)&&!Number.isNaN(t.step)?Cl(t.step):void 0,a={kind:U.Number,data:void 0,displayData:``,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment??(n?`left`:`right`),style:e.isPinned?`faded`:`normal`,allowNegative:r,fixedDecimals:i,thousandSeparator:``},o=n=>{let r=yl(n);if(w(r))return!e.isRequired;if(Number.isNaN(r))return!1;let i=!1;return C(t.max_value)&&r>t.max_value&&(r=t.max_value,i=!0),C(t.min_value)&&r=r.max_value)return al(`Invalid min/max parameters`,`The min_value (${r.min_value}) and max_value (${r.max_value}) parameters must be valid numbers.`);if(C(r.step)&&Number.isNaN(r.step))return al(`Invalid step parameter`,`The step parameter (${r.step}) must be a valid number.`);let n=yl(e);if(Number.isNaN(n)||w(n))return al($(e),`The value cannot be interpreted as a number.`);if(Number.isInteger(n)&&!Number.isSafeInteger(n))return al($(e),`The value is larger than the maximum supported integer values in number columns (2^53).`);let s;try{s=fn(n,r.format,i)}catch(e){return al($(n),C(r.format)?`Failed to format the number based on the provided format configuration: (${r.format}). Error: ${e}`:`Failed to format the number. Error: ${e}`)}let c=Math.min(r.max_value,Math.max(r.min_value,n)),l;if(r.color===`auto`||r.color===`auto-inverse`){let e=r.max_value-r.min_value,n=(e===0?0:(c-r.min_value)/e)>.5;l=r.color===`auto`?n?t?.colors.greenColor:t?.colors.redColor:n?t?.colors.redColor:t?.colors.greenColor}else r.color&&(l=Ce(r.color,t));return{...o,isMissingValue:w(e),copyData:String(n),data:{...o.data,value:c,label:s,measureLabel:s.length>a.length?s:a,color:l}}},getCellValue(e){return e.kind===U.Loading||e.data?.value===void 0?null:e.data?.value}}}xm.isEditableType=!1;var Sm=e=>w(e)?[]:e.filter(e=>C(e)&&e!==``).map(e=>{if(typeof e==`object`&&`value`in e){let t=$(e.value).trim();return{value:t,label:e.label??t}}let t=$(e).trim();return{value:t,label:t}});function Cm(e){let t=`string`,n=ml({options:P(e.arrowType)?[!0,!1]:e.arrowType.categoricalOptions??[]},e.columnTypeOptions),r=e=>typeof e==`object`&&!!e&&`value`in e,i=new Set(n.options.map(e=>r(e)?typeof e.value:typeof e));i.size===1&&(i.has(`number`)||i.has(`bigint`)?t=`number`:i.has(`boolean`)&&(t=`boolean`));let a=Sm(n.options),o={kind:U.Custom,allowOverlay:!0,copyData:``,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?`faded`:`normal`,data:{kind:`dropdown-cell`,allowedValues:[...e.isRequired===!0?[]:[null],...a],value:``}};return{...e,kind:`selectbox`,sortMode:`default`,typeIcon:`:material/arrow_drop_down_circle:`,getCell(e,t){let n=null;return C(e)&&e!==``&&(n=$(e)),t&&!o.data.allowedValues.some(e=>e===null?n===null:typeof e==`string`?e===n:typeof e==`object`&&`value`in e&&e.value===n)?al($(n),`The value is not part of the allowed options.`):{...o,isMissingValue:n===null,copyData:n||``,data:{...o.data,value:n}}},getCellValue(e){return w(e.data?.value)||e.data?.value===``?null:t===`number`?yl(e.data?.value)??null:t===`boolean`?vl(e.data?.value)??null:e.data?.value}}}Cm.isEditableType=!0;function wm(e){let t=e.columnTypeOptions||{},n;if(t.validate)try{n=new RegExp(t.validate,`us`)}catch(e){n=`Invalid validate regex: ${t.validate}.\nError: ${e}`}let r={kind:U.Text,data:``,displayData:``,allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?`faded`:`normal`},i=r=>{if(w(r))return!e.isRequired;let i=$(r),a=!1;return t.max_chars&&i.length>t.max_chars&&(i=i.slice(0,t.max_chars),a=!0),n instanceof RegExp&&n.test(i)===!1?!1:!a||i};return{...e,kind:`text`,sortMode:`default`,typeIcon:`:material/notes:`,validateInput:i,getCell(e,t){if(typeof n==`string`)return al($(e),n);if(t){let t=i(e);if(t===!1)return al($(e),`Invalid input.`);typeof t==`string`&&(e=t)}try{let t=C(e)?$(e):null,n=C(t)?El(t):``;return{...r,isMissingValue:w(t),data:t,displayData:n}}catch(e){return al(`Incompatible value`,`The value cannot be interpreted as string. Error: ${e}`)}},getCellValue(e){return e.data===void 0?null:e.data}}}wm.isEditableType=!0;var Tm=c(`img`,{target:`e16b5pc80`})({maxWidth:`100%`,maxHeight:`37.5rem`,objectFit:`scale-down`}),Em=({urls:e})=>{let t=e&&e.length>0?e[0]:``;return t.startsWith(`http`)?o(`a`,{href:t,target:`_blank`,rel:`noreferrer noopener`,children:o(Tm,{src:t})}):o(Tm,{src:t})},Dm=new Map(Object.entries({object:bm,text:wm,checkbox:nm,selectbox:Cm,list:dm,multiselect:vm,number:ym,link:um,button:Ol,datetime:am,date:sm,time:om,line_chart:$p,bar_chart:em,area_chart:tm,image:cm,audio:hm,video:gm,progress:xm,json:lm,markdown:fm})),Om=[$l,du,gu,Jp,ql];on();function km(e,t,n){if(!n.includes(t))return;let r=RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,`gm`);n=n.replace(/{/g,` {`);let i=r.exec(n);if(i)return i[1].trim()}function Am(e,t,n){let r={};if(!n.includes(t))return e;let i=km(t,`color`,n);i&&(r.textDark=i,(e.kind===U.Bubble||e.kind===U.Custom&&e.data?.kind===`multi-select-cell`)&&(r.textBubble=i),e.kind===U.Uri&&(r.linkColor=i));let a=km(t,`background-color`,n);a&&(r.bgCell=a),a===`yellow`&&i===void 0&&(r.textDark=`#31333F`);let o=km(t,`font-weight`,n);return o&&(r.baseFontStyle=`${o} ${g.sm}`),r?{...e,themeOverride:r}:e}function jm(e){return A(e)||M(e)?wm:ue(e)?am:ge(e)?om:oe(e)?sm:re(e)||me(e)?bm:P(e)?nm:ve(e)?ym:ae(e)?Cm:he(e)?dm:bm}function Mm(e){return{title:e.length>0?e[e.length-1]:``,group:e.length>1?e.slice(0,-1).filter(e=>e!==``).join(` / `):void 0}}function Nm(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function Pm(e,t){let{title:n,group:r}=Mm(e.columnNames.map(e=>e[t])),i=e.columnTypes[t],a=!0;return j(i)&&(a=!1),Nm({id:`_index-${t}`,indexNumber:t,name:n,title:n,group:r,isEditable:a,arrowType:i,isIndex:!0,isPinned:!0})}function Fm(e,t){let{title:n,group:r}=Mm(e.columnNames.map(e=>e[t])),i=e.columnTypes[t];return Nm({id:`_column-${n}-${t}`,indexNumber:t,name:n,isEditable:!0,title:n,arrowType:i,group:r})}function Im(){return Nm({id:`_empty-index`,indexNumber:0,title:``,name:``,isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:fe.INDEX,arrowField:new Ct(``,new xt,!0),pandasType:void 0}})}function Lm(e){let t=[],{dimensions:n}=e,r=n.numIndexColumns,i=n.numDataColumns;if(r===0&&i===0)return t.push(Im()),t;for(let n=0;nh(e,t,(e,t)=>{if(T(t))return t});function $m(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(`_index`)&&(n=Qm(n,t.get(`_index`)??{})),t.has(`_pos:${e.indexNumber}`)&&(n=Qm(n,t.get(`_pos:${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==`_index`&&(n=Qm(n,t.get(e.name)??{})),t.has(e.id)&&(n=Qm(n,t.get(e.id)??{})),ye(n)?e:D({...e},{title:n.label,width:Xm(n.width),isEditable:C(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:Zm(n.alignment),defaultValue:n.default,help:n.help})}function eh(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(e){return Ym.error(e),new Map}}function th(e){let t=e.columnTypeOptions?.type,n;return C(t)&&(Dm.has(t)?n=Dm.get(t):Ym.warn(`Unknown column type configured in column configuration: ${t}`)),w(n)&&(n=jm(e.arrowType)),n}function nh(e,t,n,r,i){let a=H(),o=(0,K.useMemo)(()=>eh(e.columns),[e.columns]),[s,c]=(0,K.useState)(o);(0,K.useEffect)(()=>{c(o)},[o]);let l=(0,K.useMemo)(()=>zm(i),[i]),u=(0,K.useMemo)(()=>Bm(i),[i]),d=l||C(u)&&u>0,f=C(e.rowHeight)&&e.rowHeight>m(`4rem`),p=(0,K.useMemo)(()=>Lm(t).map(t=>{let r={...t,...$m(t,s),isStretched:d},i=th(r);return(e.editingMode===S.EditingMode.READ_ONLY||n||i.isEditableType===!1)&&(r={...r,isEditable:!1}),e.editingMode!==S.EditingMode.READ_ONLY&&r.isEditable==1&&(r={...r,icon:`editable`},r.isRequired&&e.editingMode===S.EditingMode.DYNAMIC&&(r={...r,isHidden:!1})),i(r,a)}),[t,s,d,e.editingMode,n,a]);return{columns:(0,K.useMemo)(()=>{let i=Lm(t).map(t=>{let r={...t,...$m(t,s),isStretched:d,isWrappingAllowed:f},i=th(r);return(e.editingMode===S.EditingMode.READ_ONLY||n||i.isEditableType===!1)&&(r={...r,isEditable:!1}),e.editingMode!==S.EditingMode.READ_ONLY&&r.isEditable==1&&(r={...r,icon:`editable`},r.isRequired&&e.editingMode===S.EditingMode.DYNAMIC&&(r={...r,isHidden:!1})),i(r,a)}).filter(e=>!e.isHidden),o=[],c=[];r?.length?(i.forEach(e=>{e.isIndex&&!r.includes(e.name)&&!r.includes(e.id)&&e.isPinned!==!1&&o.push(e)}),r.forEach(e=>{let t=i.find(t=>t.name===e||t.id===e);t&&(t.isPinned?o.push(t):c.push(t))})):i.forEach(e=>{e.isPinned?o.push(e):c.push(e)});let l=[...o,...c];return l.length>0?l:[bm(Im())]},[t,s,f,d,n,e.editingMode,r,a]),allColumns:p,setColumnConfigMapping:c}}function rh(e,t){return[...e.isIndex?[Km]:[],e.name,`${qm}${e.indexNumber}`].find(e=>!!t[e])}function ih({element:e,widgetMgr:t,fragmentId:n,columns:r,getCellContent:i,getOriginalIndex:a,theme:o,disabled:s}){let[c,l]=(0,K.useState)(),u=(0,K.useRef)(null),d=(0,K.useCallback)(()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)},[]),f=(0,K.useCallback)(()=>{d(),l(void 0)},[d]),p=(0,K.useRef)(c);p.current=c,(0,K.useEffect)(()=>()=>{d()},[d]);let m=(0,K.useCallback)((r,i,a)=>{if(f(),s||!t)return;let o=e.buttonClickWidgets[r];if(!o)return;let c=JSON.stringify({row:i,label:a});t.setStringTriggerValue({id:o,formId:e.formId},c,{fromUi:!0},n)},[f,s,t,e.buttonClickWidgets,e.formId,n]),h=(0,K.useCallback)(e=>{let t=p.current;t&&m(t.columnName,t.rowIndex,e)},[m]),g=(0,K.useCallback)((e,t,n,r)=>{d(),l(void 0),u.current=requestAnimationFrame(()=>{u.current=null,l({columnName:e,rowIndex:t,actions:n,screenTop:r.clickY,screenLeft:r.clickX})})},[d]),_=(0,K.useCallback)(()=>{(p.current!==void 0||u.current!==null)&&f()},[f]);return{buttonActionMenu:c,clearButtonActionMenu:f,handleMenuSelectAction:h,onCellClicked:(0,K.useCallback)(([t,n],c)=>{if(s){_();return}let l=r[t];if(l===void 0){_();return}let u=i([t,n]);if(!Gl(u)){_();return}let d=rh(l,e.buttonClickWidgets);if(d===void 0){_();return}let f=Kl(u,{bounds:c.bounds,posX:c.localEventX,posY:c.localEventY,theme:o});if(f===void 0){_();return}c.preventDefault();let p=a(n);f.kind===`button`?m(d,p,f.label):g(d,p,f.actions,f.bounds)},[_,r,s,e.buttonClickWidgets,i,a,m,g,o])}}var ah=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{let r=new Map(t),i=r.get(e),a={...i,...n};return(i?.type_config||n?.type_config)&&(a.type_config={...i?.type_config,...n?.type_config}),r.set(e,a),r};function oh(e){return{changeColumnFormat:(0,K.useCallback)((t,n)=>{e(e=>ah({columnId:t,columnConfigMapping:e,updatedProps:{type_config:{format:n}}}))},[e])}}function sh(e,t,n,r,i,a){let o=(0,K.useMemo)(()=>e.filter(e=>e.isPinned).reduce((e,t)=>e+(t.width??r*2),0)>n*.6,[e,n,r]),s=t||o?0:e.filter(e=>e.isPinned).length,c=(0,K.useCallback)(e=>{a(t=>ah({columnId:e,columnConfigMapping:t,updatedProps:{pinned:!1}})),i(!0,!1)},[i,a]);return{pinColumn:(0,K.useCallback)(e=>{a(t=>ah({columnId:e,columnConfigMapping:t,updatedProps:{pinned:!0}})),i(!0,!1)},[i,a]),unpinColumn:c,freezeColumns:s}}function ch(e,t,n,r,i){return{onColumnMoved:(0,K.useCallback)((a,o)=>{let s=[...e],[c]=s.splice(a,1);s.splice(o,0,c),o=t&&c.isPinned&&r(c.id),i(s.map(e=>e.id))},[e,t,n,r,i])}}function lh(e){let[t,n]=(0,K.useState)(()=>new Map),r=(0,K.useCallback)((e,r,i,a)=>{e.id&&n(new Map(t).set(e.id,a))},[t]);return{columns:(0,K.useMemo)(()=>e.map(e=>e.id&&t.has(e.id)&&t.get(e.id)!==void 0?{...e,width:t.get(e.id),grow:0}:e),[e,t]),onColumnResize:r}}function uh(e){switch(e.kind){case U.Number:return e.data?.toString()??``;case U.Boolean:return e.data?.toString()??``;case U.Markdown:case U.RowID:case U.Text:case U.Uri:return e.data??``;case U.Bubble:case U.Image:return e.data.join(``);case U.Drilldown:return e.data.map(e=>e.text).join(``);case U.Protected:case U.Loading:return``;case U.Custom:return e.copyData}}function dh(e){if(typeof e==`number`)return e;if(e.length>0){let t=Number(e);isNaN(t)||(e=t)}return e}function fh(e,t){return e=dh(e),t=dh(t),typeof e==`string`&&typeof t==`string`?e.localeCompare(t):typeof e==`number`&&typeof t==`number`?e===t?0:e>t?1:-1:e==t?0:e>t?1:-1}function ph(e,t){return e>t?1:e===t?0:-1}function mh(e){let{sort:t,rows:n,getCellContent:r}=e,i=K.useMemo(()=>t===void 0?[]:Array.isArray(t)?t:[t],[t]),a=K.useMemo(()=>i.map(t=>{let n=e.columns.findIndex(e=>t.column===e||e.id!==void 0&&t.column.id===e.id);return n===-1?void 0:n}),[i,e.columns]),o=K.useMemo(()=>{let e=i.map((e,t)=>({sort:e,col:a[t]})).filter(e=>e.col!==void 0);if(e.length===0)return;let t=e.map(()=>Array(n));for(let i=0;i{for(let i=0;io===void 0?e:o[e],[o]),c=K.useCallback(([e,t])=>(o===void 0||(t=o[t]),r([e,t])),[r,o]);return o===void 0?{getCellContent:e.getCellContent,getOriginalIndex:s}:{getOriginalIndex:s,getCellContent:c}}function hh(e,t){return t===void 0?e:e.map(e=>e.id===t.column.id?{...e,title:t.direction===`asc`?`↑ ${e.title}`:`↓ ${e.title}`}:e)}function gh(e,t,n){let[r,i]=(0,K.useState)(),{getCellContent:a,getOriginalIndex:o}=mh({columns:t.map(e=>pl(e)),getCellContent:n,rows:e,sort:r}),s=(0,K.useMemo)(()=>hh(t,r),[t,r]);return{columns:s,sortColumn:(0,K.useCallback)((e,t,n)=>{let a=s[e],o;t===`auto`?(o=`asc`,r?.column.id===a.id&&(o=r.direction===`asc`?`desc`:void 0)):o=t,o===void 0||n&&o===r?.direction?i(void 0):i({column:pl(a),direction:o,mode:a.sortMode})},[r,s]),getOriginalIndex:o,getCellContent:a}}function _h(e,t){return{hideColumn:(0,K.useCallback)(n=>{t(e=>ah({columnId:n,columnConfigMapping:e,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),showColumn:(0,K.useCallback)(n=>{t(e=>ah({columnId:n,columnConfigMapping:e,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t])}}function vh(){return{provideEditor:(0,K.useCallback)(e=>{if(e.kind===U.Text&&e.readonly&&_l(e.data))return{editor:Ql}},[])}}var yh={kind:U.Custom,isMatch:e=>e.data.kind===`sparkline-cell`,needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{let{ctx:n,theme:r,rect:i,hoverAmount:a,hoverX:o}=e,{values:s,yAxis:c,color:l,graphKind:u=`area`,displayValues:d,hideAxis:f}=t.data,[p,m]=c;if(s.length===0)return!0;s=s.map(e=>Math.min(1,Math.max(0,(e-p)/(m-p))));let h=r.cellHorizontalPadding,g=h+i.x,_=i.y+3,v=i.height-6,y=i.width-h*2,b=m-p,x=m<=0?_:p>=0?_+v:_+m/b*v;if(!f&&p<=0&&m>=0&&(n.beginPath(),n.moveTo(g,x),n.lineTo(g+y,x),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),u===`bar`){n.beginPath();let e=(y-(s.length-1)*2)/s.length,i=g;for(let t of s){let r=_+v-t*v;n.moveTo(i,x),n.lineTo(i+e,x),n.lineTo(i+e,r),n.lineTo(i,r),i+=e+2}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{s.length===1&&(s=[s[0],s[0]],d&&=[d[0],d[0]]),n.beginPath();let e=(i.width-16)/(s.length-1),t=s.map((t,n)=>({x:g+e*n,y:_+v-t*v}));n.moveTo(t[0].x,t[0].y);let c=0;if(t.length>2)for(c=1;cvoid 0,onPaste:(e,t)=>t};function bh(e,t,n,r,i,a){if(!(r<=0||i<=0)){if(typeof a==`number`&&a<=0){e.rect(t,n,r,i);return}typeof a==`number`&&(a={tl:a,tr:a,br:a,bl:a}),a={tl:Math.min(a.tl,i/2,r/2),tr:Math.min(a.tr,i/2,r/2),bl:Math.min(a.bl,i/2,r/2),br:Math.min(a.br,i/2,r/2)},a.tl=Math.max(0,a.tl),a.tr=Math.max(0,a.tr),a.br=Math.max(0,a.br),a.bl=Math.max(0,a.bl),e.moveTo(t+a.tl,n),e.arcTo(t+r,n,t+r,n+a.tr,a.tr),e.arcTo(t+r,n+i,t+r-a.br,n+i,a.br),e.arcTo(t,n+i,t,n+i-a.bl,a.bl),e.arcTo(t,n,t+a.tl,n,a.tl)}}var xh=e=>{let{Menu:t}=df,{children:n,...r}=e;return K.createElement(t,{...r},n)},Sh=an(`div`)({name:`Wrap`,class:`gdg-wghi2zc`,propsAsIs:!1}),Ch=an(`div`)({name:`PortalWrap`,class:`gdg-p13nj8j0`,propsAsIs:!1}),wh=an(`div`)({name:`ReadOnlyWrap`,class:`gdg-r6sia3g`,propsAsIs:!1}),Th=e=>{let{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:i}=e,{allowedValues:a,value:o}=t.data,[s,c]=K.useState(o),[l,u]=K.useState(r??``),d=Yt(),f=K.useMemo(()=>a.map(e=>typeof e==`string`||e==null?{value:e,label:e?.toString()??``}:e),[a]);return t.readonly?K.createElement(wh,null,K.createElement(ii,{highlight:!0,autoFocus:!1,disabled:!0,value:s??``,onChange:()=>void 0})):K.createElement(Sh,null,K.createElement(Ap,{className:`glide-select`,inputValue:l,onInputChange:u,menuPlacement:`auto`,value:f.find(e=>e.value===s),styles:{control:e=>({...e,border:0,boxShadow:`none`}),option:(e,{isFocused:t})=>({...e,fontSize:d.editorFontSize,fontFamily:d.fontFamily,cursor:t?`pointer`:void 0,paddingLeft:d.cellHorizontalPadding,paddingRight:d.cellHorizontalPadding,":active":{...e[`:active`],color:d.accentFg},":empty::after":{content:`" "`,visibility:`hidden`}})},theme:e=>({...e,colors:{...e.colors,neutral0:d.bgCell,neutral5:d.bgCell,neutral10:d.bgCell,neutral20:d.bgCellMedium,neutral30:d.bgCellMedium,neutral40:d.bgCellMedium,neutral50:d.textLight,neutral60:d.textMedium,neutral70:d.textMedium,neutral80:d.textDark,neutral90:d.textDark,neutral100:d.textDark,primary:d.accentColor,primary75:d.accentColor,primary50:d.accentColor,primary25:d.accentLight}}),menuPortalTarget:i?.current??document.getElementById(`portal`),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:e=>K.createElement(Ch,null,K.createElement(xh,{className:`click-outside-ignore`,...e}))},options:f,onChange:async e=>{e!==null&&(c(e.value),await new Promise(e=>window.requestAnimationFrame(e)),n({...t,data:{...t.data,value:e.value}}))}}))},Eh={kind:U.Custom,isMatch:e=>e.data.kind===`dropdown-cell`,draw:(e,t)=>{let{ctx:n,theme:r,rect:i}=e,{value:a}=t.data,o=t.data.allowedValues.find(e=>typeof e==`string`||e==null?e===a:e.value===a),s=typeof o==`string`?o:o?.label??``;return s&&(n.fillStyle=r.textDark,n.fillText(s,i.x+r.cellHorizontalPadding,i.y+i.height/2+Ii(n,r))),!0},measure:(e,t,n)=>{let{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Th,disablePadding:!0,deletedValue:e=>({...e,copyData:``,data:{...e.data,value:``}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.some(t=>t==null?!1:typeof t==`string`?t===e:t.value===e)?e:t.value})};function Dh(e,t){let n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){let i=parseFloat(r[1]),a=r[2],o=i*t;return e.replace(n,`${Number(o.toPrecision(3))}${a}`)}return e}var Oh={marginRight:8},kh={display:`flex`,alignItems:`center`,flexGrow:1},Ah={kind:U.Custom,isMatch:e=>e.data.kind===`range-cell`,draw:(e,t)=>{let{ctx:n,theme:r,rect:i}=e,{min:a,max:o,value:s,label:c,measureLabel:l,color:u}=t.data,d=i.x+r.cellHorizontalPadding,f=i.y+i.height/2,p=o-a,m=(s-a)/p,h=`${Dh(r.baseFontStyle,.9)} ${r.fontFamily}`,g=Wi(n,h)/2;n.save();let _=0;c!==void 0&&(n.font=h,_=Pi(l??c,n,h).width+r.cellHorizontalPadding);let v=i.width-r.cellHorizontalPadding*2-_;if(v>=g){let e=n.createLinearGradient(d,f,d+v,f),t=u??r.accentColor;e.addColorStop(0,t),e.addColorStop(m,t),e.addColorStop(m,r.bgBubble),e.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=e,bh(n,d,f-g/2,v,g,g/2),n.fill(),n.beginPath(),bh(n,d+.5,f-g/2+.5,v-1,g-1,(g-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return c!==void 0&&(n.textAlign=`right`,n.fillStyle=r.textDark,n.fillText(c,i.x+i.width-r.cellHorizontalPadding,f+Ii(n,h))),n.restore(),!0},provideEditor:()=>e=>{let{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),a=t.max.toString(),o=t.step.toString();return K.createElement(`label`,{style:kh},K.createElement(`input`,{style:Oh,type:`range`,value:r,min:i,max:a,step:o,onChange:n=>{e.onChange({...e.value,data:{...t,value:Number(n.target.value)}})},disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},jh=an(`input`)({name:`StyledInputBox`,class:`gdg-s1wtovjx`,propsAsIs:!1}),Mh=(e,t,n)=>{if(t==null)return``;n&&(t=new Date(t.getTime()+n));let r=t.toISOString();switch(e){case`date`:return r.split(`T`)[0];case`datetime-local`:return r.replace(`Z`,``);case`time`:return r.split(`T`)[1].replace(`Z`,``);default:throw Error(`Unknown date kind ${e}`)}},Nh=e=>{let t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,a=t.timezoneOffset?t.timezoneOffset*60*1e3:0,o=t.min instanceof Date?Mh(n,t.min,a):t.min,s=t.max instanceof Date?Mh(n,t.max,a):t.max,c=Mh(n,t.date,a);return e.value.readonly?K.createElement(ii,{highlight:!0,autoFocus:!1,disabled:!0,value:r??``,onChange:()=>void 0}):K.createElement(jh,{"data-testid":`date-picker-cell`,required:!0,type:n,defaultValue:c,min:o,max:s,step:i,autoFocus:!0,onChange:t=>{isNaN(t.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(t.target.valueAsNumber-a)}})}})},Ph={kind:U.Custom,isMatch:e=>e.data.kind===`date-picker-cell`,draw:(e,t)=>{let{displayDate:n}=t.data;return Hi(e,n,t.contentAlign),!0},measure:(e,t,n)=>{let{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Nh}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format===`time`&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}},Fh=`None`;function Ih(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-n.cellHorizontalPadding,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+n.cellHorizontalPadding),e.fillStyle=n.accentColor,e.fill(),e.restore()}var Lh=(e,t)=>{let{cell:n,theme:r,ctx:i}=e;Hi({...e,theme:{...r,textDark:r.textLight,headerFontFull:`${r.headerFontStyle} ${r.fontFamily}`,baseFontFull:`${r.baseFontStyle} ${r.fontFamily}`,markerFontFull:`${r.markerFontStyle} ${r.fontFamily}`},spriteManager:{},hyperWrapping:!1},t,n.contentAlign),i.fillStyle=r.textDark};function Rh(e,t){return{drawCell:(0,K.useCallback)((n,r)=>{let{cell:i,theme:a,ctx:o,rect:s}=n,c=n.col;if(ol(i))Ih(o,s,a);else if(cl(i)&&c[yh,Eh,Ah,Ph,...Om],[])}}function zh(){let e=H();return(0,K.useMemo)(()=>({glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:be(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:be(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:be(e.colors.darkenedBgMix100,.9),bgHeaderHovered:be(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(m(`1.125rem`)),headerFontStyle:`${e.fontWeights.normal} ${m(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${m(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:be(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(m(e.spacing.sm)),cellVerticalPadding:Math.round(m(`0.1875rem`)),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:we(e.colors.secondaryBg,.1),bubbleHeight:Math.round(m(`1.25rem`)),bubblePadding:Math.round(m(e.spacing.sm)),bubbleMargin:Math.round(m(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(m(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:parseInt(e.sizes.borderWidth),defaultTableHeight:Math.round(m(`25rem`)),minColumnWidth:Math.round(m(`3.125rem`)),maxColumnWidth:Math.round(m(`62.5rem`)),maxColumnAutoWidth:Math.round(m(`31.25rem`)),defaultRowHeight:Math.round(m(`2.1875rem`)),defaultHeaderHeight:Math.round(m(`2.1875rem`)),bgRowHovered:R(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:{editable:e=>``}}),[e])}var Bh=(0,xn.getLogger)(`useDataEditor`);function Vh({columns:e,allColumns:t,canAddRows:n,canDeleteRows:r,editingState:i,getCellContent:a,getSourceCellValue:o=()=>void 0,getOriginalIndex:s,refreshCells:c,updateNumRows:l,syncEditState:u,clearSelection:d}){let f=(0,K.useCallback)((e,t,n,r)=>!i.current.isAddedRow(n)&&C(i.current.getCell(t,n))&&ul(o(e,n),r,e),[i,o]),p=(0,K.useCallback)(([t,n],r)=>{let o=e[t];if(!o.isEditable)return;let l=o.indexNumber,d=i.current.getOriginalRowIndex(s(n)),p=a([t,n]),m=o.getCellValue(p),h=o.getCellValue(r);if(!ol(p)&&ul(h,m,o))return;let g=o.getCell(h,!0);if(ol(g))Bh.warn(`Not applying the cell edit since it causes this error:\n ${g.data}`);else{if(f(o,l,d,h)){i.current.clearCell(l,d),u(),c([{cell:[t,n]}]);return}i.current.setCell(l,d,{...g,lastUpdated:performance.now()}),u()}},[e,i,s,a,f,u,c]),m=(0,K.useCallback)(()=>{if(!n)return;let e=new Map;t.forEach(t=>{e.set(t.indexNumber,t.getCell(t.defaultValue))}),i.current.addRow(e),l()},[t,i,n,l]),h=(0,K.useCallback)(()=>{n&&(m(),u())},[m,u,n]),g=(0,K.useCallback)(t=>{if(t.rows.length>0){if(!r)return!0;let e=t.rows.toArray().map(e=>i.current.getOriginalRowIndex(s(e)));return i.current.deleteRows(e),l(),d(),u(),!1}if(t.current?.range){let n=[],r=t.current.range;for(let t=r.y;t0&&(u(),c(n)),!1}return!0},[e,i,r,c,s,u,p,d,l]);return{onCellEdited:p,onPaste:(0,K.useCallback)((t,r)=>{let[o,l]=t,d=[];for(let t=0;t=i.current.getNumRows()){if(!n)break;m()}for(let n=0;n=e.length)break;let m=e[u];if(m.isEditable){let e=m.getCell(r,!0);if(C(e)&&!ol(e)){let t=m.indexNumber,n=i.current.getOriginalRowIndex(s(c)),r=m.getCellValue(a([u,c])),o=m.getCellValue(e);ul(o,r,m)||(f(m,t,n,o)?i.current.clearCell(t,n):i.current.setCell(t,n,{...e,lastUpdated:performance.now()}),d.push({cell:[u,c]}))}}}d.length>0&&(u(),c(d))}return!1},[e,i,n,s,a,f,m,u,c]),onRowAppended:h,onDelete:g,validateCell:(0,K.useCallback)((t,n)=>{let r=t[0];if(r>=e.length)return!0;let i=e[r];if(i.validateInput){let e=i.validateInput(i.getCellValue(n));return e===!0||e===!1?e:i.getCell(e)}return!0},[e])}}var Hh=`,`,Uh=`"`,Wh=` +`,Gh=``,Kh=RegExp(`[${[Hh,Uh,Wh].join(``)}]`),qh=(0,xn.getLogger)(`useDataExporter`);function Jh(e){return e.map(e=>Yh(e)).join(Hh)+Wh}function Yh(e){if(w(e))return``;let t=$(e);return Kh.test(t)?`${Uh}${t.replace(new RegExp(Uh,`g`),`""`)}${Uh}`:t}async function Xh(e,t,n,r){let i=new TextEncoder;await e.write(i.encode(Gh));let a=n.filter(e=>e.kind!==`button`).map(e=>e.name);await e.write(i.encode(Jh(a)));for(let a=0;a{e.kind!==`button`&&r.push(e.getCellValue(t([n,a])))}),await e.write(i.encode(Jh(r)))}await e.close()}function Zh(e,t,n,r){return{exportToCsv:(0,K.useCallback)(async()=>{let i=`${new Date().toISOString().slice(0,16).replace(`:`,`-`)}_export.csv`;try{await Xh(await(await(await Be(()=>import(`./es6.CiwTgjbX.js`),__vite__mapDeps([8,9,10,11,12,1,13,14]),import.meta.url)).showSaveFilePicker({suggestedName:i,types:[{accept:{"text/csv":[`.csv`]}}],excludeAcceptAllOption:!1})).createWritable(),e,t,n)}catch(a){if(a instanceof Error&&a.name===`AbortError`)return;try{qh.warn(`Failed to export data as CSV with FileSystem API, trying fallback method`,a);let o=``;await Xh(new WritableStream({write:e=>{o+=new TextDecoder(`utf-8`).decode(e)},close:async()=>{}}).getWriter(),e,t,n);let s=new Blob([o],{type:`text/csv;charset=utf-8;`}),c=URL.createObjectURL(s),l=mn({enforceDownloadInNewTab:r,url:c,filename:i});l.style.display=`none`,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(c)}catch(e){qh.error(`Failed to export data as CSV`,e)}}},[t,n,e,r])}}var Qh=15e4;function $h(e,t,n){let{DYNAMIC:r,ADD_ONLY:i}=S.EditingMode;return e>0?!1:!((n===r||n===i)&&t>0)}function eg({editingMode:e,disabled:t,numDataRows:n,numDataColumns:r,disableDataExport:i}){return(0,K.useMemo)(()=>{let{READ_ONLY:a,DYNAMIC:o,ADD_ONLY:s,DELETE_ONLY:c}=S.EditingMode,l=typeof window<`u`&&(window.matchMedia?.(`(pointer: coarse)`).matches??!1),u=$h(n,r,e),d=n>Qh,f=!d&&!u&&e!==o&&e!==s,p=!u,m=!i&&!d&&!u,h=!u&&e===a,g=!u&&e!==a&&!t;return{canSort:f,canSearch:p,canExportCsv:m,canShowColumnStatistics:h,canEdit:g,canAddRows:!u&&(e===o||e===s)&&!t,canDeleteRows:!u&&(e===o||e===c)&&!t,isEmptyTable:u,isLargeTable:d,isTouchDevice:l,canResizeColumns:!l,supportsFillHandle:g&&!l,supportsRectangleSelection:!l}},[e,t,n,r,i])}function tg(e,t,n,r){return{getCellContent:(0,K.useCallback)(([i,a])=>{if(i>t.length-1)return al(`Column index out of bounds`,`This error should never happen. Please report this bug.`);if(a>n-1)return al(`Row index out of bounds`,`This error should never happen. Please report this bug.`);try{let n=t[i],o=n.indexNumber,s=r.current.getOriginalRowIndex(a),c=r.current.isAddedRow(s);if(n.isEditable||c){let e=r.current.getCell(o,s);if(C(e))return{...n.getCell(n.getCellValue(e),!1),lastUpdated:e.lastUpdated};if(c)return al(`Error during cell creation`,`This error should never happen. Please report this bug. No cell found for an added row: col=${o}; row=${s}`)}return Rm(n,e.getCell(s,o),pe(e,s,o),e.styler?.cssStyles)}catch(e){return al(`Error during cell creation`,`This error should never happen. Please report this bug. \nError: ${e}`)}},[t,n,e,r])}}function ng({data:e,allColumns:t,editingState:n,isEditingEnabled:r,editStateHydrationCount:i,syncEditState:a}){let o=(0,K.useMemo)(()=>new Map(t.map(e=>[e.indexNumber,e])),[t]),s=(0,K.useCallback)((t,n)=>{if(n<0||n>=e.dimensions.numDataRows||t.indexNumber>=e.dimensions.numColumns)return;let r=Rm(t,e.getCell(n,t.indexNumber),void 0);return t.getCellValue(r)},[e]);return Ve(()=>{if(!r)return;let t=!1;n.current.forEachEditedCell((r,i,a)=>{let c=o.get(r);!c||i<0||i>=e.dimensions.numDataRows||ul(s(c,i),c.getCellValue(a),c)&&(n.current.clearCell(r,i),t=!0)}),t&&a()},[e,r,i]),{getSourceCellValue:s}}function rg(e){let[t,n]=(0,K.useState)(void 0),r=(0,K.useCallback)(e=>{if(e.kind!==`cell`)n(void 0);else{let[,t]=e.location;n(t)}},[n]);return{getRowThemeOverride:(0,K.useCallback)(n=>{if(n===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function ig(e,t,n,r,i){let[a,o]=(0,K.useState)({columns:Ut.empty(),rows:Ut.empty(),current:void 0}),s=!t&&!n&&(e.selectionMode.includes(S.SelectionMode.MULTI_ROW)||e.selectionMode.includes(S.SelectionMode.SINGLE_ROW)||e.selectionMode.includes(S.SelectionMode.SINGLE_ROW_REQUIRED)),c=s&&e.selectionMode.includes(S.SelectionMode.MULTI_ROW),l=s&&e.selectionMode.includes(S.SelectionMode.SINGLE_ROW_REQUIRED),u=!t&&!n&&(e.selectionMode.includes(S.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(S.SelectionMode.MULTI_COLUMN)),d=u&&e.selectionMode.includes(S.SelectionMode.MULTI_COLUMN),f=!t&&!n&&(e.selectionMode.includes(S.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(S.SelectionMode.MULTI_CELL)),p=f&&e.selectionMode.includes(S.SelectionMode.MULTI_CELL),m=a.rows.length>0,h=a.columns.length>0,g=a.current!==void 0,_=(0,K.useCallback)((e,t={})=>{let{shouldSync:n=!0,forceSync:c=!1}=t,d=!F(e.rows.toArray(),a.rows.toArray()),p=!F(e.columns.toArray(),a.columns.toArray()),m=!F(e.current,a.current),h=n&&(c||s&&d||u&&p||f&&m),g=e,_=!1;if(l&&d&&e.rows.length===0&&a.rows.length>0&&(g={...g,rows:a.rows},_=!0),p&&g.columns.length>=0){let e=g.columns;r.forEach((t,n)=>{t.isIndex&&(e=e.remove(n))}),e.length{let n=e||l,r={columns:t?a.columns:Ut.empty(),rows:n?a.rows:Ut.empty(),current:void 0};o(r),(!n&&s||!t&&u||f)&&i(r,f)},[a,s,l,u,f,i]),processSelectionChange:_}}function ag(e,t,n,r,i,a,o,s,c,l,u){let d=e.rowHeight??t.defaultRowHeight,f=r?2:1,p=n+ +(e.editingMode===S.EditingMode.DYNAMIC||e.editingMode===S.EditingMode.ADD_ONLY),m=Gm({numRows:p,rowHeight:d,theme:t,numHeaderRows:f}),h=Wm(c),g=Hm(c,u),_=Um(c),v=Gm({numRows:g?Math.max(1,Math.min(n,3)):1,rowHeight:d,theme:t}),y=Math.max(m,v),b=Math.min(y,t.defaultTableHeight);if(g&&l&&l>0)y=Math.max(l,y);else if(_){let e=Math.ceil(1e4/d),n=Gm({numRows:Math.min(p,e),rowHeight:d,theme:t,numHeaderRows:f})+1;b=Math.max(n,v),y=Math.max(b,y)}else h&&(b=Math.max(h,v),y=Math.max(b,y));a&&(b=Math.min(b,a),y=Math.min(y,a),h||(b=y));let x=t.minColumnWidth+2*t.tableBorderWidth,w=Math.max(i,x),T,E=w,D=zm(s),O=Bm(s),k=Vm(s);D?T=w:O?(T=Math.min(Math.max(O,x),w),E=Math.min(Math.max(O,E),w)):k&&(T=void 0);let[A,j]=(0,K.useState)({width:T||`100%`,height:g?`100%`:b});return(0,K.useLayoutEffect)(()=>{D&&A.width===`100%`&&j(e=>({...e,width:w}))},[w]),(0,K.useLayoutEffect)(()=>{j(e=>({...e,width:T||`100%`}))},[T]),(0,K.useLayoutEffect)(()=>{j(e=>({...e,height:g?`100%`:b}))},[b,n,l,g,u]),(0,K.useLayoutEffect)(()=>{if(o){let e=D||C(O)&&O>0;j({width:e?E:`100%`,height:y})}else j({width:T||`100%`,height:b})},[o]),{minHeight:v,maxHeight:y,minWidth:x,maxWidth:E,rowHeight:d,resizableSize:A,setResizableSize:j}}var og=`⚠️ Please fill out this cell.`;function sg(e,t,n=[]){let[r,i]=(0,K.useState)(),a=(0,K.useRef)(),{clear:o,restart:s}=Ue(()=>{a.current&&=(i(a.current),void 0)},600,{autoStart:!1}),c=(0,K.useCallback)(r=>{if(o(),a.current=void 0,i(void 0),(r.kind===`header`||r.kind===`cell`)&&r.location){let i=r.location[0],o=r.location[1],c;if(i<0||i>=e.length||n.includes(o))return;let l=e[i];if(r.kind===`header`&&C(l))c=l.help;else if(r.kind===`cell`){let e=t([i,o]);ol(e)?c=e.errorDetails:l.isRequired&&l.isEditable&&cl(e)?c=og:sl(e)&&(c=e.tooltip)}c&&(a.current={content:c,left:r.bounds.x+r.bounds.width/2,top:r.bounds.y},s())}},[o,e,t,n,s]);return{tooltip:r,clearTooltip:(0,K.useCallback)(()=>{o(),a.current=void 0,i(void 0)},[o,i]),onItemHovered:c}}function cg(e){return e.isIndex?Km:w(e.name)?``:e.name}var lg=class{constructor(e){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=e}toJson(e){let t=new Map;e.forEach(e=>{t.set(e.indexNumber,e)});let n={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((e,r,i)=>{let a={};e.forEach((e,n)=>{let r=t.get(n);r&&(a[cg(r)]=r.getCellValue(e))}),n.edited_rows[r]=a}),this.addedRows.forEach(e=>{let r={},i=!1;e.forEach((e,n,a)=>{let o=t.get(n);if(o){let t=o.getCellValue(e);o.isRequired&&o.isEditable&&cl(e)&&(i=!0),C(t)&&(r[cg(o)]=t)}}),i||n.added_rows.push(r)}),n.deleted_rows=this.deletedRows,JSON.stringify(n,(e,t)=>t===void 0?null:t)}fromJson(e,t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];let n=JSON.parse(e),r=new Map;t.forEach(e=>{r.set(e.indexNumber,e)});let i=new Map;t.forEach(e=>{i.set(cg(e),e)}),Object.keys(n.edited_rows).forEach(e=>{let t=Number(e),r=n.edited_rows[e];Object.keys(r).forEach(e=>{let n=r[e],a=i.get(e);if(a){let e=a.getCell(n);e&&(this.editedCells.has(t)||this.editedCells.set(t,new Map),this.editedCells.get(t)?.set(a.indexNumber,e))}})}),n.added_rows.forEach(e=>{let n=new Map;t.forEach(e=>{n.set(e.indexNumber,e.getCell(null))}),Object.keys(e).forEach(t=>{let r=e[t],a=i.get(t);if(a){let e=a.getCell(r);e&&n.set(a.indexNumber,e)}}),this.addedRows.push(n)}),this.deletedRows=n.deleted_rows}isAddedRow(e){return e>=this.numRows}getCell(e,t){if(this.isAddedRow(t))return this.addedRows[t-this.numRows].get(e);let n=this.editedCells.get(t);if(n!==void 0)return n.get(e)}setCell(e,t,n){if(this.isAddedRow(t)){if(t-this.numRows>=this.addedRows.length)return;this.addedRows[t-this.numRows].set(e,n)}else this.editedCells.get(t)===void 0&&this.editedCells.set(t,new Map),this.editedCells.get(t).set(e,n)}clearCell(e,t){if(this.isAddedRow(t))return;let n=this.editedCells.get(t);w(n)||(n.delete(e),n.size===0&&this.editedCells.delete(t))}forEachEditedCell(e){Array.from(this.editedCells.entries()).forEach(([t,n])=>{Array.from(n.entries()).forEach(([n,r])=>{e(n,t,r)})})}addRow(e){this.addedRows.push(e)}deleteRows(e){e.sort((e,t)=>t-e).forEach(e=>{this.deleteRow(e)})}deleteRow(e){if(!(w(e)||e<0)){if(this.isAddedRow(e)){this.addedRows.splice(e-this.numRows,1);return}this.deletedRows.includes(e)||(this.deletedRows.push(e),this.deletedRows=this.deletedRows.sort((e,t)=>e-t)),this.editedCells.delete(e)}}getOriginalRowIndex(e){let t=e;for(let e=0;et);e++)t+=1;return t}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}};function ug(e){if(typeof e!=`object`||!e)return!1;let t=e.selection;return typeof t==`object`&&!!t}function dg(e,t,n,r,i,a){let o;try{o=JSON.parse(e)}catch{return}if(!ug(o))return;let s=t.map(e=>cg(e)),c=Ut.empty(),l=Ut.empty(),u;if(o.selection?.rows?.forEach(e=>{let t=a?a(e):e;t!==void 0&&(c=c.add(t))}),o.selection?.columns?.forEach(e=>{let t=s.indexOf(e);t>=0&&(l=l.add(t))}),n&&!r){let[e,t]=o.selection?.cells?.[0]??[];if(e!==void 0&&t!==void 0){let n=a?a(e):e,r=s.indexOf(t);n!==void 0&&r>=0&&(u=[r,n])}}if(i||c.length>0||l.length>0||u!==void 0)return{rows:c,columns:l,current:u?{cell:u,range:{x:u[0],y:u[1],width:1,height:1},rangeStack:[]}:void 0}}function fg({element:e,widgetMgr:t,fragmentId:n,originalNumRows:r,originalColumns:i}){let{READ_ONLY:a}=S.EditingMode,o=(0,K.useRef)(new lg(r)),[s,c]=(0,K.useState)(o.current.getNumRows()),[l,u]=(0,K.useState)(0);Ve(()=>{o.current=new lg(r),c(o.current.getNumRows())},[r]);let d=(0,K.useCallback)(()=>{o.current=new lg(r),c(o.current.getNumRows())},[r]),f=(0,K.useCallback)(()=>{c(e=>{let t=o.current.getNumRows();return e===t?e:t})},[]);(0,K.useEffect)(()=>{if(e.editingMode===a||!t)return;let n=t.getStringValue({id:e.id,formId:e.formId??void 0});n&&(o.current.fromJson(n,i),c(o.current.getNumRows()),u(e=>e+1))},[]);let{debouncedCallback:p}=el((0,K.useCallback)(()=>{if(!t)return;let r=o.current.toJson(i),a=t.getStringValue({id:e.id,formId:e.formId??void 0});a===void 0&&(a=new lg(0).toJson([])),r!==a&&t.setStringValue({id:e.id,formId:e.formId??void 0},r,{fromUi:!0},n)},[i,e.id,e.formId,t,n]),150),m=(0,K.useCallback)((r,i)=>(a,o)=>{if(!t)return;let s={selection:{rows:[],columns:[],cells:[]}};if(s.selection.rows=a.rows.toArray().map(e=>i(e)).sort((e,t)=>e-t),s.selection.columns=a.columns.toArray().map(e=>cg(r[e])),o&&a.current){let{cell:e,range:t}=a.current;if(t)for(let e=t.y;e{if(e.selectionState||!a&&!s&&!c||!t)return;let u=t.getStringValue({id:e.id,formId:e.formId??void 0});if(u)return dg(u,i,c,l,!1);if(e.selectionDefault){let r=dg(e.selectionDefault,i,c,l,!0);return r!==void 0&&t.setStringValue({id:e.id,formId:e.formId??void 0},e.selectionDefault,{fromUi:!1},n),r}if(o&&r>0){let r={rows:Ut.empty().add(0),columns:Ut.empty(),current:void 0},i=JSON.stringify({selection:{rows:[0],columns:[],cells:[]}});return t.setStringValue({id:e.id,formId:e.formId??void 0},i,{fromUi:!1},n),r}},[t,e.id,e.formId,e.selectionState,e.selectionDefault,n,r]);return{editingState:o,numRows:s,editStateHydrationCount:l,resetEditingState:d,updateNumRows:f,syncEditState:p,createSyncSelectionState:m,onFormCleared:(0,K.useCallback)(()=>{d()},[d]),loadInitialSelectionState:h,getProgrammaticSelectionState:(0,K.useCallback)(({selectionState:i,columns:a,isRowSelectionActivated:o,isColumnSelectionActivated:s,isCellSelectionActivated:c,isMultiCellSelectionActivated:l,getOriginalIndex:u})=>{if(!t||!o&&!s&&!c)return;let d=new Map;for(let e=0;ed.get(e));return f!==void 0&&t.setStringValue({id:e.id,formId:e.formId??void 0},i,{fromUi:!1},n),f},[e.id,e.formId,t,n,r])}}function pg(e){return o(Re,{...e,id:Ee})}var mg=m(`0.375rem`),hg=c(`div`,{target:`e1g5gihi0`})({}),gg=e=>({...Pe(e),zIndex:Me(e),backgroundColor:e.colors.bgColor,color:e.colors.bodyText,fontSize:e.fontSizes.sm,fontWeight:e.fontWeights.normal,lineHeight:e.lineHeights.base}),_g=c(`div`,{target:`e1g5gihi1`})(({theme:e})=>({...gg(e),overflow:`auto`})),vg=c(`div`,{target:`e1g5gihi2`})(({theme:e})=>({...gg(e)})),yg=c(`div`,{target:`e1g5gihi3`})(({theme:e})=>({...gg(e),overflow:`auto`})),bg=c(`div`,{target:`e1g5gihi4`})(({theme:e})=>({...gg(e),overflow:`hidden`,minWidth:e.sizes.minMenuWidth,maxWidth:`calc(${e.sizes.minMenuWidth} * 2)`})),xg=c(`label`,{target:`e1g5gihi5`})(({theme:e})=>({display:`flex`,alignItems:`flex-start`,gap:e.spacing.sm,paddingLeft:e.spacing.md,paddingRight:e.spacing.md,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:`pointer`,marginBottom:e.spacing.none,marginTop:e.spacing.none,"&:hover":{backgroundColor:e.colors.darkenedBgMix15},"&:focus-within":{backgroundColor:e.colors.darkenedBgMix25}})),Sg=c(`input`,{target:`e1g5gihi6`})({position:`absolute`,opacity:0,width:0,height:0,margin:0}),Cg=c(`span`,{target:`e1g5gihi7`})(({theme:e})=>({flexShrink:0,width:e.sizes.checkbox,height:e.sizes.checkbox,marginTop:`calc((${e.lineHeights.small} * ${e.fontSizes.sm} - ${e.sizes.checkbox}) / 2)`,borderWidth:e.sizes.borderWidth,borderStyle:`solid`,borderColor:e.colors.borderColor,borderRadius:e.radii.sm,backgroundColor:e.colors.lightenedBg05,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`background-color 100ms ease, border-color 100ms ease`,'&[data-checked="true"], &[data-indeterminate="true"]':{borderColor:e.colors.primary,backgroundColor:e.colors.primary},"input:focus-visible + &":{boxShadow:e.shadows.focusRing},"& svg":{width:`65%`,height:`65%`,fill:`none`,stroke:`white`,strokeWidth:`2.5px`,strokeLinecap:`round`,strokeLinejoin:`round`}})),wg=c(`div`,{target:`e1g5gihi8`})(({theme:e})=>({paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,maxHeight:`min(${e.sizes.maxDropdownHeight}, 70vh)`,overflow:`auto`})),Tg=c(`span`,{target:`e1g5gihi9`})(({theme:e})=>({lineHeight:e.lineHeights.small,color:e.colors.bodyText,fontSize:e.fontSizes.sm,fontWeight:e.fontWeights.normal})),Eg=c(`div`,{target:`e1g5gihi10`})(({theme:e})=>({paddingTop:e.spacing.threeXS,paddingBottom:e.spacing.threeXS,paddingLeft:e.spacing.xs,paddingRight:e.spacing.xs,maxWidth:`calc(${e.sizes.minMenuWidth} * 2)`})),Dg=c(`div`,{target:`e1g5gihi11`})(({theme:e,isActive:t,hasSubmenu:n,allowWrap:r})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:e.spacing.sm,marginTop:e.spacing.twoXS,marginBottom:e.spacing.twoXS,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.threeXS,paddingBottom:e.spacing.threeXS,cursor:`pointer`,borderRadius:e.radii.md2,backgroundColor:t?e.colors.darkenedBgMix15:`transparent`,"&:hover":{backgroundColor:e.colors.darkenedBgMix15},"&:focus":{outline:`none`},"&:focus-visible":{boxShadow:e.shadows.focusRing},minWidth:e.sizes.minMenuWidth,whiteSpace:r?`normal`:`nowrap`,...n&&{justifyContent:`space-between`,"& > :first-of-type":{display:`flex`,alignItems:`center`,gap:e.spacing.sm}}})),Og=c(`div`,{target:`e1g5gihi12`})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs,marginLeft:e.spacing.xs,marginRight:`max(0px, calc(${e.spacing.xs} - var(--scrollbar-gutter-size, 0px)))`})),kg=c(`div`,{target:`e1g5gihi13`})(({theme:e})=>({display:`flex`,alignItems:`center`,padding:`${e.spacing.twoXS} ${e.spacing.none}`,cursor:`default`,gap:e.spacing.twoXS})),Ag=c(`div`,{target:`e1g5gihi14`})(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`center`,padding:e.spacing.twoXS,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md2,backgroundColor:`transparent`,color:e.colors.bodyText,height:`fit-content`})),jg=c(`div`,{target:`e1g5gihi15`})(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexGrow:1,padding:`${e.spacing.threeXS} ${e.spacing.threeXS}`,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md2,backgroundColor:e.colors.secondaryBg,minWidth:0,overflow:`hidden`})),Mg=c(`span`,{target:`e1g5gihi16`})(({theme:e})=>({whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm})),Ng=c(`button`,{target:`e1g5gihi17`})(({theme:e})=>({background:`none`,border:`none`,padding:e.spacing.twoXS,cursor:`pointer`,color:e.colors.bodyText,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:e.radii.sm,transition:`background-color 0.2s ease`,"&:hover":{backgroundColor:e.colors.fadedText05},"&:active":{backgroundColor:e.colors.fadedText10}})),Pg=c(`div`,{target:`e1g5gihi18`})(({theme:e})=>({display:`flex`,flexDirection:`column`,gap:e.spacing.sm,padding:e.spacing.sm,minWidth:`13rem`,maxWidth:`16rem`})),Fg=`4rem`,Ig=c(`div`,{target:`e1g5gihi19`})(({theme:e})=>({width:`100%`,height:Fg,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:e.radii.md2,overflow:`hidden`,"& svg":{width:`100%`}})),Lg=c(`div`,{target:`e1g5gihi20`})(({theme:e})=>({width:`100%`,display:`flex`,flexDirection:`column`,gap:e.spacing.twoXS,fontSize:e.fontSizes.twoSm,lineHeight:e.lineHeights.base})),Rg=c(`div`,{target:`e1g5gihi21`})(({theme:e})=>({display:`grid`,gridTemplateColumns:`6rem minmax(2.5rem, 1fr) 2.75rem`,alignItems:`center`,gap:e.spacing.twoXS,minWidth:0})),zg=c(`span`,{target:`e1g5gihi22`})(({theme:e})=>({color:e.colors.fadedText60,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`})),Bg=c(`div`,{target:`e1g5gihi23`})(({theme:e})=>({height:e.spacing.sm,backgroundColor:e.colors.fadedText10,borderRadius:e.radii.sm,overflow:`hidden`})),Vg=c(`div`,{target:`e1g5gihi24`})(({theme:e})=>({height:`100%`,backgroundColor:e.colors.chartCategoricalColors[0]??e.colors.primary,borderRadius:`inherit`})),Hg=c(`span`,{target:`e1g5gihi25`})(({theme:e})=>({color:e.colors.bodyText,fontWeight:e.fontWeights.normal,textAlign:`right`,whiteSpace:`nowrap`})),Ug=c(`div`,{target:`e1g5gihi26`})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginLeft:`-${e.spacing.sm}`,marginRight:`-${e.spacing.sm}`})),Wg=c(`dl`,{target:`e1g5gihi27`})(({theme:e})=>({display:`flex`,flexDirection:`column`,gap:e.spacing.twoXS,margin:0})),Gg=c(`div`,{target:`e1g5gihi28`})(({theme:e})=>({display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:e.spacing.md,fontSize:e.fontSizes.twoSm,lineHeight:e.lineHeights.base})),Kg=c(`dt`,{target:`e1g5gihi29`})(({theme:e})=>({color:e.colors.fadedText60,whiteSpace:`nowrap`,fontWeight:`normal`})),qg=c(`dd`,{target:`e1g5gihi30`})(({theme:e})=>({color:e.colors.bodyText,fontWeight:e.fontWeights.normal,textAlign:`right`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,maxWidth:`8rem`,margin:0})),Jg=c(`div`,{target:`e1g5gihi31`})(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`center`,padding:e.spacing.lg,color:e.colors.fadedText60,fontSize:e.fontSizes.sm,minWidth:`10rem`})),Yg=c(`div`,{target:`e1g5gihi32`})(({theme:e})=>({fontSize:e.fontSizes.twoSm,color:e.colors.fadedText40,textAlign:`center`,paddingTop:e.spacing.twoXS}));function Xg({top:e,left:t,actions:n,onSelectAction:r,onCloseMenu:i}){let{refs:c,floatingStyles:l}=ze({open:!0,placement:`bottom-end`,offsetPx:mg}),{panelRef:u,setFloatingRef:d}=wt({isOpen:!0,onClose:i,floatingSetFn:c.setFloating,excludeSelectors:[`[data-testid="stDataFrameButtonActionMenuTarget"]`]});(0,K.useEffect)(()=>{function e(e){u.current?.contains(e.target)||i()}return document.addEventListener(`scroll`,e,{capture:!0}),window.addEventListener(`wheel`,e,{passive:!0}),()=>{document.removeEventListener(`scroll`,e,{capture:!0}),window.removeEventListener(`wheel`,e)}},[i,u]);let f=(0,K.useCallback)(e=>{r(e),i()},[r,i]),p=(0,K.useCallback)(e=>t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),f(e))},[f]);return a(s,{children:[o(`div`,{ref:c.setReference,"data-testid":`stDataFrameButtonActionMenuTarget`,style:{position:`fixed`,top:e,left:t,width:0,height:0,visibility:`hidden`,pointerEvents:`none`}}),o(pg,{children:o(yg,{ref:d,style:l,tabIndex:-1,"data-testid":`stDataFrameButtonActionMenu`,children:o(Eg,{role:`menu`,"aria-label":`Button action menu`,children:n.map((e,t)=>{let{icon:n,text:r}=V(e);return a(Dg,{onClick:()=>f(e),onKeyDown:p(e),role:`menuitem`,tabIndex:0,allowWrap:!0,"aria-label":r||n||e,children:[n&&o(Ae,{size:`base`,iconValue:n}),o(k,{source:r,allowHTML:!1,isLabel:!0,disableLinks:!0})]},`${e}-${t}`)})})})})]})}var Zg=(0,K.memo)(Xg),Qg=[{format:``,label:`Automatic`,icon:`:material/123:`},{format:`localized`,label:`Localized`,icon:`:material/translate:`},{format:`plain`,label:`Plain`,icon:`:material/speed_1_75:`},{format:`compact`,label:`Compact`,icon:`:material/1k:`},{format:`dollar`,label:`Dollar`,icon:`:material/attach_money:`},{format:`euro`,label:`Euro`,icon:`:material/euro:`},{format:`yen`,label:`Yen`,icon:`:material/currency_yen:`},{format:`percent`,label:`Percent`,icon:`:material/percent:`},{format:`scientific`,label:`Scientific`,icon:`:material/experiment:`},{format:`accounting`,label:`Accounting`,icon:`:material/finance_chip:`}],$g={number:Qg,progress:Qg,datetime:[{format:``,label:`Automatic`,icon:`:material/schedule:`},{format:`localized`,label:`Localized`,icon:`:material/translate:`},{format:`distance`,label:`Distance`,icon:`:material/search_activity:`},{format:`calendar`,label:`Calendar`,icon:`:material/today:`}],date:[{format:``,label:`Automatic`,icon:`:material/schedule:`},{format:`localized`,label:`Localized`,icon:`:material/translate:`},{format:`distance`,label:`Distance`,icon:`:material/search_activity:`}],time:[{format:``,label:`Automatic`,icon:`:material/schedule:`},{format:`localized`,label:`Localized`,icon:`:material/translate:`}]};function e_({columnKind:e,isOpen:t,onOpenChange:n,onChangeFormat:r,onCloseMenu:i,children:c}){let l=$g[e]||[],{floatingStyles:u,setAnchorRef:d,setFloatingRef:f}=Cn({isOpen:t,onOpenChange:n,enabled:l.length>0});return l.length===0?o(s,{}):a(s,{children:[o(hg,{role:`presentation`,ref:d,children:c}),t&&o(pg,{children:o(vg,{ref:f,style:u,"data-testid":`stDataFrameColumnFormattingMenu`,tabIndex:-1,autoFocus:!0,children:o(Eg,{role:`menu`,children:l.map(e=>a(Dg,{onClick:()=>{r(e.format),i()},role:`menuitem`,children:[o(Ae,{size:`base`,iconValue:e.icon}),e.label]},e.format))})})})]})}var t_=(0,K.memo)(e_),n_=(0,xn.getLogger)(`DataFrameStatistics`),r_=1e5,i_=1e4,a_=15,o_=5;function s_(e,t){let n=e.length;if(n===0)return 0;let r=t/100*(n-1),i=Math.floor(r),a=Math.ceil(r);return i===a?e[i]:e[i]+(e[a]-e[i])*(r-i)}function c_(e){return e<=1?1:Math.min(a_,Math.ceil(Math.sqrt(e)))}var l_=new Set([`number`,`progress`]),u_=new Set([`text`]),d_=new Set([`datetime`,`date`]),f_=new Set([`checkbox`]);function p_(e){return l_.has(e)?`numeric`:u_.has(e)?`text`:d_.has(e)?`datetime`:f_.has(e)?`boolean`:null}function m_(e){return p_(e)!==null}function h_(e,t){try{let{numDataRows:n}=e.dimensions,r=n>r_,i=[];if(r){let r=Math.max(1,Math.floor(n/i_));for(let a=0;ae-t),s=n.reduce((e,t)=>e+t,0),c=s/i,l=o[0],u=o[i-1],d=s_(o,25),f=s_(o,50),p=s_(o,75),m=n.map(e=>(e-c)**2).reduce((e,t)=>e+t,0)/i,h=Math.sqrt(m),g=__(o,l,u);return{type:`numeric`,count:i,nullCount:r,unique:a,sum:s,mean:c,q25:d,median:f,q75:p,stdDev:h,variance:m,min:l,max:u,histogram:g,isSampled:t}}function __(e,t,n){if(e.length===0||t===n)return e.length>0?[{binStart:t,binEnd:n,count:e.length}]:[];let r=c_(e.length),i=(n-t)/r,a=[];for(let e=0;et[1]-e[1]).slice(0,o_).map(([e,t])=>({value:e,count:t,percentage:a>0?t/a*100:0})),c=1/0,l=0,u=0;for(let e of r)el&&(l=e),u+=e;r.length===0&&(c=0);let d=r.length>0?u/r.length:0;return{type:`text`,count:a,empty:i,unique:o,minLength:c,maxLength:l,avgLength:d,topValues:s,isSampled:t}}function y_(e,t,n=!1,r){let i=[],a=0;for(let t of e){let e=w(t)?null:Sl(t),n=C(e)?e.getTime():NaN;Number.isFinite(n)?i.push(n):a++}let o=i.length;if(o===0)return{type:`datetime`,isDateOnly:n,timezone:r,count:0,nullCount:a,mean:0,q25:0,median:0,q75:0,min:0,max:0,range:``,histogram:[],isSampled:t};let s=[...i].sort((e,t)=>e-t),c=0;i.forEach((e,t)=>{c+=(e-c)/(t+1)});let l=s[0],u=s[o-1],d=s_(s,25),f=s_(s,50),p=s_(s,75),m=x_(l,u),h=__(s,l,u);return{type:`datetime`,isDateOnly:n,timezone:r,count:o,nullCount:a,mean:c,q25:d,median:f,q75:p,min:l,max:u,range:m,histogram:h,isSampled:t}}function b_(e,t){let n=Math.round(e*10)/10;return n===1?`1 ${t}`:`${n} ${t}s`}function x_(e,t){let n=(t-e)/1e3,r=n/60,i=r/60,a=i/24,o=a/7,s=a/30.44,c=a/365.25;return c>=1?b_(Math.round(c),`year`):s>=1?b_(Math.round(s),`month`):o>=1?b_(Math.round(o),`week`):a>=1?b_(Math.round(a),`day`):i>=1?b_(Math.round(i),`hour`):r>=1?b_(Math.round(r),`minute`):b_(Math.round(n),`second`)}function S_(e,t){let n=0,r=0,i=0;for(let t of e){let e=vl(t);e===!0?n++:e===!1?r++:i++}let a=n+r,o=a>0?n/a*100:0,s=a>0?r/a*100:0;return{type:`boolean`,count:a,nullCount:i,trueCount:n,falseCount:r,truePercentage:o,falsePercentage:s,isSampled:t}}function C_(e,t,n,r){let i=p_(e);if(!i)return null;let a=h_(t,n);if(!a)return null;let{values:o,isSampled:s}=a;switch(i){case`numeric`:return g_(o,s);case`text`:return v_(o,s);case`datetime`:return y_(o,s,e===`date`,r);case`boolean`:return S_(o,s)}}function w_(e,t=2){return Number.isFinite(e)?e.toLocaleString(void 0,{maximumFractionDigits:t,minimumFractionDigits:0}):`-`}function T_(e,t=!1,n){let r=new Date(e),i=n||`UTC`;return t?r.toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`,timeZone:i}):r.toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,timeZone:i})}function E_(e){return`${w_(e,1)}%`}function D_(e,t){let n=e+t;return n>0?t/n*100:0}function O_(e,t){return`${w_(e,0)} (${E_(t)})`}function k_(e){switch(e.type){case`numeric`:case`datetime`:case`boolean`:return e.nullCount;case`text`:return e.empty}}function A_(e){return Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2})}function j_(e){return e.toLocaleString(void 0,{maximumFractionDigits:0})}function M_(e){return`${e.toLocaleString(void 0,{maximumFractionDigits:1})}%`}function N_(e,t=!1,n){let r=new Date(e),i=n||`UTC`;return t?r.toLocaleString(void 0,{month:`short`,day:`numeric`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,timeZone:i}):r.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`,timeZone:i})}function P_(e,t,n){let r=j_(t),i=M_(n);return{label:e,percent:n,valueLabel:i,title:`${e}: ${r} (${i})`}}var F_=(0,xn.getLogger)(`StatisticsChart`),I_=180,L_=64,R_={numeric:`Distribution histogram`,datetime:`Distribution histogram`,text:`Top values frequency chart`,boolean:`True/false distribution chart`};function z_(e){let t=hn(e);return{...t,"#vg-tooltip-element":{...t[`#vg-tooltip-element`],zIndex:e.zIndices.tablePortalTooltip}}}function B_(e,t,n){let r=e.length===1&&e[0].binStart===e[0].binEnd,i={$schema:`https://vega.github.io/schema/vega-lite/v5.json`,width:I_,height:L_,data:{values:e.map(e=>({binStart:r?e.binStart-.5:e.binStart,binEnd:r?e.binEnd+.5:e.binEnd,count:e.count,range:n(e.binStart,e.binEnd)}))},mark:{type:`bar`,stroke:t.colors.bgColor,strokeWidth:1,cornerRadiusTopLeft:2,cornerRadiusTopRight:2},encoding:{x:{field:`binStart`,type:`quantitative`,axis:null,scale:{nice:!1,zero:!1}},x2:{field:`binEnd`},y:{field:`count`,type:`quantitative`,axis:null,scale:{nice:!1}},y2:{datum:0},tooltip:[{field:`range`,type:`nominal`,title:`Range`},{field:`count`,type:`quantitative`,title:`Count`}]},config:{view:{stroke:null},padding:{left:0,right:0,top:2,bottom:2}}};return i.config=_n(i.config,t),i}function V_({ariaLabel:e,data:t}){return o(Lg,{"data-testid":`stDataFrameStatisticsChart`,"aria-label":`${e}: ${t.map(e=>e.title).join(`; `)}`,role:`img`,children:t.map(e=>{let t=Math.min(100,Math.max(0,e.percent));return a(Rg,{title:e.title,children:[o(zg,{children:e.label}),o(Bg,{children:o(Vg,{style:{width:`${t}%`}})}),o(Hg,{children:e.valueLabel})]},e.label)})})}function H_({statistics:e}){let t=H(),n=(0,K.useRef)(null),r=(0,K.useMemo)(()=>z_(t),[t]);if((0,K.useEffect)(()=>{if(!n.current)return;let r=n.current,i=null,a=!1,o=null;switch(e.type){case`numeric`:e.histogram.length>0&&(i=B_(e.histogram,t,(e,t)=>`${A_(e)} – ${A_(t)}`));break;case`datetime`:if(e.histogram.length>0){let n=!e.isDateOnly,r=e.timezone;i=B_(e.histogram,t,(e,t)=>`${N_(e,n,r)} – ${N_(t,n,r)}`)}break;case`text`:break;case`boolean`:break}return i&&G(r,i,{actions:!1,renderer:`svg`,ast:!0,expr:gn,tooltip:{theme:`custom`}}).then(e=>{a?e.finalize():o=e}).catch(e=>{F_.debug(`Failed to embed statistics chart:`,e)}),()=>{a=!0,o?.finalize(),r.innerHTML=``}},[e,t]),(e.type===`numeric`||e.type===`datetime`)&&e.histogram.length===0||e.type===`text`&&e.topValues.length===0||e.type===`boolean`&&e.count===0)return null;let i=R_[e.type];return e.type===`text`?o(V_,{ariaLabel:i,data:e.topValues.map(e=>P_(e.value,e.count,e.percentage))}):e.type===`boolean`?o(V_,{ariaLabel:i,data:[P_(`True`,e.trueCount,e.truePercentage),P_(`False`,e.falseCount,e.falsePercentage)]}):a(s,{children:[o(x,{styles:[r]}),o(Ig,{ref:n,"data-testid":`stDataFrameStatisticsChart`,"aria-label":i,role:`img`})]})}var U_=(0,K.memo)(H_);function W_({label:e,value:t}){return a(Gg,{children:[o(Kg,{children:e}),o(qg,{children:t})]})}function G_(e){switch(e.type){case`numeric`:{let t=D_(e.count,e.nullCount);return[{label:`Values`,value:w_(e.count,0)},{label:`Empty`,value:O_(e.nullCount,t)},{label:`Distinct`,value:w_(e.unique,0)},{label:`Average`,value:w_(e.mean)},{label:`Standard deviation`,value:w_(e.stdDev)},{label:`Minimum`,value:w_(e.min)},{label:`25th percentile`,value:w_(e.q25)},{label:`Median`,value:w_(e.median)},{label:`75th percentile`,value:w_(e.q75)},{label:`Maximum`,value:w_(e.max)},{label:`Sum`,value:w_(e.sum)}]}case`text`:{let t=D_(e.count,e.empty);return[{label:`Values`,value:w_(e.count,0)},{label:`Empty`,value:O_(e.empty,t)},{label:`Distinct`,value:w_(e.unique,0)},{label:`Minimum length`,value:w_(e.minLength,0)},{label:`Maximum length`,value:w_(e.maxLength,0)},{label:`Average length`,value:w_(e.avgLength,1)}]}case`datetime`:{let t=D_(e.count,e.nullCount),n=t=>T_(t,e.isDateOnly,e.timezone);return[{label:`Values`,value:w_(e.count,0)},{label:`Empty`,value:O_(e.nullCount,t)},{label:`Minimum`,value:n(e.min)},{label:`25th percentile`,value:n(e.q25)},{label:`Median`,value:n(e.median)},{label:`75th percentile`,value:n(e.q75)},{label:`Maximum`,value:n(e.max)},{label:`Average`,value:n(e.mean)},{label:`Range`,value:e.range}]}case`boolean`:{let t=D_(e.count,e.nullCount);return[{label:`Values`,value:w_(e.count,0)},{label:`Empty`,value:O_(e.nullCount,t)}]}}}function K_({rows:e}){return o(Wg,{"data-testid":`stDataFrameStatisticsMetrics`,children:e.map(e=>o(W_,{label:e.label,value:e.value},e.label))})}function q_(e){let t=k_(e),n=D_(e.count,t);return[{label:`Values`,value:w_(e.count,0)},{label:`Empty`,value:O_(t,n)}]}function J_({statistics:e}){if(!e)return o(Jg,{children:`No data`});let t=k_(e);return e.count===0?t>0?a(Pg,{"data-testid":`stDataFrameStatisticsContent`,children:[o(K_,{rows:q_(e)}),e.isSampled&&o(Yg,{children:`Based on sample`})]}):o(Jg,{children:`No data`}):a(Pg,{"data-testid":`stDataFrameStatisticsContent`,children:[o(U_,{statistics:e}),o(Ug,{}),o(K_,{rows:G_(e)}),e.isSampled&&o(Yg,{children:`Based on sample`})]})}function Y_({column:e,data:t,isOpen:n,onOpenChange:r,children:i}){let c=(0,K.useMemo)(()=>{if(!n)return null;let r=ie(e.arrowType);return C_(e.kind,t,e.indexNumber,r)},[n,e.kind,e.indexNumber,e.arrowType,t]),{floatingStyles:l,setAnchorRef:u,setFloatingRef:d}=Cn({isOpen:n,onOpenChange:r});return m_(e.kind)?a(s,{children:[o(hg,{role:`presentation`,ref:u,children:i}),n&&o(pg,{children:o(vg,{ref:d,style:l,"data-testid":`stDataFrameStatisticsMenu`,children:o(J_,{statistics:c})})})]}):o(s,{children:i})}var X_=(0,K.memo)(Y_);function Z_({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:c,onSortColumn:l,onHideColumn:u,column:d,data:f,canShowColumnStatistics:p=!0,onChangeFormat:m,onAutosize:h}){let[g,_]=(0,K.useState)(!1),[v,y]=(0,K.useState)(!1),b=(0,K.useCallback)(e=>{_(e),e&&y(!1)},[]),x=(0,K.useCallback)(e=>{y(e),e&&_(!1)},[]),{isCopied:S,copyToClipboard:C}=nt(),{refs:w,floatingStyles:T}=ze({open:!0,placement:`bottom-end`,offsetPx:mg}),E=(0,K.useRef)(!1);(0,K.useEffect)(()=>{let e=()=>{E.current=!0},t=()=>{E.current=!1};return document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`pointerup`,t,!0),()=>{document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`pointerup`,t,!0)}},[]);let{setFloatingRef:D}=wt({isOpen:!0,onClose:c,floatingSetFn:w.setFloating,excludeSelectors:[`[data-testid="stDataFrameColumnFormattingMenu"]`,`[data-testid="stDataFrameStatisticsMenu"]`]});(0,K.useEffect)(()=>{function e(e){e.preventDefault()}return document.addEventListener(`wheel`,e,{passive:!1}),document.addEventListener(`touchmove`,e,{passive:!1}),()=>{document.removeEventListener(`wheel`,e),document.removeEventListener(`touchmove`,e)}},[]);let O=(0,K.useCallback)(()=>{C(d.title)},[d.title,C]);return a(s,{children:[o(`div`,{ref:w.setReference,"data-testid":`stDataFrameColumnMenuTarget`,style:{position:`fixed`,top:e,left:t,width:0,height:0,visibility:`hidden`,pointerEvents:`none`}}),o(pg,{children:o(_g,{ref:D,"data-testid":`stDataFrameColumnMenu`,style:T,tabIndex:-1,autoFocus:!0,children:a(Eg,{role:`menu`,"aria-label":`Dataframe column menu`,children:[a(kg,{children:[o(Ag,{title:d.kind,children:o(Ae,{size:`base`,iconValue:d.typeIcon||`:material/notes:`})}),a(jg,{title:d.title,children:[o(Mg,{children:d.title}),o(Ng,{onClick:O,title:`Copy column name`,"aria-label":`Copy column name`,children:o(Ae,{size:`sm`,iconValue:S?`:material/check:`:`:material/content_copy:`})})]})]}),l&&a(s,{children:[a(Dg,{onClick:()=>{l(`asc`),c()},role:`menuitem`,children:[o(Ae,{size:`base`,iconValue:`:material/arrow_upward:`}),`Sort ascending`]}),a(Dg,{onClick:()=>{l(`desc`),c()},role:`menuitem`,children:[o(Ae,{size:`base`,iconValue:`:material/arrow_downward:`}),`Sort descending`]}),o(Og,{})]}),p&&f&&m_(d.kind)&&o(X_,{column:d,data:f,isOpen:v,onOpenChange:x,children:a(Dg,{onFocus:()=>x(!0),onBlur:e=>{E.current||e.relatedTarget?.closest(`[data-testid="stDataFrameStatisticsMenu"]`)||y(!1)},isActive:v,hasSubmenu:!0,role:`menuitem`,"aria-haspopup":`true`,"aria-expanded":v,tabIndex:0,children:[a(`div`,{children:[o(Ae,{size:`base`,iconValue:`:material/bar_chart:`}),`Statistics`]}),o(Ae,{size:`base`,iconValue:`:material/chevron_right:`})]})}),m&&o(t_,{columnKind:d.kind,isOpen:g,onOpenChange:b,onChangeFormat:m,onCloseMenu:c,children:a(Dg,{onFocus:()=>b(!0),onBlur:e=>{E.current||e.relatedTarget?.closest(`[data-testid="stDataFrameColumnFormattingMenu"]`)||_(!1)},isActive:g,hasSubmenu:!0,role:`menuitem`,"aria-haspopup":`menu`,"aria-expanded":g,tabIndex:0,children:[a(`div`,{children:[o(Ae,{size:`base`,iconValue:`:material/format_list_numbered:`}),`Format`]}),o(Ae,{size:`base`,iconValue:`:material/chevron_right:`})]})}),h&&a(Dg,{onClick:()=>{h(),c()},role:`menuitem`,children:[o(Ae,{size:`base`,iconValue:`:material/arrows_outward:`}),`Autosize`]}),n&&a(Dg,{onClick:()=>{i(),c()},role:`menuitem`,children:[o(Ae,{size:`base`,iconValue:`:material/keep_off:`}),`Unpin column`]}),!n&&a(Dg,{onClick:()=>{r(),c()},role:`menuitem`,children:[o(Ae,{size:`base`,iconValue:`:material/keep:`}),`Pin column`]}),u&&a(Dg,{onClick:()=>{u(),c()},role:`menuitem`,children:[o(Ae,{size:`base`,iconValue:`:material/visibility_off:`}),`Hide column`]})]})})})]})}var Q_=(0,K.memo)(Z_),$_=`(index)`;function ev(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}var tv=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{let i=(0,K.useRef)(null);return(0,K.useEffect)(()=>{i.current&&(i.current.indeterminate=n??!1)},[n]),a(xg,{children:[o(Sg,{ref:i,type:`checkbox`,checked:t,"aria-label":e,"aria-checked":n?`mixed`:void 0,onChange:e=>{r(e.target.checked)}}),o(Cg,{"aria-hidden":`true`,"data-checked":t?`true`:void 0,"data-indeterminate":n?`true`:void 0,children:n?o(`svg`,{viewBox:`0 0 10 2`,"aria-hidden":`true`,children:o(`line`,{x1:`1`,y1:`1`,x2:`9`,y2:`1`})}):t?o(`svg`,{viewBox:`0 0 10 8`,"aria-hidden":`true`,children:o(`polyline`,{points:`1 4 4 7 9 1`})}):null}),o(Tg,{children:e})]})},nv=(0,K.memo)(({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:s,isOpen:c,onClose:l})=>{let u=Tt(),{refs:d,floatingStyles:f,context:p}=ze({open:c,placement:`bottom-end`,offsetPx:mg}),{panelRef:m,setFloatingRef:h,setReferenceRef:g}=wt({isOpen:c,onClose:l,floatingSetFn:d.setFloating,referenceSetFn:d.setReference}),_=e=>!(e.isHidden===!0||ev(e,t)),v=e.every(_),y=e.some(_)&&!v,b=a=>{e.forEach(e=>{let o=ev(e,t);a?(i(e.id),o&&n(t=>[...t,e.id])):r(e.id)})};return a(`div`,{ref:g,children:[s,c&&o(pg,{children:o(Le,{context:p,initialFocus:m,children:o(bg,{ref:h,style:f,tabIndex:-1,"data-testid":`stDataFrameColumnVisibilityMenu`,children:a(wg,{style:{"--scrollbar-gutter-size":`${u}px`},children:[o(tv,{label:`Select all`,isIndeterminate:y,initialValue:v,onChange:e=>{b(e)}}),o(Og,{}),o(`div`,{children:e.map(e=>{let a=ev(e,t);return o(tv,{label:!e.title&&e.isIndex?$_:e.title,initialValue:!(e.isHidden===!0||a),onChange:t=>{t?(i(e.id),a&&n(t=>[...t,e.id])):r(e.id)}},e.id)})})]})})})})]})}),rv=c(`div`,{target:`ee274890`})(({theme:e,disableResize:t,minHeight:n})=>({position:`relative`,display:t?`flex`:`inline-block`,height:`100%`,"& .stDataFrameGlideDataEditor":{height:`100%`,minWidth:`100%`,minHeight:n,borderRadius:e.radii.default},"& .dvn-scroller":{overflowX:`auto !important`,overflowY:`auto !important`,overscrollBehaviorX:`contain`},"& .gdg-search-bar":{...Pe(e),maxWidth:`19rem`,width:`80%`,minWidth:`6rem`,top:e.spacing.sm,right:e.spacing.sm,padding:e.spacing.sm,"& .gdg-search-status":{paddingTop:e.spacing.twoXS,fontSize:e.fontSizes.twoSm},"& .gdg-search-progress":{display:`none`},"& input":{width:`100%`},"& button":{width:e.iconSizes.xl,height:e.iconSizes.xl,"& .button-icon":{width:e.iconSizes.base,height:e.iconSizes.base}}}})),iv=c(`div`,{target:`e6uk7xy0`})(({theme:e})=>({zIndex:e.zIndices.popup,pointerEvents:`none`}));function av({top:e,left:t,content:n,clearTooltip:r}){let i=H(),{refs:c,floatingStyles:l}=ze({open:!0,placement:`top`,offsetPx:5});return(0,K.useEffect)(()=>{let e=e=>{e.key===`Escape`&&r()},t=e=>{c.floating.current?.contains(e.target)||r()};return document.addEventListener(`keydown`,e,!0),document.addEventListener(`pointerdown`,t,!0),()=>{document.removeEventListener(`keydown`,e,!0),document.removeEventListener(`pointerdown`,t,!0)}},[r,c.floating]),a(s,{children:[o(`div`,{ref:c.setReference,"data-testid":`stDataFrameTooltipTarget`,style:{position:`fixed`,top:e,left:t,width:0,height:0}}),o(pg,{children:o(iv,{ref:c.setFloating,style:l,role:`tooltip`,children:o(Ne,{"data-testid":`stDataFrameTooltipContent`,children:o(k,{style:{fontSize:i.fontSizes.sm},source:n,allowHTML:!1})})})})]})}var ov=(0,K.memo)(av),sv=n({default:()=>dv}),cv=`0.5rem`;function lv({element:e,elementHash:t,data:n,disabled:r,widgetMgr:i,disableFullscreenMode:s,fragmentId:c,customToolbarActions:l,widthConfig:u,heightConfig:d}){let f=(0,K.useMemo)(()=>{if(n!==void 0)return n;if(!e.arrowData)throw Error(`DataFrame element is missing arrowData`);return new le(e.arrowData)},[n,t,e.arrowData]),{expanded:p,expand:h,collapse:g,width:_,height:v}=rt(jt),{isInHorizontalLayout:y,isInRoot:b}=rt(z),x=(0,K.useRef)(null),C=(0,K.useRef)(null),T=(0,K.useRef)(null),E=Tt(),{height:D,elementRef:O}=We(),k=zh(),{getRowThemeOverride:A,onItemHovered:j}=rg(k),{enforceDownloadInNewTab:ee=!1,disableDataExport:te=!1}=(0,K.useContext)(je),[ne,re]=(0,K.useState)(!0),[ie,ae]=(0,K.useState)(!1),[oe,M]=(0,K.useState)(!1),[N,se]=(0,K.useState)(!1),[P,ce]=(0,K.useState)(),[ue,de]=(0,K.useState)(!1),fe=(0,K.useCallback)(()=>de(e=>!e),[]),pe=(0,K.useCallback)(()=>de(!1),[]),me=e.editingMode??S.EditingMode.READ_ONLY,he=me===S.EditingMode.READ_ONLY,ge=te&&he,_e=f.dimensions,ve=Math.max(0,_e.numDataRows),{canSort:ye,canSearch:F,canExportCsv:be,canShowColumnStatistics:xe,canEdit:Se,canAddRows:I,canDeleteRows:Ce,isEmptyTable:L,isLargeTable:we,isTouchDevice:R,canResizeColumns:Te,supportsFillHandle:B,supportsRectangleSelection:Ee}=eg({editingMode:me,disabled:r,numDataRows:ve,numDataColumns:_e.numDataColumns,disableDataExport:te}),[Oe,V]=(0,K.useState)(e.columnOrder);(0,K.useEffect)(()=>{V(e.columnOrder)},[e.columnOrder.join(`,`)]);let{columns:ke,allColumns:Ae,setColumnConfigMapping:H}=nh(e,f,r,Oe,u),{editingState:Me,numRows:Ne,editStateHydrationCount:Pe,updateNumRows:Fe,syncEditState:Ie,createSyncSelectionState:Le,onFormCleared:Re,loadInitialSelectionState:ze,getProgrammaticSelectionState:Be}=fg({element:e,widgetMgr:i,fragmentId:c,originalNumRows:ve,originalColumns:ke}),{getCellContent:Ve}=tg(f,ke,Ne,Me),{columns:Ge,sortColumn:Ke,getOriginalIndex:qe,getCellContent:Je}=gh(ve,ke,Ve),{buttonActionMenu:Ye,clearButtonActionMenu:Ze,handleMenuSelectAction:nt,onCellClicked:it}=ih({element:e,widgetMgr:i,fragmentId:c,columns:Ge,getCellContent:Je,getOriginalIndex:qe,theme:k.glideTheme,disabled:r}),at=(0,K.useRef)(qe);at.current=qe;let ot=(0,K.useRef)(null),{debouncedCallback:st,cancel:ct}=el((0,K.useMemo)(()=>Le(Ge,qe),[Le,Ge,qe]),150),{gridSelection:lt,isRowSelectionActivated:ut,isMultiRowSelectionActivated:dt,isColumnSelectionActivated:ft,isMultiColumnSelectionActivated:pt,isCellSelectionActivated:mt,isMultiCellSelectionActivated:ht,isRowSelected:gt,isColumnSelected:_t,isCellSelected:vt,isRequiredRowSelectionActivated:yt,clearSelection:bt,processSelectionChange:xt}=ig(e,L,r,Ge,st);(0,K.useEffect)(()=>{mt||bt(!0,!0)},[p]);let St=(0,K.useCallback)(e=>{C.current?.updateCells(e)},[]);(0,K.useEffect)(()=>{let e=ze({columns:Ge,isRowSelectionActivated:ut,isRequiredRowSelectionActivated:yt,isColumnSelectionActivated:ft,isCellSelectionActivated:mt,isMultiCellSelectionActivated:ht});e&&xt(e,{shouldSync:!1})},[]);let{restart:Ct}=Ue((0,K.useCallback)(()=>{if(T.current===null)return;let{originalRowIndices:e,columns:t,current:n}=T.current;T.current=null;let r=at.current,i=new Set(e),a=Ut.empty(),o=0;for(let e=0;e0&&xt({columns:t,rows:a,current:n},{forceSync:!0})},[ve,xt]),0,{autoStart:!1}),wt=(0,K.useCallback)(e=>{let t=ut&>if(t){let e=T.current?.originalRowIndices??lt.rows.toArray().map(qe);T.current={originalRowIndices:e,columns:lt.columns,current:void 0},ct()}bt(!0,!0),e(),t&&Ct()},[ut,gt,lt,qe,ct,bt,Ct]);(0,K.useEffect)(()=>{if(!e.selectionState||e.selectionState===ot.current)return;let t=e.selectionState;ot.current=t;let n=Be({selectionState:t,columns:Ge,isRowSelectionActivated:ut,isColumnSelectionActivated:ft,isCellSelectionActivated:mt,isMultiCellSelectionActivated:ht,getOriginalIndex:qe});n&&xt(n,{shouldSync:!1})},[e.selectionState,Ge,ut,ft,mt,ht,Be,xt,qe]);let{exportToCsv:Et}=Zh(Je,Ge,Ne,ee),{getSourceCellValue:Dt}=ng({data:f,allColumns:Ae,editingState:Me,isEditingEnabled:Se,editStateHydrationCount:Pe,syncEditState:Ie}),{onCellEdited:Ot,onPaste:kt,onRowAppended:At,onDelete:Mt,validateCell:Nt}=Vh({columns:Ge,allColumns:Ae,canAddRows:I,canDeleteRows:Ce,editingState:Me,getCellContent:Je,getSourceCellValue:Dt,getOriginalIndex:qe,refreshCells:St,updateNumRows:Fe,syncEditState:Ie,clearSelection:bt}),{tooltip:Pt,clearTooltip:Ft,onItemHovered:It}=sg(Ge,Je,(0,K.useMemo)(()=>L?[0]:I?[Ne]:[],[L,I,Ne])),{drawCell:Lt,customRenderers:Rt}=Rh(Ge,e.placeholder??void 0),{provideEditor:zt}=vh(),Bt=(0,K.useCallback)(e=>({...e,hasMenu:!L}),[L]),{columns:Vt,onColumnResize:Ht}=lh((0,K.useMemo)(()=>Ge.map(e=>Bt(pl(e))),[Ge,Bt])),{minHeight:Wt,maxHeight:Gt,minWidth:Kt,maxWidth:qt,rowHeight:U,resizableSize:Jt,setResizableSize:Yt}=ag(e,k,Ne,f.dimensions.numHeaderRows>1,_||0,v,p,u,d,D,b),Xt=(0,K.useCallback)(([e,t])=>({...fl(!0,!1),displayData:`empty`,contentAlign:`center`,allowOverlay:!1,themeOverride:{textDark:k.glideTheme.textLight},span:[0,Math.max(Ge.length-1,0)]}),[Ge,k.glideTheme.textLight]);He({element:e,widgetMgr:i,onFormCleared:(0,K.useCallback)(()=>{Re(),bt()},[Re,bt])});let{pinColumn:Zt,unpinColumn:W,freezeColumns:Qt}=sh(Ge,L,_||0,k.minColumnWidth,bt,H),{changeColumnFormat:$t}=oh(H),{hideColumn:en,showColumn:tn}=_h(bt,H),{onColumnMoved:nn}=ch(Ge,Qt,Zt,W,V),{clear:rn,restart:an}=Ue((0,K.useCallback)(()=>{if(O.current&&C.current){let e=O.current?.querySelector(`.dvn-stack`)?.getBoundingClientRect();e&&(M(e.height>O.current.clientHeight),se(e.width>O.current.clientWidth))}},[C,O]),0,{autoStart:!1}),on=(0,K.useRef)(null),{restart:sn}=Ue(()=>{w(on.current)||(C.current?.remeasureColumns(Ut.fromSingleSelection(on.current)),on.current=null)},100,{autoStart:!1});(0,K.useEffect)(()=>{let e=requestAnimationFrame(()=>{an()});return()=>{cancelAnimationFrame(e),rn()}},[rn,Vt,Ne,O,Jt,an]);let cn=!!(y||u?.useContent&&!b),ln=F&&ie;return a(rv,{className:`stDataFrame`,"data-testid":`stDataFrame`,ref:O,isInHorizontalLayout:y,minHeight:Wt,disableResize:cn,onPointerDown:e=>{if(O.current){let t=O.current.getBoundingClientRect(),n=(E||Math.round(m(cv)))+1;N&&t.height-n{!ne&&!R&&!e.currentTarget.contains(e.relatedTarget)&&!mt&&bt(!0,!0)},children:[a(tt,{isFullScreen:p,disableFullscreenMode:s,locked:gt&&!ut||vt||R&&ne||ue,onExpand:h,onCollapse:g,target:rv,children:[l?.map(e=>e),(ut&>&&!yt||ft&&_t||mt&&vt)&&o(et,{label:`Clear selection`,icon:Xe,onClick:()=>{bt(),Ft()}}),Ce&>&&o(et,{label:`Delete row(s)`,icon:Qe,onClick:()=>{Mt&&(Mt(lt),Ft())}}),I&&!gt&&o(et,{label:`Add row`,icon:vn,onClick:()=>{At&&(re(!0),At(),Ft(),C.current?.scrollTo(0,Ne,`vertical`))}}),!L&&Ae.length>0&&o(nv,{columns:Ae,columnOrder:Oe,setColumnOrder:V,hideColumn:en,showColumn:tn,isOpen:ue,onClose:pe,children:o(et,{label:`Show/hide columns`,icon:q,onClick:fe})}),be&&o(et,{label:`Download as CSV`,icon:$e,onClick:Et}),F&&o(et,{label:`Search`,icon:bn,onClick:()=>{ie?ae(!1):(re(!0),ae(!0)),Ft()}})]}),o(De,{"data-testid":`stDataFrameResizable`,ref:x,defaultSize:Jt,style:{border:`${k.tableBorderWidth}px solid ${k.glideTheme.borderColor}`,borderRadius:`${k.tableBorderRadius}`},minHeight:Wt,maxHeight:Gt,minWidth:Kt,maxWidth:cn?void 0:qt,size:Jt,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!cn,bottomLeft:!1,topLeft:!1},grid:[1,U],snapGap:U/3,onResizeStop:(e,t,n,r)=>{if(x.current){let e=2*k.tableBorderWidth;Yt({width:x.current.size.width,height:Gt-x.current.size.height===e?x.current.size.height+e:x.current.size.height})}},children:o($c,{className:`stDataFrameGlideDataEditor`,"data-testid":`stDataFrameGlideDataEditor`,ref:C,columns:Vt,rows:L?1:Ne,minColumnWidth:k.minColumnWidth,maxColumnWidth:k.maxColumnWidth,maxColumnAutoWidth:k.maxColumnAutoWidth,rowHeight:U,headerHeight:k.defaultHeaderHeight,getCellContent:L?Xt:Je,onCellClicked:L?void 0:it,onColumnResize:Te?Ht:void 0,resizeIndicator:`header`,freezeColumns:Qt,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:`none`,rangeSelect:Ee?`rect`:`cell`,columnSelect:`none`,rowSelect:`none`,onColumnMoved:ft?void 0:nn,onItemHovered:e=>{j?.(e),It?.(e)},keybindings:{downFill:!0,copy:!ge,...mt||we?{selectAll:!1}:{}},onKeyDown:e=>{F&&(e.ctrlKey||e.metaKey)&&e.key===`f`&&(ae(e=>!e),e.stopPropagation(),e.preventDefault())},showSearch:ln,searchResults:ln?void 0:[],onSearchClose:()=>{ae(!1),Ft()},onHeaderClicked:(e,t)=>{!ye||ft||(ie&&ae(!1),wt(()=>Ke(e,`auto`)))},gridSelection:lt,onGridSelectionChange:e=>{let t=e.rows.length>0||e.columns.length>0;(ne||R||t)&&(xt(e),Pt!==void 0&&Ft(),ce(void 0),de(!1),Ze())},theme:k.glideTheme,getRowThemeOverride:A,onMouseMove:e=>{e.kind===`out-of-bounds`&&ne?re(!1):e.kind!==`out-of-bounds`&&!ne&&re(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:N?-E:void 0,paddingRight:oe?-E:void 0},provideEditor:zt,drawCell:Lt,customRenderers:Rt,imageEditorOverride:Em,headerIcons:k.headerIcons,validateCell:Nt,onHeaderMenuClick:(e,t)=>{ue||ce({columnIdx:e,headerBounds:t})},onPaste:!1,...ut&&{rowMarkers:{kind:`checkbox-visible`,checkboxStyle:yt?`circle`:`square`,theme:{bgCell:k.glideTheme.bgHeader,bgCellMedium:k.glideTheme.bgHeader,textMedium:k.glideTheme.textLight}},rowSelectionMode:dt?`multi`:`auto`,rowSelect:r?`none`:dt?`multi`:`single`,rowSelectionBlending:`additive`,rangeSelectionBlending:`additive`},...ft&&{columnSelect:r?`none`:pt?`multi`:`single`,columnSelectionBlending:`additive`,columnSelectionMode:pt?`multi`:`auto`,rangeSelectionBlending:`additive`},...mt&&{rangeSelect:ht?`rect`:`cell`,rangeSelectionBlending:`additive`},...Se&&{fillHandle:B,onCellEdited:Ot,onPaste:kt,onDelete:Mt},...I&&{trailingRowOptions:{sticky:!1,tint:!0},onRowAppended:At,onHeaderClicked:void 0},...Ce&&{rowMarkers:{kind:`checkbox`,checkboxStyle:`square`,theme:{bgCell:k.glideTheme.bgHeader,bgCellMedium:k.glideTheme.bgHeader}},rowSelectionMode:`multi`,rowSelect:r?`none`:`multi`}})}),Pt?.content&&o(ov,{top:Pt.top,left:Pt.left,content:Pt.content,clearTooltip:Ft}),P&&(0,Sn.createPortal)(o(Q_,{top:P.headerBounds.y+P.headerBounds.height,left:P.headerBounds.x+P.headerBounds.width,column:ke[P.columnIdx],data:f,canShowColumnStatistics:xe,onCloseMenu:()=>ce(void 0),onSortColumn:ye?e=>{ie&&ae(!1),wt(()=>Ke(P.columnIdx,e,!0))}:void 0,isColumnPinned:ke[P.columnIdx].isPinned,onUnpinColumn:()=>{W(ke[P.columnIdx].id)},onPinColumn:()=>{Zt(ke[P.columnIdx].id)},onHideColumn:()=>{en(ke[P.columnIdx].id)},onChangeFormat:e=>{$t(ke[P.columnIdx].id,e),on.current=P.columnIdx,sn()},onAutosize:()=>{C.current?.remeasureColumns(Ut.fromSingleSelection(P.columnIdx))}}),document.querySelector(`#portal`)),Ye&&(0,Sn.createPortal)(o(Zg,{top:Ye.screenTop,left:Ye.screenLeft,actions:Ye.actions,onSelectAction:nt,onCloseMenu:Ze}),document.querySelector(`#portal`))]})}var uv=Mt(lv),dv=(0,K.memo)(uv);export{sv as n,dv as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/DateInput.VmwpQFr5.js b/venv/Lib/site-packages/streamlit/static/static/js/DateInput.VmwpQFr5.js new file mode 100644 index 0000000000000000000000000000000000000000..d046d7dcd74b18cbadc7ae280fdaaa6c81b512db --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/DateInput.VmwpQFr5.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as n,i as r}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{Xt as i,c as a}from"./utils.94RcZhG4.js";import{t as o}from"./types.cZoyy9Y-.js";import{r as s,y as c}from"./StreamlitMarkdown.DJLoxxnS.js";import{f as l}from"./getColors.DtAxY2Hd.js";import{n as ee}from"./Icon.RiOK8SDN.js";import{i as te}from"./UriUtil.olyUCSHN.js";import{t as u}from"./useEmotionTheme.D29Ufy6b.js";import{l as ne,n as re,s as ie,t as ae}from"./Tooltip.PNC8NIZa.js";import{t as oe}from"./ErrorOutline.esm.CZ5wypOV.js";import{t as se}from"./WidgetLabel.CVV1ys75.js";import{t as ce}from"./WidgetLabelHelpIcon.BmvkC-YW.js";import{g as le}from"./chevron-down.gANryksn.js";import{n as d,t as f}from"./moment.CaJaEtMO.js";import{n as ue}from"./useBasicWidgetState.CpWukz_T.js";import{i as de,n as p,r as fe,t as pe}from"./useIntlLocale.CiG3jZ1C.js";var m=365.2425,h=6048e5,g=864e5,_=3600*24;_*7,_*m/12*3;var v=Symbol.for(`constructDateFrom`);function y(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&v in e?e[v](t):e instanceof Date?new e.constructor(t):new Date(t)}function b(e,t){return y(t||e,e)}var x={};function S(){return x}function C(e,t){let n=S(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=b(e,t?.in),a=i.getDay(),o=(a=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function E(e){let t=b(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function D(e,...t){let n=y.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function O(e,t){let n=b(e,t?.in);return n.setHours(0,0,0,0),n}function k(e,t,n){let[r,i]=D(n?.in,e,t),a=O(r),o=O(i),s=+a-E(a),c=+o-E(o);return Math.round((s-c)/g)}function A(e,t){let n=T(e,t),r=y(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),w(r)}function j(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function M(e){return!(!j(e)&&typeof e!=`number`||isNaN(+b(e)))}function N(e,t){let n=b(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function P(e,t){let n=b(e,t?.in);return k(n,N(n))+1}function F(e,t){let n=b(e,t?.in),r=w(n)-+A(n);return Math.round(r/h)+1}function I(e,t){let n=b(e,t?.in),r=n.getFullYear(),i=S(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=y(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=C(o,t),c=y(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=C(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function L(e,t){let n=S(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=I(e,t),a=y(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),C(a,t)}function R(e,t){let n=b(e,t?.in),r=C(n,t)-+L(n,t);return Math.round(r/h)+1}function z(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var B={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return z(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):z(n+1,2)},d(e,t){return z(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return z(e.getHours()%12||12,t.length)},H(e,t){return z(e.getHours(),t.length)},m(e,t){return z(e.getMinutes(),t.length)},s(e,t){return z(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return z(Math.trunc(r*10**(n-3)),t.length)}},V={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},H={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return B.y(e,t)},Y:function(e,t,n,r){let i=I(e,r),a=i>0?i:1-i;return t===`YY`?z(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):z(a,t.length)},R:function(e,t){return z(T(e),t.length)},u:function(e,t){return z(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return z(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return z(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return B.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return z(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=R(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):z(i,t.length)},I:function(e,t,n){let r=F(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):z(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):B.d(e,t)},D:function(e,t,n){let r=P(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):z(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return z(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return z(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return z(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?V.noon:r===0?V.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?V.evening:r>=12?V.afternoon:r>=4?V.morning:V.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return B.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):B.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):z(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):z(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):B.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):B.s(e,t)},S:function(e,t){return B.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return W(r);case`XXXX`:case`XX`:return G(r);default:return G(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return W(r);case`xxxx`:case`xx`:return G(r);default:return G(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+U(r,`:`);default:return`GMT`+G(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+U(r,`:`);default:return`GMT`+G(r,`:`)}},t:function(e,t,n){return z(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return z(+e,t.length)}};function U(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+z(a,2)}function W(e,t){return e%60==0?(e>0?`-`:`+`)+z(Math.abs(e)/60,2):G(e,t)}function G(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=z(Math.trunc(r/60),2),a=z(r%60,2);return n+i+t+a}var K=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},q=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},me={p:q,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return K(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,K(r,t)).replace(`{{time}}`,q(i,t))}},he=/^D+$/,ge=/^Y+$/,_e=[`D`,`DD`,`YY`,`YYYY`];function ve(e){return he.test(e)}function ye(e){return ge.test(e)}function be(e,t,n){let r=xe(e,t,n);if(console.warn(r),_e.includes(e))throw RangeError(r)}function xe(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Se=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ce=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,we=/^'([^]*?)'?$/,Te=/''/g,Ee=/[a-zA-Z]/;function J(e,t,n){let r=S(),i=n?.locale??r.locale??p,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=b(e,n?.in);if(!M(s))throw RangeError(`Invalid time value`);let c=t.match(Ce).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=me[t];return n(e,i.formatLong)}return e}).join(``).match(Se).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:De(e)};if(H[t])return{isToken:!0,value:e};if(t.match(Ee))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&ye(a)||!n?.useAdditionalDayOfYearTokens&&ve(a))&&be(a,t,String(e));let o=H[a[0]];return o(s,a,i.localize,l)}).join(``)}function De(e){let t=e.match(we);return t?t[1].replace(Te,`'`):e}var Y=e(t(),1);d();var X=`YYYY-MM-DD`;function Z(e){return e.map(e=>f(e,X).toDate())}function Oe(e){return e?e.map(e=>f(e).format(X)):[]}function ke({disabled:e,element:t,widgetMgr:d,fragmentId:p}){let m=u(),h=(0,Y.useContext)(c),[g,_]=(0,Y.useState)(!1),[v,y]=(0,Y.useState)(null),b=(0,Y.useCallback)(()=>{y(null)},[]),x=(0,Y.useCallback)(()=>{b(),_(!1)},[b]),[S,C]=ue({getStateFromWidgetMgr:Ae,getDefaultStateFromProto:je,getCurrStateFromProto:Me,updateWidgetMgrState:Ne,element:t,widgetMgr:d,fragmentId:p,queryParamBinding:t.queryParamKey?{paramKey:t.queryParamKey,valueType:`string_array_value`,clearable:t.default.length===0,urlFormat:t.isRange?`repeated`:void 0}:void 0,formClearBehavior:`resetValueAndRunCallback`,onFormCleared:x}),{colors:w,fontSizes:T,fontWeights:E,lineHeights:D,spacing:O,sizes:k,zIndices:A}=u(),{locale:j}=(0,Y.useContext)(te),M=pe(j),N=(0,Y.useMemo)(()=>f(t.min,X).toDate(),[t.min]),P=(0,Y.useMemo)(()=>Pe(t),[t]),F=(0,Y.useMemo)(()=>{if(!t.isRange)return!1;let e=f().subtract(2,`years`).toDate();return Nt.format.replaceAll(/[a-zA-Z]/g,`9`),[t.format]),R=(0,Y.useMemo)(()=>t.format.replaceAll(`Y`,`y`).replaceAll(`D`,`d`),[t.format]),z=(0,Y.useMemo)(()=>J(N,R,{locale:M}),[N,R,M]),B=(0,Y.useMemo)(()=>P?J(P,R,{locale:M}):``,[P,R,M]),V=(0,Y.useCallback)(e=>e?t.isRange?`**Error**: ${e} date set outside allowed range. Please select a date ${e===`End`?`before ${B}`:`after ${z}`}.`:`**Error**: Date set outside allowed range. Please select a date between ${z} and ${B}.`:null,[t.isRange,B,z]),H=(0,Y.useCallback)(({date:e})=>{if(b(),o(e)){C({value:[],fromUi:!0}),_(!0);return}let{errorType:t,newDates:n}=Q(Array.isArray(e)?e.filter(e=>!!e).map(e=>$(e)):$(e),N,P);t&&y(V(t)),C({value:n,fromUi:!0}),_(!n)},[V,P,N,b,y,C]),U=(0,Y.useCallback)(()=>{if(!g)return;let e=Z(t.default);C({value:e,fromUi:!0}),_(!e)},[g,t,C]);return n(`div`,{className:`stDateInput`,"data-testid":`stDateInput`,children:[r(se,{label:t.label,disabled:e,labelVisibility:i(t.labelVisibility?.value),children:t.help&&r(ce,{content:t.help,label:t.label})}),r(fe,{locale:M,density:de.high,formatString:R,mask:t.isRange?`${L} – ${L}`:L,placeholder:t.isRange?`${t.format} – ${t.format}`:t.format,disabled:e,onChange:H,onClose:U,quickSelect:F,overrides:{Popover:{props:{ignoreBoundary:h,placement:le.bottomLeft,popoverMargin:a(m.spacing.twoXS),overrides:{Body:{style:{...ne(m),...l(m)&&{borderWidth:m.spacing.none}}}}}},CalendarContainer:{style:{fontSize:T.sm,paddingRight:O.xs,paddingLeft:O.xs,paddingBottom:O.xs,paddingTop:O.xs,borderWidth:m.spacing.none}},Week:{style:{fontSize:T.sm}},Day:{style:({$pseudoHighlighted:e,$pseudoSelected:t,$selected:n,$isHovered:r,$isHighlighted:i})=>({fontSize:T.sm,lineHeight:D.base,"::before":{backgroundColor:n||t||e||r?`${w.darkenedBgMix15} !important`:w.transparent},"::after":{borderColor:i?w.primary:w.transparent},...l(m)&&r&&t&&!n?{color:w.secondaryBg}:{}})},PrevButton:{style:()=>({display:`flex`,alignItems:`center`,justifyContent:`center`,":active":{backgroundColor:w.transparent},":focus":{backgroundColor:w.transparent,outline:0}})},NextButton:{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,":active":{backgroundColor:w.transparent},":focus":{backgroundColor:w.transparent,outline:0}}},Input:{props:{maskChar:null,endEnhancer:v&&r(re,{content:r(s,{source:v,allowHTML:!1}),placement:ae.TOP_RIGHT,error:!0,children:r(ee,{content:oe,size:`base`})}),overrides:{EndEnhancer:{style:{color:w.redTextColor,backgroundColor:w.transparent}},Root:{style:({$isFocused:e})=>{let t=ie(w,e);return{borderLeftWidth:k.borderWidth,borderRightWidth:k.borderWidth,borderTopWidth:k.borderWidth,borderBottomWidth:k.borderWidth,paddingRight:O.twoXS,borderTopColor:t,borderRightColor:t,borderBottomColor:t,borderLeftColor:t,...v&&{backgroundColor:w.redBackgroundColor}}}},ClearIcon:{props:{overrides:{Svg:{style:{color:w.grayTextColor,padding:O.threeXS,height:k.clearIconSize,width:k.clearIconSize,":hover":{fill:w.bodyText}}}}}},InputContainer:{style:{backgroundColor:`transparent`}},Input:{style:{position:`relative`,zIndex:A.priority,fontWeight:E.normal,paddingRight:O.sm,paddingLeft:`calc(${O.sm} + ${k.tagMarginInsideBorder})`,paddingBottom:O.sm,paddingTop:O.sm,lineHeight:D.inputWidget,"::placeholder":{color:w.fadedText60},...v&&{color:w.redTextColor}},props:{"data-testid":`stDateInputField`}}}}},QuickSelect:{props:{overrides:{ControlContainer:{style:{height:k.minElementHeight,borderLeftWidth:k.borderWidth,borderRightWidth:k.borderWidth,borderTopWidth:k.borderWidth,borderBottomWidth:k.borderWidth}}}}}},value:S,minDate:N,maxDate:P,range:t.isRange,clearable:I})]})}function Ae(e,t){let n=e.getStringArrayValue(t);if(n!==void 0)return Z(n)}function je(e){return Z(e.default)??[]}function Me(e){return Z(e.value)??[]}function Ne(e,t,n,r){let i=f(e.min,X).toDate(),a=Pe(e),o=!0,{errorType:s}=Q((n.value||[]).map(e=>$(e)),i,a);s&&(o=!1),o&&t.setStringArrayValue(e,Oe(n.value),{fromUi:n.fromUi},r)}function Q(e,t,n){let r=[],i=null;return o(e)?{errorType:null,newDates:[]}:(Array.isArray(e)?e.forEach(e=>{e&&(n&&e>n?i=`End`:en?i=`End`:e0?f(t,X).toDate():void 0}function $(e){let t=new Date(e.getTime());return t.setHours(0,0,0,0),t}var Fe=(0,Y.memo)(ke);export{Fe as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/DateTimeInput.grj3wp9V.js b/venv/Lib/site-packages/streamlit/static/static/js/DateTimeInput.grj3wp9V.js new file mode 100644 index 0000000000000000000000000000000000000000..23446ab8f18131858ae195cccb4598aad6c1ef44 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/DateTimeInput.grj3wp9V.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as n,i as r}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{Xt as i,c as a}from"./utils.94RcZhG4.js";import{t as o}from"./types.cZoyy9Y-.js";import{r as s,y as c}from"./StreamlitMarkdown.DJLoxxnS.js";import{f as l}from"./getColors.DtAxY2Hd.js";import{n as u}from"./Icon.RiOK8SDN.js";import{i as d}from"./UriUtil.olyUCSHN.js";import{t as f}from"./useEmotionTheme.D29Ufy6b.js";import{l as p,n as m,s as h,t as g}from"./Tooltip.PNC8NIZa.js";import{t as _}from"./ErrorOutline.esm.CZ5wypOV.js";import{t as v}from"./WidgetLabel.CVV1ys75.js";import{t as y}from"./WidgetLabelHelpIcon.BmvkC-YW.js";import{t as b}from"./useWindowDimensionsContext.HIxtcWyF.js";import{t as x}from"./useScrollbarGutterSize.B_VG1Wad.js";import{g as S,t as C}from"./chevron-down.gANryksn.js";import{n as w,t as T}from"./moment.CaJaEtMO.js";import{n as E}from"./useBasicWidgetState.CpWukz_T.js";import{i as D,r as O,t as k}from"./useIntlLocale.CiG3jZ1C.js";import{n as A,r as j}from"./styled-components.BxoGPtnX.js";var M=e(t(),1);w();var N=j(A),ee=({theme:e,isInSidebar:t,step:n,minTime:i,maxTime:o,disabled:c,clearable:d,error:f,scrollbarGutterSize:v,windowHeight:y})=>{let b=Math.ceil(86400/n),x=a(e.sizes.dropdownItemHeight),w=Math.min(a(e.sizes.maxDropdownHeight),y*.7),T=b*x>w;return{Popover:{props:{ignoreBoundary:t,placement:S.bottomLeft,popoverMargin:a(e.spacing.twoXS),overrides:{Body:{style:{...p(e),...l(e)&&{borderWidth:e.spacing.none}}}}}},CalendarContainer:{style:{fontSize:e.fontSizes.sm,paddingRight:e.spacing.xs,paddingLeft:e.spacing.xs,paddingBottom:e.spacing.none,paddingTop:e.spacing.xs,borderWidth:e.spacing.none}},Week:{style:{fontSize:e.fontSizes.sm}},Day:{style:({$pseudoHighlighted:t,$pseudoSelected:n,$selected:r,$isHovered:i,$isHighlighted:a})=>({fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,"::before":{backgroundColor:r||n||t||i?`${e.colors.darkenedBgMix15} !important`:e.colors.transparent},"::after":{borderColor:a?e.colors.primary:e.colors.transparent},...l(e)&&i&&n&&!r?{color:e.colors.secondaryBg}:{}})},PrevButton:{style:()=>({display:`flex`,alignItems:`center`,justifyContent:`center`,":active":{backgroundColor:e.colors.transparent},":focus":{backgroundColor:e.colors.transparent,outline:0}})},NextButton:{style:()=>({display:`flex`,alignItems:`center`,justifyContent:`center`,":active":{backgroundColor:e.colors.transparent},":focus":{backgroundColor:e.colors.transparent,outline:0}})},Input:{props:{maskChar:null,endEnhancer:f&&r(m,{content:r(s,{source:f,allowHTML:!1}),placement:g.TOP_RIGHT,error:!0,children:r(u,{content:_,size:`base`})}),overrides:{EndEnhancer:{style:{color:f?e.colors.redTextColor:e.colors.grayTextColor,backgroundColor:e.colors.transparent}},Root:{style:({$isFocused:t})=>{let n=h(e.colors,t);return{borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,paddingRight:e.spacing.twoXS,borderTopColor:n,borderRightColor:n,borderBottomColor:n,borderLeftColor:n,...f&&{backgroundColor:e.colors.redBackgroundColor}}}},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.grayTextColor,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,":hover":{fill:e.colors.bodyText}}}}}},InputContainer:{style:{backgroundColor:`transparent`}},Input:{style:{fontWeight:e.fontWeights.normal,paddingRight:e.spacing.sm,paddingLeft:`calc(${e.spacing.sm} + ${e.sizes.tagMarginInsideBorder})`,paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm,lineHeight:e.lineHeights.inputWidget,"::placeholder":{color:e.colors.fadedText60},...f&&{color:e.colors.redTextColor}},props:{"data-testid":`stDateTimeInputField`}}}}},TimeSelectContainer:{style:{paddingTop:e.spacing.none,paddingBottom:e.spacing.none}},TimeSelectFormControl:{style:{marginBottom:e.spacing.none},props:{overrides:{Label:{component:()=>null}}}},TimeSelect:{props:{step:n,format:`24`,disabled:c,nullable:d,minTime:i,maxTime:o,overrides:{Select:{props:{disabled:c,overrides:{ControlContainer:{style:({$isFocused:t})=>{let n=h(e.colors,t);return{height:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,borderTopColor:n,borderRightColor:n,borderBottomColor:n,borderLeftColor:n}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ValueContainer:{style:()=>({lineHeight:e.lineHeights.inputWidget,paddingRight:e.spacing.sm,paddingLeft:`calc(${e.spacing.sm} + ${e.sizes.tagMarginInsideBorder})`,paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm})},SingleValue:{style:{fontWeight:e.fontWeights.normal,marginLeft:e.spacing.none},props:{"data-testid":`stDateTimeInputTimeDisplay`}},Dropdown:{style:()=>({paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingLeft:e.spacing.none,paddingRight:e.spacing.none,boxShadow:`none`,maxHeight:`min(${e.sizes.maxDropdownHeight}, 70vh)`,"--scrollbar-gutter-size":T?`${v}px`:`0px`})},DropdownContainer:{style:()=>({...p(e),overflow:`hidden`})},DropdownListItem:{component:N},Popover:{props:{ignoreBoundary:t,popoverMargin:a(e.spacing.twoXS),overrides:{Body:{style:()=>({overflow:`hidden`})}}}},Placeholder:{style:()=>({color:e.colors.fadedText60,position:`absolute`})},Input:{style:{position:`relative`,zIndex:e.zIndices.priority}},SelectArrow:{component:C,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.lg,height:e.iconSizes.lg})}}}}}}}}}}}},P=`YYYY-MM-DDTHH:mm`,F=(e,t)=>{let n=e.getStringArrayValue(t);if(n!==void 0)return n.length>0?n[0]:null},I=e=>e.default?.length?e.default[0]:null,L=e=>e.value?.length?e.value[0]:null,R=e=>{let t;if(t=Array.isArray(e)?e.find(e=>e instanceof Date):e,!t||Number.isNaN(t.getTime()))return null;let n=new Date(t.getTime());return n.setSeconds(0,0),n},z=[P,`YYYY/MM/DD, HH:mm`],B=e=>{if(o(e)||e===``)return null;let t=T(e,z,!0);return t.isValid()?R(t.toDate()):null},V=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),H=(e,t)=>{let n=new Date(e.getTime());return n.setHours(t.getHours(),t.getMinutes(),0,0),n},te=(e,t,n,r)=>{let i=B(e.min),a=B(e.max),o=i=>{t.setStringArrayValue(e,i?[i]:[],{fromUi:n.fromUi},r)};if(n.value){let e=B(n.value);if(e){i&&ea||o(n.value);return}}o(n.value)};w();function U({disabled:e,element:t,widgetMgr:a,fragmentId:o}){let s=f(),l=(0,M.useContext)(c),u=x(),{innerHeight:p}=b(),m=(0,M.useRef)(null),h=t.queryParamKey?{paramKey:t.queryParamKey,valueType:`string_array_value`,clearable:t.default.length===0}:void 0,g=()=>B(F(a,t)??(t.setValue?L(t):I(t))),[_,S]=(0,M.useState)(g),[C,w]=(0,M.useState)(g),[A,j]=E({getStateFromWidgetMgr:F,getDefaultStateFromProto:I,getCurrStateFromProto:L,updateWidgetMgrState:te,element:t,widgetMgr:a,fragmentId:o,queryParamBinding:h,formClearBehavior:`resetValueAndRunCallback`,onFormCleared:(0,M.useCallback)(()=>{S(B(I(t)))},[t])}),{locale:N}=(0,M.useContext)(d),z=k(N),U=t.step?Number(t.step):900,W=(0,M.useMemo)(()=>B(t.min),[t.min]),G=(0,M.useMemo)(()=>B(t.max),[t.max]),K=(0,M.useMemo)(()=>B(A),[A]);K!==C&&(S(K),w(K));let q=W??void 0,J=G??void 0,Y=(0,M.useMemo)(()=>{if(!(!_||!W))return V(_,W)?H(_,W):void 0},[_,W]),X=(0,M.useMemo)(()=>{if(!(!_||!G))return V(_,G)?H(_,G):void 0},[_,G]),Z=t.format.replaceAll(/[a-zA-Z]/g,`9`),Q=`${t.format.replaceAll(`Y`,`y`).replaceAll(`D`,`d`)}, HH:mm`,ne=`${Z}, 99:99`,re=`${t.format}, HH:MM`,$=(t.default&&t.default.length>0?t.default[0]:``).length===0&&!e,ie=(0,M.useMemo)(()=>_&&(W&&_G)?`**Error**: Date and time set outside allowed range. Please select a date and time between ${T(W).format(Q)} and ${T(G).format(Q)}.`:null,[_,W,G,Q]),ae=(0,M.useCallback)(({date:e})=>{let t=R(e);S(t),m.current?.open?.()},[]),oe=(0,M.useCallback)(()=>{let e=_?T(_).format(P):null;e!==A&&j({value:e,fromUi:!0})},[_,A,j]),se=ee({theme:s,isInSidebar:l,step:U,minTime:Y,maxTime:X,disabled:e,clearable:$,error:ie,scrollbarGutterSize:u,windowHeight:p});return n(`div`,{className:`stDateTimeInput`,"data-testid":`stDateTimeInput`,children:[r(v,{label:t.label,disabled:e,labelVisibility:i(t.labelVisibility?.value),children:t.help&&r(y,{content:t.help,label:t.label})}),r(O,{ref:m,locale:z,density:D.high,value:_,onChange:ae,onClose:oe,minDate:q,maxDate:J,disabled:e,timeSelectStart:!0,formatString:Q,mask:ne,placeholder:re,clearable:$,overrides:se,"aria-label":t.label})]})}var W=(0,M.memo)(U);export{W as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/DeckGlJsonChart.Cl5CHFIi.js b/venv/Lib/site-packages/streamlit/static/static/js/DeckGlJsonChart.Cl5CHFIi.js new file mode 100644 index 0000000000000000000000000000000000000000..57e1386ce6af745fe13f433a7beddeb2c52191ce --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/DeckGlJsonChart.Cl5CHFIi.js @@ -0,0 +1,8191 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./webgl-device.7mKl-kgB.js","./rolldown-runtime.DAXXjFlN.js"])))=>i.map(i=>d[i]); +import{i as e,o as t,r as n,t as r}from"./rolldown-runtime.DAXXjFlN.js";import{r as i}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a,i as o,r as s,t as c,y as l}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{p as u}from"./protobuf.DC2L68b9.js";import{t as d}from"./types.cZoyy9Y-.js";import{C as f}from"./StreamlitMarkdown.DJLoxxnS.js";import{t as p}from"./isEqual.CgNOpGTC.js";import{C as m,b as h,f as g}from"./getColors.DtAxY2Hd.js";import{a as _}from"./utils.BrY_0PXX.js";import{i as v}from"./UriUtil.olyUCSHN.js";import{t as y}from"./useEmotionTheme.D29Ufy6b.js";import{t as b}from"./preload-helper.HclGiUj8.js";import{n as x}from"./useExecuteWhenChanged.CJi0fna4.js";import{i as S,n as C}from"./objectWithoutPropertiesLoose.DkqnLJVA.js";import{n as w}from"./index.esm.DCRlH4DP.js";import{n as T,t as E}from"./toConsumableArray.BxvvZSIl.js";import{n as D,t as O}from"./Toolbar.BynU-Hbw.js";import{t as k}from"./useRequiredContext.F4hG38Ff.js";import{D as A,I as j,c as M,d as N,r as P,s as ee,t as F,u as I}from"./recordbatch.BmKVw6jF.js";import{n as te,t as ne}from"./ResizeObserver.es.CdkJ1I5V.js";import{t as re}from"./slicedToArray.624-tfZX.js";import{a as ie,i as ae,n as L,r as oe,t as se}from"./possibleConstructorReturn.DlxXudXd.js";import{t as ce}from"./assertThisInitialized.Cpir0pD1.js";import{n as le,t as ue}from"./withFullScreenWrapper.DjqP6oFO.js";import{t as de}from"./dist.CETvsizV.js";import{t as fe}from"./linear.CR3348bP.js";import{t as pe}from"./threshold.BuzS4kmB.js";import{A as me,C as R,D as z,E as he,O as ge,S as _e,T as ve,_ as B,a as ye,b as V,c as H,d as be,f as xe,g as Se,h as Ce,i as we,j as Te,k as Ee,l as De,m as Oe,o as ke,p as Ae,r as je,s as Me,t as Ne,u as Pe,v as Fe,w as U,x as Ie,y as Le}from"./webgl-device.7mKl-kgB.js";import{t as Re}from"./useBasicWidgetState.CpWukz_T.js";globalThis.probe={};var W=new ge({id:`@probe.gl/log`}),ze=`set luma.log.level=1 (or higher) to trace rendering`,Be="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.",Ve=new class e{static defaultProps={...Fe.defaultProps,type:`best-available`,adapters:void 0,waitForPageLoad:!0};stats=me;log=z;VERSION=`9.3.3`;spector;preregisteredAdapters=new Map;constructor(){if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw z.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),z.error(`'yarn why @luma.gl/core' can help identify the source of the conflict`)(),Error(`luma.gl - multiple versions detected: see console log`);z.error(`This version of luma.gl has already been initialized`)()}z.log(1,`${this.VERSION} - ${ze}`)(),globalThis.luma=this}async createDevice(t={}){let n={...e.defaultProps,...t},r=this.selectAdapter(n.type,n.adapters);if(!r)throw Error(Be);return n.waitForPageLoad&&await r.pageLoaded,await r.create(n)}async attachDevice(e,t){let n=this._getTypeFromHandle(e,t.adapters),r=n&&this.selectAdapter(n,t.adapters);if(!r)throw Error(Be);return await r?.attach?.(e,t)}registerAdapters(e){for(let t of e)this.preregisteredAdapters.set(t.type,t)}getSupportedAdapters(e=[]){let t=this._getAdapterMap(e);return Array.from(t).map(([,e])=>e).filter(e=>e.isSupported?.()).map(e=>e.type)}getBestAvailableAdapterType(e=[]){let t=[`webgpu`,`webgl`,`null`],n=this._getAdapterMap(e);for(let e of t)if(n.get(e)?.isSupported?.())return e;return null}selectAdapter(e,t=[]){let n=e;e===`best-available`&&(n=this.getBestAvailableAdapterType(t));let r=this._getAdapterMap(t);return n&&r.get(n)||null}enforceWebGL2(e=!0,t=[]){let n=this._getAdapterMap(t).get(`webgl`);n||z.warn(`enforceWebGL2: webgl adapter not found`)(),n?.enforceWebGL2?.(e)}setDefaultDeviceProps(t){Object.assign(e.defaultProps,t)}_getAdapterMap(e=[]){let t=new Map(this.preregisteredAdapters);for(let n of e)t.set(n.type,n);return t}_getTypeFromHandle(e,t=[]){return e instanceof WebGL2RenderingContext?`webgl`:typeof GPUDevice<`u`&&e instanceof GPUDevice||e?.queue?`webgpu`:e===null?`null`:(e instanceof WebGLRenderingContext?z.warn(`WebGL1 is not supported`,e)():z.warn(`Unknown handle type`,e)(),null)}},He=class{get pageLoaded(){return Ke()}},Ue=Ee()&&typeof document<`u`,We=()=>Ue&&document.readyState===`complete`,Ge=null;function Ke(){return Ge||=We()||typeof window>`u`?Promise.resolve():new Promise(e=>window.addEventListener(`load`,()=>e())),Ge}var G=class e extends ve{get[Symbol.toStringTag](){return`ComputePipeline`}hash=``;shaderLayout;constructor(t,n){super(t,n,e.defaultProps),this.shaderLayout=n.shaderLayout}static defaultProps={...ve.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0}},qe=class e{static defaultProps={...Ae.defaultProps};static getDefaultPipelineFactory(t){let n=t.getModuleData(`@luma.gl/core`);return n.defaultPipelineFactory||=new e(t),n.defaultPipelineFactory}device;_hashCounter=0;_hashes={};_renderPipelineCache={};_computePipelineCache={};_sharedRenderPipelineCache={};get[Symbol.toStringTag](){return`PipelineFactory`}toString(){return`PipelineFactory(${this.device.id})`}constructor(e){this.device=e}createRenderPipeline(e){if(!this.device.props._cachePipelines)return this.device.createRenderPipeline(e);let t={...Ae.defaultProps,...e},n=this._renderPipelineCache,r=this._hashRenderPipeline(t),i=n[r]?.resource;if(i)n[r].useCount++,this.device.props.debugFactories&&z.log(3,`${this}: ${n[r].resource} reused, count=${n[r].useCount}, (id=${e.id})`)();else{let e=this.device.type===`webgl`&&this.device.props._sharePipelines?this.createSharedRenderPipeline(t):void 0;i=this.device.createRenderPipeline({...t,id:t.id?`${t.id}-cached`:he(`unnamed-cached`),_sharedRenderPipeline:e}),i.hash=r,n[r]={resource:i,useCount:1},this.device.props.debugFactories&&z.log(3,`${this}: ${i} created, count=${n[r].useCount}`)()}return i}createComputePipeline(e){if(!this.device.props._cachePipelines)return this.device.createComputePipeline(e);let t={...G.defaultProps,...e},n=this._computePipelineCache,r=this._hashComputePipeline(t),i=n[r]?.resource;return i?(n[r].useCount++,this.device.props.debugFactories&&z.log(3,`${this}: ${n[r].resource} reused, count=${n[r].useCount}, (id=${e.id})`)()):(i=this.device.createComputePipeline({...t,id:t.id?`${t.id}-cached`:void 0}),i.hash=r,n[r]={resource:i,useCount:1},this.device.props.debugFactories&&z.log(3,`${this}: ${i} created, count=${n[r].useCount}`)()),i}release(e){if(!this.device.props._cachePipelines){e.destroy();return}let t=this._getCache(e),n=e.hash;t[n].useCount--,t[n].useCount===0?(this._destroyPipeline(e),this.device.props.debugFactories&&z.log(3,`${this}: ${e} released and destroyed`)()):t[n].useCount<0?(z.error(`${this}: ${e} released, useCount < 0, resetting`)(),t[n].useCount=0):this.device.props.debugFactories&&z.log(3,`${this}: ${e} released, count=${t[n].useCount}`)()}createSharedRenderPipeline(e){let t=this._hashSharedRenderPipeline(e),n=this._sharedRenderPipelineCache[t];return n||(n={resource:this.device._createSharedRenderPipelineWebGL(e),useCount:0},this._sharedRenderPipelineCache[t]=n),n.useCount++,n.resource}releaseSharedRenderPipeline(e){if(!e.sharedRenderPipeline)return;let t=this._hashSharedRenderPipeline(e.sharedRenderPipeline.props),n=this._sharedRenderPipelineCache[t];n&&(n.useCount--,n.useCount===0&&(n.resource.destroy(),delete this._sharedRenderPipelineCache[t]))}_destroyPipeline(e){let t=this._getCache(e);return this.device.props._destroyPipelines?(delete t[e.hash],e.destroy(),e instanceof Ae&&this.releaseSharedRenderPipeline(e),!0):!1}_getCache(e){let t;if(e instanceof G&&(t=this._computePipelineCache),e instanceof Ae&&(t=this._renderPipelineCache),!t)throw Error(`${this}`);if(!t[e.hash])throw Error(`${this}: ${e} matched incorrect entry`);return t}_hashComputePipeline(e){let{type:t}=this.device;return`${t}/C/${this._getHash(e.shader.source)}SL${this._getHash(JSON.stringify(e.shaderLayout))}`}_hashRenderPipeline(e){let t=e.vs?this._getHash(e.vs.source):0,n=e.fs?this._getHash(e.fs.source):0,r=this._getWebGLVaryingHash(e),i=this._getHash(JSON.stringify(e.shaderLayout)),a=this._getHash(JSON.stringify(e.bufferLayout)),{type:o}=this.device;switch(o){case`webgl`:let s=this._getHash(JSON.stringify(e.parameters));return`${o}/R/${t}/${n}V${r}T${e.topology}P${s}SL${i}BL${a}`;default:let c=this._getHash(JSON.stringify({vertexEntryPoint:e.vertexEntryPoint,fragmentEntryPoint:e.fragmentEntryPoint})),l=this._getHash(JSON.stringify(e.parameters)),u=this._getWebGPUAttachmentHash(e);return`${o}/R/${t}/${n}V${r}T${e.topology}EP${c}P${l}SL${i}BL${a}A${u}`}}_hashSharedRenderPipeline(e){return`webgl/S/${e.vs?this._getHash(e.vs.source):0}/${e.fs?this._getHash(e.fs.source):0}V${this._getWebGLVaryingHash(e)}`}_getHash(e){return this._hashes[e]===void 0&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getWebGLVaryingHash(e){let{varyings:t=[],bufferMode:n=null}=e;return this._getHash(JSON.stringify({varyings:t,bufferMode:n}))}_getWebGPUAttachmentHash(e){let t=e.colorAttachmentFormats??[this.device.preferredColorFormat],n=e.parameters?.depthWriteEnabled?e.depthStencilAttachmentFormat||this.device.preferredDepthFormat:null;return this._getHash(JSON.stringify({colorAttachmentFormats:t,depthStencilAttachmentFormat:n}))}},Je=class e{static defaultProps={...Oe.defaultProps};static getDefaultShaderFactory(t){let n=t.getModuleData(`@luma.gl/core`);return n.defaultShaderFactory||=new e(t),n.defaultShaderFactory}device;_cache={};get[Symbol.toStringTag](){return`ShaderFactory`}toString(){return`${this[Symbol.toStringTag]}(${this.device.id})`}constructor(e){this.device=e}createShader(e){if(!this.device.props._cacheShaders)return this.device.createShader(e);let t=this._hashShader(e),n=this._cache[t];if(n)n.useCount++,this.device.props.debugFactories&&z.log(3,`${this}: Reusing shader ${n.resource.id} count=${n.useCount}`)();else{let r=this.device.createShader({...e,id:e.id?`${e.id}-cached`:void 0});this._cache[t]=n={resource:r,useCount:1},this.device.props.debugFactories&&z.log(3,`${this}: Created new shader ${r.id}`)()}return n.resource}release(e){if(!this.device.props._cacheShaders){e.destroy();return}let t=this._hashShader(e),n=this._cache[t];if(n)if(n.useCount--,n.useCount===0)this.device.props._destroyShaders&&(delete this._cache[t],n.resource.destroy(),this.device.props.debugFactories&&z.log(3,`${this}: Releasing shader ${e.id}, destroyed`)());else if(n.useCount<0)throw Error(`ShaderFactory: Shader ${e.id} released too many times`);else this.device.props.debugFactories&&z.log(3,`${this}: Releasing shader ${e.id} count=${n.useCount}`)()}_hashShader(e){return`${e.stage}:${e.source}`}};function Ye(e,t={}){let n={...e},r=t.layout??`std140`,i={},a=0;for(let[e,t]of Object.entries(n))a=Qe(i,e,t,a,r);return a=Me(a,et(n,r)),{layout:r,byteLength:a*4,uniformTypes:n,fields:i}}function Xe(e,t){let n=be(e),r=Pe(n),i=/^mat(\d)x(\d)<.+>$/.exec(n);if(i){let e=Number(i[1]),a=Number(i[2]),o=tt(a,n,r.type,t),s=it(o.size,o.alignment,t);return{alignment:o.alignment,size:e*s,components:e*a,columns:e,rows:a,columnStride:s,shaderType:n,type:r.type}}let a=/^vec(\d)<.+>$/.exec(n);return a?tt(Number(a[1]),n,r.type,t):{alignment:1,size:1,components:1,columns:1,rows:1,columnStride:1,shaderType:n,type:r.type}}function Ze(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Qe(e,t,n,r,i){if(typeof n==`string`){let a=Xe(n,i),o=Me(r,a.alignment);return e[t]={offset:o,...a},o+a.size}if(Array.isArray(n)){if(Array.isArray(n[0]))throw Error(`Nested arrays are not supported for ${t}`);let a=n[0],o=n[1],s=nt(a,i),c=Me(r,et(n,i));for(let n=0;n=a.length)break;o===1?e[`${t}[${n}]`]=Number(a[r]):e[`${t}[${n}]`]=dt(i,r,r+o)}}_writeLeafValue(e,t,n){let r=this.layout.fields[t];if(!r){z.warn(`Uniform ${t} not found in layout`)();return}let{type:i,components:a,columns:o,rows:s,offset:c,columnStride:l}=r,u=e[i];if(a===1){u[c]=Number(n);return}let d=n;if(o===1){for(let e=0;ea)return!1;for(let e=0;et.type===`uniform`&&t.name===e?.name);if(!t)throw Error(e?.name);let n=t;for(let e of n.uniforms||[])this.bindingLayout[e.name]=e}}setUniforms(e){for(let[t,n]of Object.entries(e))this._setUniform(t,n),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${t}=${n}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,t){pt(this.uniforms[e],t)||(this.uniforms[e]=mt(t),this.modifiedUniforms[e]=!0,this.modified=!0)}},gt=1024,_t=class{device;uniformBlocks=new Map;shaderBlockLayouts=new Map;shaderBlockWriters=new Map;uniformBuffers=new Map;constructor(e,t){this.device=e;for(let[n,r]of Object.entries(t)){let t=n,i=Ye(r.uniformTypes??{},{layout:r.layout??vt(e)}),a=new lt(i);this.shaderBlockLayouts.set(t,i),this.shaderBlockWriters.set(t,a);let o=new ht({name:n});o.setUniforms(a.getFlatUniformValues(r.defaultUniforms||{})),this.uniformBlocks.set(t,o)}}destroy(){for(let e of this.uniformBuffers.values())e.destroy()}setUniforms(e){for(let[t,n]of Object.entries(e)){let e=t,r=this.shaderBlockWriters.get(e)?.getFlatUniformValues(n||{});this.uniformBlocks.get(e)?.setUniforms(r||{})}this.updateUniformBuffers()}getUniformBufferByteLength(e){let t=this.shaderBlockLayouts.get(e)?.byteLength||0;return Math.max(t,gt)}getUniformBufferData(e){let t=this.uniformBlocks.get(e)?.getAllUniforms()||{};return this.shaderBlockWriters.get(e)?.getData(t)||new Uint8Array}createUniformBuffer(e,t){t&&this.setUniforms(t);let n=this.getUniformBufferByteLength(e),r=this.device.createBuffer({usage:U.UNIFORM|U.COPY_DST,byteLength:n}),i=this.getUniformBufferData(e);return r.write(i),r}getManagedUniformBuffer(e){if(!this.uniformBuffers.get(e)){let t=this.getUniformBufferByteLength(e),n=this.device.createBuffer({usage:U.UNIFORM|U.COPY_DST,byteLength:t});this.uniformBuffers.set(e,n)}return this.uniformBuffers.get(e)}updateUniformBuffers(){let e=!1;for(let t of this.uniformBlocks.keys()){let n=this.updateUniformBuffer(t);e||=n}return e&&z.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){let t=this.uniformBlocks.get(e),n=this.uniformBuffers.get(e),r=!1;if(n&&t?.needsRedraw){r||=t.needsRedraw;let i=this.getUniformBufferData(e);n=this.uniformBuffers.get(e),n?.write(i);let a=this.uniformBlocks.get(e)?.getAllUniforms();z.log(4,`Writing to uniform buffer ${String(e)}`,i,a)()}return r}};function vt(e){return e.type===`webgpu`?`wgsl-uniform`:`std140`}async function yt(e,t,n,r){return r._parse(e,t,n,r)}function bt(e,t){if(!e)throw Error(t||`loader assertion failed.`)}var xt={self:typeof self<`u`&&self,window:typeof window<`u`&&window,global:typeof global<`u`&&global,document:typeof document<`u`&&document};xt.self||xt.window||xt.global,xt.window||xt.self||xt.global,xt.global||xt.self||xt.window,xt.document;var St=!!(typeof process!=`object`||String(process)!==`[object process]`||process.browser),Ct=typeof process<`u`&&process.version&&/v([0-9]*)/.exec(process.version);Ct&&parseFloat(Ct[1]);var wt=`v4.4.3`;function Tt(){let e=new ge({id:`loaders.gl`});return globalThis.loaders||={},globalThis.loaders.log=e,globalThis.loaders.version=wt,globalThis.probe||={},globalThis.probe.loaders=e,e}var Et=Tt(),Dt=e=>typeof e==`boolean`,Ot=e=>typeof e==`function`,kt=e=>typeof e==`object`&&!!e,At=e=>kt(e)&&e.constructor==={}.constructor,jt=e=>typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer,Mt=e=>kt(e)&&typeof e.byteLength==`number`&&typeof e.slice==`function`,Nt=e=>!!e&&Ot(e[Symbol.iterator]),Pt=e=>!!e&&Ot(e[Symbol.asyncIterator]),Ft=e=>typeof Response<`u`&&e instanceof Response||kt(e)&&Ot(e.arrayBuffer)&&Ot(e.text)&&Ot(e.json),It=e=>typeof Blob<`u`&&e instanceof Blob,Lt=e=>typeof ReadableStream<`u`&&e instanceof ReadableStream||kt(e)&&Ot(e.tee)&&Ot(e.cancel)&&Ot(e.getReader),Rt=e=>kt(e)&&Ot(e.read)&&Ot(e.pipe)&&Dt(e.readable),zt=e=>Lt(e)||Rt(e);function Bt(e,t){return Vt(e||{},t)}function Vt(e,t,n=0){if(n>3)return t;let r={...e};for(let[e,i]of Object.entries(t))i&&typeof i==`object`&&!Array.isArray(i)?r[e]=Vt(r[e]||{},t[e],n+1):r[e]=t[e];return r}function Ht(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Ut(e){return globalThis.loaders?.modules?.[e]||null}var Wt=`latest`;function Gt(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version=`4.4.3`),globalThis._loadersgl_.version}var Kt=Gt();function qt(e,t){if(!e)throw Error(t||`loaders.gl assertion failed.`)}var Jt={self:typeof self<`u`&&self,window:typeof window<`u`&&window,global:typeof global<`u`&&global,document:typeof document<`u`&&document};Jt.self||Jt.window||Jt.global,Jt.window||Jt.self||Jt.global,Jt.global||Jt.self||Jt.window,Jt.document;var Yt=typeof process!=`object`||String(process)!==`[object process]`||process.browser,Xt=typeof importScripts==`function`,Zt=typeof window<`u`&&window.orientation!==void 0,Qt=typeof process<`u`&&process.version&&/v([0-9]*)/.exec(process.version);Qt&&parseFloat(Qt[1]);var $t=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(e,t){this.name=e,this.workerThread=t,this.result=new Promise((e,t)=>{this._resolve=e,this._reject=t})}postMessage(e,t){this.workerThread.postMessage({source:`loaders.gl`,type:e,payload:t})}done(e){qt(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){qt(this.isRunning),this.isRunning=!1,this._reject(e)}},en=class{terminate(){}},tn=new Map;function nn(e){qt(e.source&&!e.url||!e.source&&e.url);let t=tn.get(e.source||e.url);return t||(e.url&&(t=rn(e.url),tn.set(e.url,t)),e.source&&(t=an(e.source),tn.set(e.source,t))),qt(t),t}function rn(e){return e.startsWith(`http`)?an(on(e)):e}function an(e){let t=new Blob([e],{type:`application/javascript`});return URL.createObjectURL(t)}function on(e){return`\ +try { + importScripts('${e}'); +} catch (error) { + console.error(error); + throw error; +}`}function sn(e,t=!0,n){let r=n||new Set;if(e){if(cn(e))r.add(e);else if(cn(e.buffer))r.add(e.buffer);else if(!ArrayBuffer.isView(e)&&t&&typeof e==`object`)for(let n in e)sn(e[n],t,r)}return n===void 0?Array.from(r):[]}function cn(e){return e?e instanceof ArrayBuffer||typeof MessagePort<`u`&&e instanceof MessagePort||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas:!1}var ln=()=>{},un=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL=``;static isSupported(){return typeof Worker<`u`&&Yt||en!==void 0&&!Yt}constructor(e){let{name:t,source:n,url:r}=e;qt(n||r),this.name=t,this.source=n,this.url=r,this.onMessage=ln,this.onError=e=>console.log(e),this.worker=Yt?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=ln,this.onError=ln,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,t){t||=sn(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t=`Failed to load `;return t+=`worker ${this.name} from ${this.url}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),Error(t)}_createBrowserWorker(){this._loadableURL=nn({source:this.source,url:this.url});let e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=e=>{e.data?this.onMessage(e.data):this.onError(Error(`No data received`))},e.onerror=e=>{this.onError(this._getErrorFromErrorEvent(e)),this.terminated=!0},e.onmessageerror=e=>console.error(e),e}_createNodeWorker(){let e;if(this.url)e=new en(this.url.includes(`:/`)||this.url.startsWith(`/`)?this.url:`./${this.url}`,{eval:!1,type:this.url.endsWith(`.ts`)||this.url.endsWith(`.mjs`)?`module`:`commonjs`});else if(this.source)e=new en(this.source,{eval:!0});else throw Error(`no worker`);return e.on(`message`,e=>{this.onMessage(e)}),e.on(`error`,e=>{this.onError(e)}),e.on(`exit`,e=>{}),e}},dn=class{name=`unnamed`;source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return un.isSupported()}constructor(e){this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,t=(e,t,n)=>e.done(n),n=(e,t)=>e.error(t)){let r=new Promise(r=>(this.jobQueue.push({name:e,onMessage:t,onError:n,onStart:r}),this));return this._startQueuedJob(),await r}async _startQueuedJob(){if(!this.jobQueue.length)return;let e=this._getAvailableWorker();if(!e)return;let t=this.jobQueue.shift();if(t){this.onDebug({message:`Starting job`,name:t.name,workerThread:e,backlog:this.jobQueue.length});let n=new $t(t.name,e);e.onMessage=e=>t.onMessage(n,e.type,e.payload),e.onError=e=>t.onError(n,e),t.onStart(n);try{await n.result}catch(e){console.error(`Worker exception: ${e}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!Yt||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){return this.idleQueue.length>0?this.idleQueue.shift()||null:this.count{}},pn=class e{props;workerPools=new Map;static _workerFarm;static isSupported(){return un.isSupported()}static getWorkerFarm(t={}){return e._workerFarm=e._workerFarm||new e({}),e._workerFarm.setProps(t),e._workerFarm}constructor(e){this.props={...fn},this.setProps(e),this.workerPools=new Map}destroy(){for(let e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(let e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(e){let{name:t,source:n,url:r}=e,i=this.workerPools.get(t);return i||(i=new dn({name:t,source:n,url:r}),i.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,i)),i}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}};function mn(e,t={}){let n=t[e.id]||{},r=Yt?`${e.id}-worker.js`:`${e.id}-worker-node.js`,i=n.workerUrl;if(!i&&e.id===`compression`&&(i=t.workerUrl),(t._workerType||t?.core?._workerType)===`test`&&(i=Yt?`modules/${e.module}/dist/${r}`:`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!i){let t=e.version;t===`latest`&&(t=Wt);let n=t?`@${t}`:``;i=`https://unpkg.com/@loaders.gl/${e.module}${n}/dist/${r}`}return qt(i),i}function hn(e,t=Kt){qt(e,`no worker provided`);let n=e.version;return!(!t||!n)}var gn={};function _n(e={}){let t=e.useLocalLibraries??e.core?.useLocalLibraries,n=e.CDN??e.core?.CDN,r=e.modules;return{...t===void 0?{}:{useLocalLibraries:t},...n===void 0?{}:{CDN:n},...r===void 0?{}:{modules:r}}}async function vn(e,t=null,n={},r=null){return t&&(e=yn(e,t,n,r)),gn[e]=gn[e]||bn(e),await gn[e]}function yn(e,t,n={},r=null){if(n?.core)throw Error(`loadLibrary: options.core must be pre-normalized`);if(!n.useLocalLibraries&&e.startsWith(`http`))return e;r||=e;let i=n.modules||{};return i[r]?i[r]:Yt?n.CDN?(qt(n.CDN.startsWith(`http`)),`${n.CDN}/${t}@${Kt}/dist/libs/${r}`):Xt?`../src/libs/${r}`:`modules/${t}/src/libs/${r}`:`modules/${t}/dist/libs/${r}`}async function bn(e){if(e.endsWith(`wasm`))return await Sn(e);if(!Yt){let{requireFromFile:t}=globalThis.loaders||{};try{let n=await t?.(e);return n||!e.includes(`/dist/libs/`)?n:await t?.(e.replace(`/dist/libs/`,`/src/libs/`))}catch(n){if(e.includes(`/dist/libs/`))try{return await t?.(e.replace(`/dist/libs/`,`/src/libs/`))}catch{}return console.error(n),null}}return Xt?importScripts(e):xn(await Cn(e),e)}function xn(e,t){if(!Yt){let{requireFromString:n}=globalThis.loaders||{};return n?.(e,t)}if(Xt)return eval.call(globalThis,e),null;let n=document.createElement(`script`);n.id=t;try{n.appendChild(document.createTextNode(e))}catch{n.text=e}return document.body.appendChild(n),null}async function Sn(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};if(Yt||!t||e.startsWith(`http`))return await(await fetch(e)).arrayBuffer();try{return await t(e)}catch{if(e.includes(`/dist/libs/`))return await t(e.replace(`/dist/libs/`,`/src/libs/`));throw Error(`Failed to load ArrayBuffer from ${e}`)}}async function Cn(e){let{readFileAsText:t}=globalThis.loaders||{};if(Yt||!t||e.startsWith(`http`))return await(await fetch(e)).text();try{return await t(e)}catch{if(e.includes(`/dist/libs/`))return await t(e.replace(`/dist/libs/`,`/src/libs/`));throw Error(`Failed to load text from ${e}`)}}function wn(e,t){if(!pn.isSupported())return!1;let n=t?._nodeWorkers??t?.core?._nodeWorkers;if(!Yt&&!n)return!1;let r=t?.worker??t?.core?.worker;return!!(e.worker&&r)}async function Tn(e,t,n,r,i){let a=e.id,o=mn(e,n),s=pn.getWorkerFarm(n?.core).getWorkerPool({name:a,url:o});n=JSON.parse(JSON.stringify(n)),r=JSON.parse(JSON.stringify(r||{}));let c=await s.startJob(`process-on-worker`,En.bind(null,i));return c.postMessage(`process`,{input:t,options:n,context:r}),await(await c.result).result}async function En(e,t,n,r){switch(n){case`done`:t.done(r);break;case`error`:t.error(Error(r.error));break;case`process`:let{id:i,input:a,options:o}=r;try{let n=await e(a,o);t.postMessage(`done`,{id:i,result:n})}catch(e){let n=e instanceof Error?e.message:`unknown error`;t.postMessage(`error`,{id:i,error:n})}break;default:console.warn(`parse-with-worker unknown message ${n}`)}}function Dn(e,t=5){return typeof e==`string`?e.slice(0,t):ArrayBuffer.isView(e)?On(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?On(e,0,t):``}function On(e,t,n){if(e.byteLength<=t+n)return``;let r=new DataView(e),i=``;for(let e=0;ee instanceof ArrayBuffer?new Uint8Array(e):e),n=t.reduce((e,t)=>e+t.byteLength,0),r=new Uint8Array(n),i=0;for(let e of t)r.set(e,i),i+=e.byteLength;return r.buffer}function Nn(e,t,n){let r=n===void 0?new Uint8Array(e).subarray(t):new Uint8Array(e).subarray(t,t+n);return new Uint8Array(r).buffer}function Pn(e,t){return bt(e>=0),bt(t>0),e+(t-1)&~(t-1)}function Fn(e,t,n){let r;if(e instanceof ArrayBuffer)r=new Uint8Array(e);else{let t=e.byteOffset,n=e.byteLength;r=new Uint8Array(e.buffer||e.arrayBuffer,t,n)}return t.set(r,n),n+Pn(r.byteLength,4)}async function In(e){let t=[];for await(let n of e)t.push(Rn(n));return jn(...t)}async function*Ln(e){for await(let t of e)yield Rn(t)}function Rn(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:n,byteLength:r}=e;return zn(t,n,r)}return zn(e)}function zn(e,t=0,n=e.byteLength-t){let r=new Uint8Array(e,t,n),i=new Uint8Array(r.length);return i.set(r),i.buffer}var Bn=`Queued Requests`,Vn=`Active Requests`,Hn=`Cancelled Requests`,Un=`Queued Requests Ever`,Wn=`Active Requests Ever`,Gn={id:`request-scheduler`,throttleRequests:!0,maxRequests:6,debounceTime:0},Kn=class{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(e={}){this.props={...Gn,...e},this.stats=new Te({id:this.props.id}),this.stats.get(Bn),this.stats.get(Vn),this.stats.get(Hn),this.stats.get(Un),this.stats.get(Wn)}setProps(e){e.throttleRequests!==void 0&&(this.props.throttleRequests=e.throttleRequests),e.maxRequests!==void 0&&(this.props.maxRequests=e.maxRequests),e.debounceTime!==void 0&&(this.props.debounceTime=e.debounceTime)}scheduleRequest(e,t=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(e))return this.requestMap.get(e);let n={handle:e,priority:0,getPriority:t},r=new Promise(e=>(n.resolve=e,n));return this.requestQueue.push(n),this.requestMap.set(e,r),this._issueNewRequests(),r}_issueRequest(e){let{handle:t,resolve:n}=e,r=!1,i=()=>{r||(r=!0,this.requestMap.delete(t),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:i}):Promise.resolve({done:i})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(e!==0){this._updateAllRequests();for(let t=0;te.priority-t.priority)}_updateRequest(e){return e.priority=e.getPriority(e.handle),e.priority<0?(e.resolve(null),!1):!0}},qn=``,Jn={};function Yn(e){for(let t in Jn)if(e.startsWith(t)){let n=Jn[t];e=e.replace(t,n)}return!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&(e=`${qn}${e}`),e}function Xn(e){return e}function Zn(e){return e&&typeof e==`object`&&e.isBuffer}function Qn(e){if(Zn(e))return Xn(e);if(e instanceof ArrayBuffer)return e;if(jt(e))return er(e);if(ArrayBuffer.isView(e)){let t=e.buffer;return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?t:t.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(typeof e==`string`){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e==`object`&&e._toArrayBuffer)return e._toArrayBuffer();throw Error(`toArrayBuffer`)}function $n(e){if(e instanceof ArrayBuffer)return e;if(jt(e))return er(e);let{buffer:t,byteOffset:n,byteLength:r}=e;return t instanceof ArrayBuffer&&n===0&&r===t.byteLength?t:er(t,n,r)}function er(e,t=0,n=e.byteLength-t){let r=new Uint8Array(e,t,n),i=new Uint8Array(r.length);return i.set(r),i.buffer}function tr(e){return ArrayBuffer.isView(e)?e:new Uint8Array(e)}function nr(e){return t=>new Promise((n,r)=>e(t,(e,t)=>e?r(e):n(t)))}function rr(){if(typeof process<`u`&&process.cwd!==void 0)return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf(`/`)+1)||``}function ir(e){let t=e?e.lastIndexOf(`/`):-1;return t>=0?e.substr(t+1):e}function ar(e){let t=e?e.lastIndexOf(`/`):-1;return t>=0?e.substr(0,t):``}function or(...e){let t=[];for(let n=0;n=-1&&!r;e--){let a;e>=0?a=t[e]:(i===void 0&&(i=rr()),a=i),a.length!==0&&(n=`${a}/${n}`,r=a.charCodeAt(0)===sr)}return n=lr(n,!r),r?`/${n}`:n.length>0?n:`.`}var sr=47,cr=46;function lr(e,t){let n=``,r=-1,i=0,a,o=!1;for(let s=0;s<=e.length;++s){if(s2){let e=n.length-1,t=e;for(;t>=0&&n.charCodeAt(t)!==sr;--t);if(t!==e){n=t===-1?``:n.slice(0,t),r=s,i=0,o=!1;continue}}else if(n.length===2||n.length===1){n=``,r=s,i=0,o=!1;continue}}t&&(n.length>0?n+=`/..`:n=`..`,o=!0)}else{let t=e.slice(r+1,s);n.length>0?n+=`/${t}`:n=t,o=!1}r=s,i=0}else a===cr&&i!==-1?++i:i=-1}return n}var ur=class e{static defaultOptions={core:{type:`auto`,attributions:[],loadOptions:{},loaders:[]}};optionsType;options;data;url;loadOptions;fetch;_needsRefresh=!0;constructor(t,n,r){r?this.options=Bt({...r,core:e.defaultOptions},n):this.options={...n},this.data=t,this.url=typeof t==`string`?Yn(t):``,this.loadOptions=fr(this.options.core?.loadOptions),this.fetch=dr(this.loadOptions)}setProps(e){this.options=Object.assign(this.options,e),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(e=!0){let t=this._needsRefresh;return e&&(this._needsRefresh=!1),t}};function dr(e){let t=e?.core?.fetch;if(t&&typeof t==`function`)return(e,n)=>t(e,n);let n=e?.fetch;return n&&typeof n!=`function`?e=>fetch(e,n):e=>fetch(e)}function fr(e){let t={...e};e?.core&&(t.core={...e.core});let n=typeof t.baseUri==`string`?t.baseUri:void 0,r=typeof t.baseUrl==`string`?t.baseUrl:void 0;return(n!==void 0||r!==void 0)&&(t.core||={},t.core.baseUrl===void 0&&(t.core.baseUrl=r??n),delete t.baseUri,delete t.baseUrl),t}var pr=class{static type=`template`;static testURL=e=>!1},mr=class extends Error{constructor(e,t){super(e),this.reason=t.reason,this.url=t.url,this.response=t.response}reason;url;response},hr=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,gr=/^([-\w.]+\/[-\w.+]+)/;function _r(e,t){return e.toLowerCase()===t.toLowerCase()}function vr(e){let t=gr.exec(e);return t?t[1]:e}function yr(e){let t=hr.exec(e);return t?t[1]:``}var br=/\?.*/;function xr(e){let t=e.match(br);return t&&t[0]}function Sr(e){return e.replace(br,``)}function Cr(e){if(e.length<50)return e;let t=e.slice(e.length-15);return`${e.substr(0,32)}...${t}`}function wr(e){return Ft(e)?e.url:It(e)?(`name`in e?e.name:``)||``:typeof e==`string`?e:``}function Tr(e){if(Ft(e)){let t=e.headers.get(`content-type`)||``,n=Sr(e.url);return vr(t)||yr(n)}return It(e)?e.type||``:typeof e==`string`?yr(e):``}function Er(e){return Ft(e)?e.headers[`content-length`]||-1:It(e)?e.size:typeof e==`string`?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Dr(e){if(Ft(e))return e;let t={},n=Er(e);n>=0&&(t[`content-length`]=String(n));let r=wr(e),i=Tr(e);i&&(t[`content-type`]=i);let a=await kr(e);a&&(t[`x-first-bytes`]=a),typeof e==`string`&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:r}),o}async function Or(e){if(!e.ok)throw await K(e)}async function K(e){let t=Cr(e.url),n=`Failed to fetch resource (${e.status}) ${e.statusText}: ${t}`;n=n.length>100?`${n.slice(0,100)}...`:n;let r={reason:e.statusText,url:e.url,response:e};try{let t=e.headers.get(`Content-Type`);r.reason=!e.bodyUsed&&t?.includes(`application/json`)?await e.json():await e.text()}catch{}return new mr(n,r)}async function kr(e){if(typeof e==`string`)return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let t=e.slice(0,5);return await new Promise(e=>{let n=new FileReader;n.onload=t=>e(t?.target?.result),n.readAsDataURL(t)})}return e instanceof ArrayBuffer?`data:base64,${Ar(e.slice(0,5))}`:null}function Ar(e){let t=``,n=new Uint8Array(e);for(let e=0;e{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Lr={core:{baseUrl:void 0,fetch:null,mimeType:void 0,fallbackMimeType:void 0,ignoreRegisteredLoaders:void 0,nothrow:!1,log:new class{console;constructor(){this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},useLocalLibraries:!1,CDN:`https://unpkg.com/@loaders.gl`,worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:St,_nodeWorkers:!1,_workerType:``,limit:0,_limitMB:0,batchSize:`auto`,batchDebounceMs:0,metadata:!1,transforms:[]}},q={baseUri:`core.baseUrl`,fetch:`core.fetch`,mimeType:`core.mimeType`,fallbackMimeType:`core.fallbackMimeType`,ignoreRegisteredLoaders:`core.ignoreRegisteredLoaders`,nothrow:`core.nothrow`,log:`core.log`,useLocalLibraries:`core.useLocalLibraries`,CDN:`core.CDN`,worker:`core.worker`,maxConcurrency:`core.maxConcurrency`,maxMobileConcurrency:`core.maxMobileConcurrency`,reuseWorkers:`core.reuseWorkers`,_nodeWorkers:`core.nodeWorkers`,_workerType:`core._workerType`,_worker:`core._workerType`,limit:`core.limit`,_limitMB:`core._limitMB`,batchSize:`core.batchSize`,batchDebounceMs:`core.batchDebounceMs`,metadata:`core.metadata`,transforms:`core.transforms`,throws:`nothrow`,dataType:`(no longer used)`,uri:`core.baseUrl`,method:`core.fetch.method`,headers:`core.fetch.headers`,body:`core.fetch.body`,mode:`core.fetch.mode`,credentials:`core.fetch.credentials`,cache:`core.fetch.cache`,redirect:`core.fetch.redirect`,referrer:`core.fetch.referrer`,referrerPolicy:`core.fetch.referrerPolicy`,integrity:`core.fetch.integrity`,keepalive:`core.fetch.keepalive`,signal:`core.fetch.signal`},J=[`baseUrl`,`fetch`,`mimeType`,`fallbackMimeType`,`ignoreRegisteredLoaders`,`nothrow`,`log`,`useLocalLibraries`,`CDN`,`worker`,`maxConcurrency`,`maxMobileConcurrency`,`reuseWorkers`,`_nodeWorkers`,`_workerType`,`limit`,`_limitMB`,`batchSize`,`batchDebounceMs`,`metadata`,`transforms`];function Rr(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||={},e._state}function zr(){let e=Rr();return e.globalOptions=e.globalOptions||{...Lr,core:{...Lr.core}},Vr(e.globalOptions)}function Br(e,t,n,r){return n||=[],n=Array.isArray(n)?n:[n],Hr(e,n),Vr(Gr(t,e,r))}function Vr(e){let t=Jr(e);Yr(t);for(let e of J)t.core&&t.core[e]!==void 0&&delete t[e];return t.core&&t.core._workerType!==void 0&&delete t._worker,t}function Hr(e,t){Ur(e,null,Lr,q,t);for(let n of t){let r=e&&e[n.id]||{},i=n.options&&n.options[n.id]||{},a=n.deprecatedOptions&&n.deprecatedOptions[n.id]||{};Ur(r,n.id,i,a,t)}}function Ur(e,t,n,r,i){let a=t||`Top level`,o=t?`${t}.`:``;for(let s in e){let c=!t&&kt(e[s]),l=s===`baseUri`&&!t,u=s===`workerUrl`&&t;if(!(s in n)&&!l&&!u){if(s in r)Fr.level>0&&Fr.warn(`${a} loader option \'${o}${s}\' no longer supported, use \'${r[s]}\'`)();else if(!c&&Fr.level>0){let e=Wr(s,i);Fr.warn(`${a} loader option \'${o}${s}\' not recognized. ${e}`)()}}}}function Wr(e,t){let n=e.toLowerCase(),r=``;for(let i of t)for(let t in i.options){if(e===t)return`Did you mean \'${i.id}.${t}\'?`;let a=t.toLowerCase();(n.startsWith(a)||a.startsWith(n))&&(r||=`Did you mean \'${i.id}.${t}\'?`)}return r}function Gr(e,t,n){let r=e.options||{},i={...r};return r.core&&(i.core={...r.core}),Yr(i),i.core?.log===null&&(i.core={...i.core,log:new Ir}),Kr(i,Vr(zr())),Kr(i,Vr(t)),qr(i,n),Xr(i),i}function Kr(e,t){for(let n in t)if(n in t){let r=t[n];At(r)&&At(e[n])?e[n]={...e[n],...t[n]}:e[n]=t[n]}}function qr(e,t){t&&e.core?.baseUrl===void 0&&(e.core||={},e.core.baseUrl=ar(Sr(t)))}function Jr(e){let t={...e};return e.core&&(t.core={...e.core}),t}function Yr(e){e.baseUri!==void 0&&(e.core||={},e.core.baseUrl===void 0&&(e.core.baseUrl=e.baseUri));for(let t of J)if(e[t]!==void 0){let n=e.core=e.core||{};n[t]===void 0&&(n[t]=e[t])}let t=e._worker;t!==void 0&&(e.core||={},e.core._workerType===void 0&&(e.core._workerType=t))}function Xr(e){let t=e.core;if(t)for(let n of J)t[n]!==void 0&&(e[n]=t[n])}function Zr(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e?.extensions)):!1}function Qr(e){bt(e,`null loader`),bt(Zr(e),`invalid loader`);let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e?.parseTextSync||e?.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var $r=()=>{let e=Rr();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function ei(e){let t=$r();e=Array.isArray(e)?e:[e];for(let n of e){let e=Qr(n);t.find(t=>e===t)||t.unshift(e)}}function ti(){return $r()}var ni=/\.([^.]+)$/;async function ri(e,t=[],n,r){if(!si(e))return null;let i=Vr(n||{});if(i.core||={},e instanceof Response&&ii(e)){let n=ai(await e.clone().text(),t,{...i,core:{...i.core,nothrow:!0}},r);if(n)return n}let a=ai(e,t,{...i,core:{...i.core,nothrow:!0}},r);if(a)return a;if(It(e)&&(e=await e.slice(0,10).arrayBuffer(),a=ai(e,t,i,r)),!a&&e instanceof Response&&ii(e)&&(a=ai(await e.clone().text(),t,i,r)),!a&&!i.core.nothrow)throw Error(ci(e));return a}function ii(e){let t=Tr(e);return!!(t&&(t.startsWith(`text/`)||t===`application/json`||t.endsWith(`+json`)))}function ai(e,t=[],n,r){if(!si(e))return null;let i=Vr(n||{});if(i.core||={},t&&!Array.isArray(t))return Qr(t);let a=[];t&&(a=a.concat(t)),i.core.ignoreRegisteredLoaders||a.push(...ti()),li(a);let o=oi(e,a,i,r);if(!o&&!i.core.nothrow)throw Error(ci(e));return o}function oi(e,t,n,r){let i=wr(e),a=Tr(e),o=Sr(i)||r?.url,s=null,c=``;return n?.core?.mimeType&&(s=fi(t,n?.core?.mimeType),c=`match forced by supplied MIME type ${n?.core?.mimeType}`),s||=ui(t,o),c||=s?`matched url ${o}`:``,s||=fi(t,a),c||=s?`matched MIME type ${a}`:``,s||=pi(t,e),c||=s?`matched initial data ${_i(e)}`:``,n?.core?.fallbackMimeType&&(s||=fi(t,n?.core?.fallbackMimeType),c||=s?`matched fallback MIME type ${a}`:``),c&&Et.log(1,`selectLoader selected ${s?.name}: ${c}.`),s}function si(e){return!(e instanceof Response&&e.status===204)}function ci(e){let t=wr(e),n=Tr(e),r=`No valid loader found (`;r+=t?`${ir(t)}, `:`no url provided, `,r+=`MIME type: ${n?`"${n}"`:`not provided`}, `;let i=e?_i(e):``;return r+=i?` first bytes: "${i}"`:`first bytes: not available`,r+=`)`,r}function li(e){for(let t of e)Qr(t)}function ui(e,t){let n=t&&ni.exec(t),r=n&&n[1];return r?di(e,r):null}function di(e,t){t=t.toLowerCase();for(let n of e)for(let e of n.extensions)if(e.toLowerCase()===t)return n;return null}function fi(e,t){for(let n of e)if(n.mimeTypes?.some(e=>_r(t,e))||_r(t,`application/x.${n.id}`))return n;return null}function pi(e,t){if(!t)return null;for(let n of e)if(typeof t==`string`){if(mi(t,n))return n}else if(ArrayBuffer.isView(t)){if(hi(t.buffer,t.byteOffset,n))return n}else if(t instanceof ArrayBuffer&&hi(t,0,n))return n;return null}function mi(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(t=>e.startsWith(t))}function hi(e,t,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(r=>gi(e,t,n,r))}function gi(e,t,n,r){if(Mt(r))return An(r,e,r.byteLength);switch(typeof r){case`function`:return r($n(e));case`string`:return r===vi(e,t,r.length);default:return!1}}function _i(e,t=5){return typeof e==`string`?e.slice(0,t):ArrayBuffer.isView(e)?vi(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?vi(e,0,t):``}function vi(e,t,n){if(e.byteLengthPr(e,i):t?.fetch?t?.fetch:Pr}function Ni(e,t,n){if(n)return n;let r={fetch:Mi(t,e),...e};if(r.url){let e=Sr(r.url);r.baseUrl=e,r.queryString=xr(r.url),r.filename=ir(e),r.baseUrl=ar(e)}return Array.isArray(r.loaders)||(r.loaders=null),r}function Pi(e,t){if(e&&!Array.isArray(e))return e;let n;if(e&&(n=Array.isArray(e)?e:[e]),t&&t.loaders){let e=Array.isArray(t.loaders)?t.loaders:[t.loaders];n=n?[...n,...e]:e}return n&&n.length?n:void 0}async function Fi(e,t,n,r){t&&!Array.isArray(t)&&!Zr(t)&&(r=void 0,n=t,t=void 0),e=await e,n||={};let i=wr(e),a=Pi(t,r),o=await ri(e,a,n);if(!o)return null;let s=Br(n,o,a,i);return r=Ni({url:i,_parse:Fi,loaders:a},s,r||null),await Ii(o,e,s,r)}async function Ii(e,t,n,r){if(hn(e),n=Bt(e.options,n),Ft(t)){let{ok:e,redirected:n,status:i,statusText:a,type:o,url:s}=t;r.response={headers:Object.fromEntries(t.headers.entries()),ok:e,redirected:n,status:i,statusText:a,type:o,url:s}}t=await ji(t,e,n);let i=e;if(i.parseTextSync&&typeof t==`string`)return i.parseTextSync(t,n,r);if(wn(e,n))return await Tn(e,t,n,r,Fi);if(i.parseText&&typeof t==`string`)return await i.parseText(t,n,r);if(i.parse)return await i.parse(t,n,r);throw qt(!i.parseSync),Error(`${e.id} loader - no parser found and worker is disabled`)}function Li(e,t=`float32`){return e instanceof Date?`date-millisecond`:e instanceof Number?t:typeof e==`string`?`utf8`:`null`}function Ri(e){let t=zi(e);return t===`null`?e.length>0?(t=Li(e[0]),{type:t,nullable:!0}):{type:`null`,nullable:!0}:{type:t,nullable:!1}}function zi(e){switch(e.constructor){case Int8Array:return`int8`;case Uint8Array:case Uint8ClampedArray:return`uint8`;case Int16Array:return`int16`;case Uint16Array:return`uint16`;case Int32Array:return`int32`;case Uint32Array:return`uint32`;case Float32Array:return`float32`;case Float64Array:return`float64`;default:return`null`}}function Bi(e,t){if(!t)switch(e){case`int8`:return Int8Array;case`uint8`:return Uint8Array;case`int16`:return Int16Array;case`uint16`:return Uint16Array;case`int32`:return Int32Array;case`uint32`:return Uint32Array;case`float32`:return Float32Array;case`float64`:return Float64Array;default:break}return Array}function Vi(e){switch(e.shape){case`array-row-table`:case`object-row-table`:return Ui(e.data);case`geojson-table`:return Wi(e.features);case`columnar-table`:return Hi(e.data);default:throw Error(`Deduce schema`)}}function Hi(e){let t=[];for(let[n,r]of Object.entries(e)){let e=Gi(r,n);t.push(e)}return{fields:t,metadata:{}}}function Ui(e){if(!e.length)throw Error(`deduce from empty table`);let t=[],n=e[0];for(let[e,r]of Object.entries(n))t.push(Ki(r,e));return{fields:t,metadata:{}}}function Wi(e){if(!e.length)throw Error(`deduce from empty table`);let t=[],n=e[0].properties||{};for(let[e,r]of Object.entries(n))t.push(Ki(r,e));return{fields:t,metadata:{}}}function Gi(e,t){if(ArrayBuffer.isView(e)){let n=Ri(e);return{name:t,type:n.type||`null`,nullable:n.nullable}}if(Array.isArray(e)&&e.length>0){let n=e[0];return{name:t,type:Li(n),nullable:!0}}throw Error(`empty table`)}function Ki(e,t){return{name:t,type:Li(e),nullable:!0}}function qi(e,t){if(!e)throw Error(`null row`);let n={};if(t)for(let r=0;r0?this.allocated*=2:ia,this.columns={};for(let e of this.schema.fields){let t=Bi(e.type,e.nullable),n=this.columns[e.name];if(!n)this.columns[e.name]=new t(this.allocated);else if(Array.isArray(n))n.length=this.allocated;else if(ta(n)){let r=new t(this.allocated);r.set(n),this.columns[e.name]=r}else throw Error(`Invalid column type`)}}}_pruneColumns(){for(let[e,t]of Object.entries(this.columns))this.columns[e]=t.slice(0,this.length)}},oa=class extends aa{arrowSchema;constructor(e,t){super(e,t),this.arrowSchema=null}getBatch(){let e=super.getBatch();if(e){this.arrowSchema=this.arrowSchema||sa(e.schema);let t=ca(this.arrowSchema,e.data);return{shape:`arrow-table`,batchType:`data`,data:new P([new F(this.arrowSchema,N({type:new j(this.arrowSchema.fields),children:t.map(({data:e})=>e[0])}))]),length:e.length}}return null}};function sa(e){let t=[];for(let n in e){let r=e[n];if(r.type===Float32Array){let e=new Map,n=new ee(r.name,new A,r.nullable,e);t.push(n)}}if(t.length===0)throw Error(`No arrow convertible fields`);return new M(t)}function ca(e,t){let n=[];for(let r of e.fields){let e=t[r.name];if(e instanceof Float32Array){let t=I(e);n.push(t)}}if(e.fields.length!==n.length)throw Error(`Some columns not arrow convertible`);return n}var la={shape:void 0,batchSize:`auto`,batchDebounceMs:0,limit:0,_limitMB:0},ua=class{schema;options;aggregator=null;batchCount=0;bytesUsed=0;isChunkComplete=!1;lastBatchEmittedMs=Date.now();totalLength=0;totalBytes=0;rowBytes=0;static ArrowBatch;constructor(e,t){this.schema=e,this.options={...la,...t}}limitReached(){return!!(this.options?.limit&&this.totalLength>=this.options.limit||this.options?._limitMB&&this.totalBytes/1e6>=this.options._limitMB)}addRow(e){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(e),this.totalBytes+=this.rowBytes,Array.isArray(e)?this.addArrayRow(e):this.addObjectRow(e))}addArrayRow(e){if(!this.aggregator){let e=this._getTableBatchType();this.aggregator=new e(this.schema,this.options)}this.aggregator.addArrayRow(e)}addObjectRow(e){if(!this.aggregator){let e=this._getTableBatchType();this.aggregator=new e(this.schema,this.options)}this.aggregator.addObjectRow(e)}chunkComplete(e){e instanceof ArrayBuffer&&(this.bytesUsed+=e.byteLength),typeof e==`string`&&(this.bytesUsed+=e.length),this.isChunkComplete=!0}getFullBatch(e){return this._isFull()?this._getBatch(e):null}getFinalBatch(e){return this._getBatch(e)}_estimateRowMB(e){return Array.isArray(e)?e.length*8:Object.keys(e).length*8}_isFull(){if(!this.aggregator||this.aggregator.rowCount()===0)return!1;if(this.options.batchSize===`auto`){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs?!1:(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(e){if(!this.aggregator)return null;e?.bytesUsed&&(this.bytesUsed=e.bytesUsed);let t=this.aggregator.getBatch();return t.count=this.batchCount,t.bytesUsed=this.bytesUsed,Object.assign(t,e),this.batchCount++,this.aggregator=null,t}_getTableBatchType(){switch(this.options.shape){case`array-row-table`:case`object-row-table`:return ea;case`columnar-table`:return aa;case`arrow-table`:return oa;default:return Qi}}};function da(e){let t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],c=s&&s.length;for(let e=0;ei?c:i,a=l>a?l:a,o=u>o?u:o}return[[t,n,r],[i,a,o]]}function fa(e,t,n){let r=zi(t.value),i=n||pa(t);return{name:e,type:{type:`fixed-size-list`,listSize:t.size,children:[{name:`value`,type:r}]},nullable:!1,metadata:i}}function pa(e){let t={};return`byteOffset`in e&&(t.byteOffset=e.byteOffset.toString(10)),`byteStride`in e&&(t.byteStride=e.byteStride.toString(10)),`normalized`in e&&(t.normalized=e.normalized.toString()),t}var ma=class extends Array{enqueue(e){return this.push(e)}dequeue(){return this.shift()}},ha=class{_values;_settlers;_closed;constructor(){this._values=new ma,this._settlers=new ma,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[Symbol.asyncIterator](){return this}enqueue(e){if(this._closed)throw Error(`Closed`);if(this._settlers.length>0){if(this._values.length>0)throw Error(`Illegal internal state`);let t=this._settlers.dequeue();e instanceof Error?t.reject(e):t.resolve({value:e})}else this._values.enqueue(e)}next(){if(this._values.length>0){let e=this._values.dequeue();return e instanceof Error?Promise.reject(e):Promise.resolve({value:e})}if(this._closed){if(this._settlers.length>0)throw Error(`Illegal internal state`);return Promise.resolve({done:!0})}return new Promise((e,t)=>{this._settlers.enqueue({resolve:e,reject:t})})}};async function ga(e,t,n,r){let i,a;!Array.isArray(t)&&!Zr(t)?(i=[],a=t,r=void 0):(i=t,a=n);let o=Mi(a),s=e;return typeof e==`string`&&(s=await o(e)),It(e)&&(s=await o(e)),typeof e==`string`&&(Vr(a||{}).core?.baseUrl||(a={...a,core:{...a?.core,baseUrl:e}})),await Fi(s,i,a)}function _a(e,t,n){let r=n?.core?.type||n.type||`auto`,i=r===`auto`?va(e,t):ya(r,t);if(!i)throw Error(`Not a valid source type`);return i.createDataSource(e,n)}function va(e,t){for(let n of t)if(n.testURL&&n.testURL(e))return n;return null}function ya(e,t){for(let n of t)if(n.type===e)return n;return null}var ba=`4.4.3`,xa=globalThis.loaders?.parseImageNode,Sa=typeof Image<`u`,Ca=typeof ImageBitmap<`u`,wa=St?!0:!!xa;function Ta(e){switch(e){case`auto`:return Ca||Sa||wa;case`imagebitmap`:return Ca;case`image`:return Sa;case`data`:return wa;default:throw Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function Ea(){if(Ca)return`imagebitmap`;if(Sa)return`image`;if(wa)return`data`;throw Error(`Install '@loaders.gl/polyfills' to parse images under Node.js`)}function Da(e){let t=ka(e);if(!t)throw Error(`Not an image`);return t}function Oa(e){switch(Da(e)){case`data`:return e;case`image`:case`imagebitmap`:let t=document.createElement(`canvas`),n=t.getContext(`2d`);if(!n)throw Error(`getImageData`);return t.width=e.width,t.height=e.height,n.drawImage(e,0,0),n.getImageData(0,0,e.width,e.height);default:throw Error(`getImageData`)}}function ka(e){return typeof ImageBitmap<`u`&&e instanceof ImageBitmap?`imagebitmap`:typeof Image<`u`&&e instanceof Image?`image`:e&&typeof e==`object`&&e.data&&e.width&&e.height?`data`:null}var Aa=/^data:image\/svg\+xml/,ja=/\.svg((\?|#).*)?$/;function Ma(e){return e&&(Aa.test(e)||ja.test(e))}function Na(e,t){if(Ma(t)){let t=new TextDecoder().decode(e);try{typeof unescape==`function`&&typeof encodeURIComponent==`function`&&(t=unescape(encodeURIComponent(t)))}catch(e){throw Error(e.message)}return`data:image/svg+xml;base64,${btoa(t)}`}return Pa(e,t)}function Pa(e,t){if(Ma(t))throw Error(`SVG cannot be parsed directly to imagebitmap`);return new Blob([new Uint8Array(e)])}async function Fa(e,t,n){let r=Na(e,n),i=self.URL||self.webkitURL,a=typeof r!=`string`&&i.createObjectURL(r);try{return await Ia(a||r,t)}finally{a&&i.revokeObjectURL(a)}}async function Ia(e,t){let n=new Image;return n.src=e,t.image&&t.image.decode&&n.decode?(await n.decode(),n):await new Promise((e,t)=>{try{n.onload=()=>e(n),n.onerror=e=>{let n=e instanceof Error?e.message:`error`;t(Error(n))}}catch(e){t(e)}})}var La=!0;async function Ra(e,t,n){let r;r=Ma(n)?await Fa(e,t,n):Pa(e,n);let i=t&&t.imagebitmap;return await za(r,i)}async function za(e,t=null){if((Ba(t)||!La)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(e){console.warn(e),La=!1}return await createImageBitmap(e)}function Ba(e){if(!e)return!0;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Va(e){return!Ga(e,`ftyp`,4)||!(e[8]&96)?null:Ha(e)}function Ha(e){switch(Ua(e,8,12).replace(`\0`,` `).trim()){case`avif`:case`avis`:return{extension:`avif`,mimeType:`image/avif`};default:return null}}function Ua(e,t,n){return String.fromCharCode(...e.slice(t,n))}function Wa(e){return[...e].map(e=>e.charCodeAt(0))}function Ga(e,t,n=0){let r=Wa(t);for(let t=0;t=24&&t.getUint32(0,Ka)===2303741511?{mimeType:`image/png`,width:t.getUint32(16,Ka),height:t.getUint32(20,Ka)}:null}function Za(e){let t=to(e);return t.byteLength>=10&&t.getUint32(0,Ka)===1195984440?{mimeType:`image/gif`,width:t.getUint16(6,qa),height:t.getUint16(8,qa)}:null}function Qa(e){let t=to(e);return t.byteLength>=14&&t.getUint16(0,Ka)===16973&&t.getUint32(2,qa)===t.byteLength?{mimeType:`image/bmp`,width:t.getUint32(18,qa),height:t.getUint32(22,qa)}:null}function $a(e){let t=to(e);if(!(t.byteLength>=3&&t.getUint16(0,Ka)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:r}=eo(),i=2;for(;i+9!!Ja(new DataView(e))],options:{image:{type:`auto`,decode:!0}}},oo={};function so(e){return oo[e]===void 0&&(oo[e]=St?lo(e):co(e)),oo[e]}function co(e){let t=globalThis.loaders?.imageFormatsNode||[`image/png`,`image/jpeg`,`image/gif`];return!!globalThis.loaders?.parseImageNode&&t.includes(e)}function lo(e){switch(e){case`image/avif`:case`image/webp`:return uo(e);default:return!0}}function uo(e){try{return document.createElement(`canvas`).toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}var fo=new ge({id:`deck`}),po={};function mo(e){po=e}function ho(e,t,n,r){fo.level>0&&po[e]&&po[e].call(null,t,n,r)}function go(e){let t=e[0],n=e[e.length-1];return t===`{`&&n===`}`||t===`[`&&n===`]`}var _o={dataType:null,batchType:null,id:`JSON`,name:`JSON`,module:``,version:``,options:{},extensions:[`json`,`geojson`],mimeTypes:[`application/json`,`application/geo+json`],testText:go,parseTextSync:JSON.parse};function vo(){let e=`9.3.6`,t=globalThis.deck&&globalThis.deck.VERSION;if(t&&t!==e)throw Error(`deck.gl - multiple versions detected: ${t} vs ${e}`);return t||(fo.log(1,`deck.gl ${e}`)(),globalThis.deck={...globalThis.deck,VERSION:e,version:e,log:fo,_registerLoggers:mo},ei([_o,[ao,{imagebitmap:{premultiplyAlpha:`none`}}]])),e}var yo=vo();function bo(e,t){if(!e){let e=Error(t||`shadertools: assertion failed.`);throw Error.captureStackTrace?.(e,bo),e}}var xo={number:{type:`number`,validate(e,t){return Number.isFinite(e)&&typeof t==`object`&&(t.max===void 0||e<=t.max)&&(t.min===void 0||e>=t.min)}},array:{type:`array`,validate(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function So(e){let t={};for(let[n,r]of Object.entries(e))t[n]=Co(r);return t}function Co(e){let t=wo(e);if(t!==`object`)return{value:e,...xo[t],type:t};if(typeof e==`object`)return e?e.type===void 0?e.value===void 0?{type:`object`,value:e}:(t=wo(e.value),{...e,...xo[t],type:t}):{...e,...xo[e.type],type:e.type}:{type:`object`,value:null};throw Error(`props`)}function wo(e){return Array.isArray(e)||ArrayBuffer.isView(e)?`array`:typeof e}var To={vertex:`#ifdef MODULE_LOGDEPTH + logdepth_adjustPosition(gl_Position); +#endif +`,fragment:`#ifdef MODULE_MATERIAL + fragColor = material_filterColor(fragColor); +#endif + +#ifdef MODULE_LIGHTING + fragColor = lighting_filterColor(fragColor); +#endif + +#ifdef MODULE_FOG + fragColor = fog_filterColor(fragColor); +#endif + +#ifdef MODULE_PICKING + fragColor = picking_filterHighlightColor(fragColor); + fragColor = picking_filterPickingColor(fragColor); +#endif + +#ifdef MODULE_LOGDEPTH + logdepth_setFragDepth(); +#endif +`},Eo=/void\s+main\s*\([^)]*\)\s*\{\n?/,Do=/}\n?[^{}]*$/,Oo=[],ko=`__LUMA_INJECT_DECLARATIONS__`;function Ao(e){let t={vertex:{},fragment:{}};for(let n in e){let r=e[n],i=jo(n);typeof r==`string`&&(r={order:0,injection:r}),t[i][n]=r}return t}function jo(e){let t=e.slice(0,2);switch(t){case`vs`:return`vertex`;case`fs`:return`fragment`;default:throw Error(t)}}function Mo(e,t,n,r=!1){let i=t===`vertex`;for(let t in n){let r=n[t];r.sort((e,t)=>e.order-t.order),Oo.length=r.length;for(let e=0,t=r.length;ee+a));break;case`vs:#main-end`:i&&(e=e.replace(Do,e=>a+e));break;case`fs:#decl`:i||(e=e.replace(ko,a));break;case`fs:#main-start`:i||(e=e.replace(Eo,e=>e+a));break;case`fs:#main-end`:i||(e=e.replace(Do,e=>a+e));break;default:e=e.replace(t,e=>e+a)}}return e=e.replace(ko,``),r&&(e=e.replace(/\}\s*$/,e=>e+To[t])),e}function No(e){e.map(e=>Po(e))}function Po(e){if(e.instance)return;No(e.dependencies||[]);let{propTypes:t={},deprecations:n=[],inject:r={}}=e,i={normalizedInjections:Ao(r),parsedDeprecations:Io(n)};t&&(i.propValidators=So(t)),e.instance=i;let a={};t&&(a=Object.entries(t).reduce((e,[t,n])=>{let r=n?.value;return r&&(e[t]=r),e},{})),e.defaultUniforms={...e.defaultUniforms,...a}}function Fo(e,t,n){e.deprecations?.forEach(e=>{e.regex?.test(t)&&(e.deprecated?n.deprecated(e.old,e.new)():n.removed(e.old,e.new)())})}function Io(e){return e.forEach(e=>{switch(e.type){case`function`:e.regex=RegExp(`\\b${e.old}\\(`);break;default:e.regex=RegExp(`${e.type} ${e.old};`)}}),e}function Lo(e){No(e);let t={},n={};Ro({modules:e,level:0,moduleMap:t,moduleDepth:n});let r=Object.keys(n).sort((e,t)=>n[t]-n[e]).map(e=>t[e]);return No(r),r}function Ro(e){let{modules:t,level:n,moduleMap:r,moduleDepth:i}=e;if(n>=5)throw Error(`Possible loop in shader dependency graph`);for(let e of t)r[e.name]=e,(i[e.name]===void 0||i[e.name]]+>)?\s+([A-Za-z0-9_]+)(?:\s*\[[^\]]+\])?\s*;/,Bo=/((?:layout\s*\([^)]*\)\s*)*)uniform\s+([A-Za-z_][A-Za-z0-9_]*)\s*\{([\s\S]*?)\}\s*([A-Za-z_][A-Za-z0-9_]*)?\s*;/g;function Vo(e){return`${e.name}Uniforms`}function Ho(e,t){let n=t===`wgsl`?e.source:t===`vertex`?e.vs:e.fs;if(!n)return null;let r=Vo(e);return qo(n,t===`wgsl`?`wgsl`:`glsl`,r)}function Uo(e,t){let n=Object.keys(e.uniformTypes||{});if(!n.length)return null;let r=Ho(e,t);return r?{moduleName:e.name,uniformBlockName:Vo(e),stage:t,expectedUniformNames:n,actualUniformNames:r,matches:Xo(n,r)}:null}function Wo(e,t,n={}){let r=Uo(e,t);if(!r||r.matches)return r;let i=Zo(r);return n.log?.error?.(i,r)(),n.throwOnError!==!1&&bo(!1,i),r}function Go(e){let t=[],n=Qo(e);for(let e of n.matchAll(Bo)){let n=e[1]?.trim()||null;t.push({blockName:e[2],body:e[3],instanceName:e[4]||null,layoutQualifier:n,hasLayoutQualifier:!!n,isStd140:!!(n&&/\blayout\s*\([^)]*\bstd140\b[^)]*\)/.exec(n))})}return t}function Ko(e,t,n,r){let i=Go(e).filter(e=>!e.isStd140),a=new Set;for(let e of i){if(a.has(e.blockName))continue;a.add(e.blockName);let i=r?.label?`${r.label} `:``,o=e.hasLayoutQualifier?`declares ${$o(e.layoutQualifier)} instead of layout(std140)`:`does not declare layout(std140)`,s=`${i}${t} shader uniform block ${e.blockName} ${o}. luma.gl host-side shader block packing assumes explicit layout(std140) for GLSL uniform blocks. Add \`layout(std140)\` to the block declaration.`;n?.warn?.(s,e)()}return i}function qo(e,t,n){let r=t===`wgsl`?Jo(e,n):Yo(e,n);if(!r)return null;let i=[];for(let e of r.split(` +`)){let n=e.replace(/\/\/.*$/,``).trim();if(!n||n.startsWith(`#`))continue;let r=t===`wgsl`?n.match(/^([A-Za-z0-9_]+)\s*:/):n.match(zo);r&&i.push(r[1])}return i}function Jo(e,t){let n=RegExp(`\\bstruct\\s+${t}\\b`,`m`).exec(e);if(!n)return null;let r=e.indexOf(`{`,n.index);if(r<0)return null;let i=0;for(let t=r;te.blockName===t)?.body||null}function Xo(e,t){if(e.length!==t.length)return!1;for(let n=0;n!n.includes(e)),i=n.filter(e=>!t.includes(e)),a=[`Expected ${t.length} fields, found ${n.length}.`],o=es(t,n);return o&&a.push(o),r.length&&a.push(`Missing from shader block (${r.length}): ${ts(r)}.`),i.length&&a.push(`Unexpected in shader block (${i.length}): ${ts(i)}.`),t.length<=12&&n.length<=12&&(r.length||i.length)&&(a.push(`Expected: ${t.join(`, `)}.`),a.push(`Actual: ${n.join(`, `)}.`)),`${e.moduleName}: ${e.stage} shader uniform block ${e.uniformBlockName} does not match module.uniformTypes. ${a.join(` `)}`}function Qo(e){return e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/.*$/gm,``)}function $o(e){return e.replace(/\s+/g,` `).trim()}function es(e,t){let n=Math.min(e.length,t.length);for(let r=0;rt.length?`Shader block ends after field ${t.length}; expected next field ${e[t.length]}.`:t.length>e.length?`Shader block has extra field ${t.length}: ${t[e.length]}.`:null}function ts(e,t=8){if(e.length<=t)return e.join(`, `);let n=e.length-t;return`${e.slice(0,t).join(`, `)}, ... (${n} more)`}function ns(e){switch(e?.gpu.toLowerCase()){case`apple`:return`#define APPLE_GPU +// Apple optimizes away the calculation necessary for emulated fp64 +#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1 +#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1 +// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow +#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1 +`;case`nvidia`:return`#define NVIDIA_GPU +// Nvidia optimizes away the calculation necessary for emulated fp64 +#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1 +`;case`intel`:return`#define INTEL_GPU +// Intel optimizes away the calculation necessary for emulated fp64 +#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1 +// Intel's built-in 'tan' function doesn't have acceptable precision +#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1 +// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow +#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1 +`;case`amd`:return`#define AMD_GPU +`;default:return`#define DEFAULT_GPU +// Prevent driver from optimizing away the calculation necessary for emulated fp64 +#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1 +// Headless Chrome's software shader 'tan' function doesn't have acceptable precision +#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1 +// If the GPU doesn't have full 32 bits precision, will causes overflow +#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1 +`}}function rs(e,t){if(Number(e.match(/^#version[ \t]+(\d+)/m)?.[1]||100)!==300)throw Error(`luma.gl v9 only supports GLSL 3.00 shader sources`);switch(t){case`vertex`:return e=ss(e,as),e;case`fragment`:return e=ss(e,os),e;default:throw Error(t)}}var is=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,`#version 300 es +`],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,`textureLod(`],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,`texture(`]],as=[...is,[cs(`attribute`),`in $1`],[cs(`varying`),`out $1`]],os=[...is,[cs(`varying`),`in $1`]];function ss(e,t){for(let[n,r]of t)e=e.replace(n,r);return e}function cs(e){return RegExp(`\\b${e}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,`g`)}function ls(e,t){let n=``;for(let r in e){let i=e[r];if(n+=`void ${i.signature} {\n`,i.header&&(n+=` ${i.header}`),t[r]){let e=t[r];e.sort((e,t)=>e.order-t.order);for(let t of e)n+=` ${t.injection}\n`}i.footer&&(n+=` ${i.footer}`),n+=`} +`}return n}function us(e){let t={vertex:{},fragment:{}};for(let n of e){let e,r;typeof n==`string`?(e={},r=n):(e=n,r=e.hook),r=r.trim();let[i,a]=r.split(`:`),o=r.replace(/\(.+/,``),s=Object.assign(e,{signature:a});switch(i){case`vs`:t.vertex[o]=s;break;case`fs`:t.fragment[o]=s;break;default:throw Error(i)}}return t}function ds(e,t){return{name:fs(e,t),language:`glsl`,version:ps(e)}}function fs(e,t=`unnamed`){let n=/#define[^\S\r\n]*SHADER_NAME[^\S\r\n]*([A-Za-z0-9_-]+)\s*/.exec(e);return n?n[1]:t}function ps(e){let t=100,n=e.match(/[^\s]+/g);if(n&&n.length>=2&&n[0]===`#version`){let e=parseInt(n[1],10);Number.isFinite(e)&&(t=e)}if(t!==100&&t!==300)throw Error(`Invalid GLSL version ${t}`);return t}var ms=`(?:var<\\s*(uniform|storage(?:\\s*,\\s*[A-Za-z_][A-Za-z0-9_]*)?)\\s*>|var)\\s+([A-Za-z_][A-Za-z0-9_]*)`,hs=`\\s*`,gs=[RegExp(`@binding\\(\\s*(auto|\\d+)\\s*\\)${hs}@group\\(\\s*(\\d+)\\s*\\)${hs}${ms}`,`g`),RegExp(`@group\\(\\s*(\\d+)\\s*\\)${hs}@binding\\(\\s*(auto|\\d+)\\s*\\)${hs}${ms}`,`g`)],_s=[RegExp(`@binding\\(\\s*(auto|\\d+)\\s*\\)${hs}@group\\(\\s*(\\d+)\\s*\\)${hs}${ms}`,`g`),RegExp(`@group\\(\\s*(\\d+)\\s*\\)${hs}@binding\\(\\s*(auto|\\d+)\\s*\\)${hs}${ms}`,`g`)],vs=[RegExp(`@binding\\(\\s*(\\d+)\\s*\\)${hs}@group\\(\\s*(\\d+)\\s*\\)${hs}${ms}`,`g`),RegExp(`@group\\(\\s*(\\d+)\\s*\\)${hs}@binding\\(\\s*(\\d+)\\s*\\)${hs}${ms}`,`g`)],ys=[RegExp(`@binding\\(\\s*(auto)\\s*\\)\\s*@group\\(\\s*(\\d+)\\s*\\)\\s*${ms}`,`g`),RegExp(`@group\\(\\s*(\\d+)\\s*\\)\\s*@binding\\(\\s*(auto)\\s*\\)\\s*${ms}`,`g`),RegExp(`@binding\\(\\s*(auto)\\s*\\)\\s*@group\\(\\s*(\\d+)\\s*\\)(?:[\\s\\n\\r]*@[A-Za-z_][^\\n\\r]*)*[\\s\\n\\r]*${ms}`,`g`),RegExp(`@group\\(\\s*(\\d+)\\s*\\)\\s*@binding\\(\\s*(auto)\\s*\\)(?:[\\s\\n\\r]*@[A-Za-z_][^\\n\\r]*)*[\\s\\n\\r]*${ms}`,`g`)];function bs(e){let t=e.split(``),n=0,r=0,i=!1,a=!1,o=!1;for(;n0){if(s===`/`&&c===`*`){t[n]=` `,t[n+1]=` `,r++,n+=2;continue}if(s===`*`&&c===`/`){t[n]=` `,t[n+1]=` `,r--,n+=2;continue}s!==` +`&&s!==`\r`&&(t[n]=` `),n++;continue}if(s===`"`){a=!0,n++;continue}if(s===`/`&&c===`/`){t[n]=` `,t[n+1]=` `,i=!0,n+=2;continue}if(s===`/`&&c===`*`){t[n]=` `,t[n+1]=` `,r=1,n+=2;continue}n++}return t.join(``)}function xs(e,t){let n=bs(e),r=[];for(let i of t){i.lastIndex=0;let a;for(a=i.exec(n);a;){let o=i===t[0],s=a.index,c=a[0].length;r.push({match:e.slice(s,s+c),index:s,length:c,bindingToken:a[o?1:2],groupToken:a[o?2:1],accessDeclaration:a[3]?.trim(),name:a[4]}),a=i.exec(n)}}return r.sort((e,t)=>e.index-t.index)}function Ss(e,t,n){let r=xs(e,t);if(!r.length)return e;let i=``,a=0;for(let t of r)i+=e.slice(a,t.index),i+=n(t),a=t.index+t.length;return i+=e.slice(a),i}function Cs(e){return/@binding\(\s*auto\s*\)/.test(bs(e))}function ws(e,t){return xs(e,t===gs||t===_s?ys:t).find(e=>e.bindingToken===`auto`)}var Ts=[RegExp(`@binding\\(\\s*(\\d+)\\s*\\)\\s*@group\\(\\s*(\\d+)\\s*\\)\\s*${ms}\\s*:\\s*([^;]+);`,`g`),RegExp(`@group\\(\\s*(\\d+)\\s*\\)\\s*@binding\\(\\s*(\\d+)\\s*\\)\\s*${ms}\\s*:\\s*([^;]+);`,`g`)];function Es(e,t=[]){let n=bs(e),r=new Map;for(let e of t)r.set(Os(e.name,e.group,e.location),e.moduleName);let i=[];for(let e of Ts){e.lastIndex=0;let t;for(t=e.exec(n);t;){let a=e===Ts[0],o=Number(t[a?1:2]),s=Number(t[a?2:1]),c=t[3]?.trim(),l=t[4],u=t[5].trim(),d=r.get(Os(l,s,o));i.push(Ds({name:l,group:s,binding:o,owner:d?`module`:`application`,moduleName:d,accessDeclaration:c,resourceType:u})),t=e.exec(n)}}return i.sort((e,t)=>e.group===t.group?e.binding===t.binding?e.name.localeCompare(t.name):e.binding-t.binding:e.group-t.group)}function Ds(e){let t={name:e.name,group:e.group,binding:e.binding,owner:e.owner,kind:`unknown`,moduleName:e.moduleName,resourceType:e.resourceType};if(e.accessDeclaration){let n=e.accessDeclaration.split(`,`).map(e=>e.trim());if(n[0]===`uniform`)return{...t,kind:`uniform`,access:`uniform`};if(n[0]===`storage`){let e=n[1]||`read_write`;return{...t,kind:e===`read`?`read-only-storage`:`storage`,access:e}}}return e.resourceType===`sampler`||e.resourceType===`sampler_comparison`?{...t,kind:`sampler`,samplerKind:e.resourceType===`sampler_comparison`?`comparison`:`filtering`}:e.resourceType.startsWith(`texture_storage_`)?{...t,kind:`storage-texture`,access:js(e.resourceType),viewDimension:ks(e.resourceType)}:e.resourceType.startsWith(`texture_`)?{...t,kind:`texture`,viewDimension:ks(e.resourceType),sampleType:As(e.resourceType),multisampled:e.resourceType.startsWith(`texture_multisampled_`)}:t}function Os(e,t,n){return`${t}:${n}:${e}`}function ks(e){if(e.includes(`cube_array`))return`cube-array`;if(e.includes(`2d_array`))return`2d-array`;if(e.includes(`cube`))return`cube`;if(e.includes(`3d`))return`3d`;if(e.includes(`2d`))return`2d`;if(e.includes(`1d`))return`1d`}function As(e){if(e.startsWith(`texture_depth_`))return`depth`;if(e.includes(``))return`sint`;if(e.includes(``))return`uint`;if(e.includes(``))return`float`}function js(e){return/,\s*([A-Za-z_][A-Za-z0-9_]*)\s*>$/.exec(e)?.[1]}var Ms=`\n\n${ko}\n`,Ns=100,Ps=`precision highp float; +`;function Fs(e){let t=Lo(e.modules||[]),{source:n,bindingAssignments:r}=Ls(e.platformInfo,{...e,source:e.source,stage:`vertex`,modules:t});return{source:n,getUniforms:zs(t),bindingAssignments:r,bindingTable:Es(n,r)}}function Is(e){let{vs:t,fs:n}=e,r=Lo(e.modules||[]);return{vs:Rs(e.platformInfo,{...e,source:t,stage:`vertex`,modules:r}),fs:Rs(e.platformInfo,{...e,source:n,stage:`fragment`,modules:r}),getUniforms:zs(r)}}function Ls(e,t){let{source:n,stage:r,modules:i,hookFunctions:a=[],inject:o={},log:s}=t;bo(typeof n==`string`,`shader source must be a string`);let c=n,l=``,u=us(a),d={},f={},p={};for(let e in o){let t=typeof o[e]==`string`?{injection:o[e],order:0}:o[e],n=/^(v|f)s:(#)?([\w-]+)$/.exec(e);if(n){let r=n[2],i=n[3];r?i===`decl`?f[e]=[t]:p[e]=[t]:d[e]=[t]}else p[e]=[t]}let m=i,h=Us(c),g=Hs(h.source),_=qs(m,t._bindingRegistry,g),v=[];for(let e of m){s&&Fo(e,c,s);let n=Ws(Vs(e,`wgsl`,s),e,{usedBindingsByGroup:g,bindingRegistry:t._bindingRegistry,reservedBindingKeysByGroup:_});v.push(...n.bindingAssignments);let i=n.source;l+=i;let a=e.injections?.[r]||{};for(let e in a){let t=/^(v|f)s:#([\w-]+)$/.exec(e);if(t){let n=t[2]===`decl`?f:p;n[e]=n[e]||[],n[e].push(a[e])}else d[e]=d[e]||[],d[e].push(a[e])}}return l+=Ms,l=Mo(l,r,f),l+=ls(u[r],d),l+=nc(v),l+=h.source,l=Mo(l,r,p),tc(l),{source:l,bindingAssignments:v}}function Rs(e,t){let{source:n,stage:r,language:i=`glsl`,modules:a,defines:o={},hookFunctions:s=[],inject:c={},prologue:l=!0,log:u}=t;bo(typeof n==`string`,`shader source must be a string`);let d=i===`glsl`?ds(n).version:-1,f=e.shaderLanguageVersion,p=d===100?`#version 100`:`#version 300 es`,m=n.split(` +`).slice(1).join(` +`),h={};a.forEach(e=>{Object.assign(h,e.defines)}),Object.assign(h,o);let g=``;switch(i){case`wgsl`:break;case`glsl`:g=l?`\ +${p} + +// ----- PROLOGUE ------------------------- +${`#define SHADER_TYPE_${r.toUpperCase()}`} + +${ns(e)} +${r===`fragment`?Ps:``} + +// ----- APPLICATION DEFINES ------------------------- + +${Bs(h)} + +`:`${p} +`;break}let _=us(s),v={},y={},b={};for(let e in c){let t=typeof c[e]==`string`?{injection:c[e],order:0}:c[e],n=/^(v|f)s:(#)?([\w-]+)$/.exec(e);if(n){let r=n[2],i=n[3];r?i===`decl`?y[e]=[t]:b[e]=[t]:v[e]=[t]}else b[e]=[t]}for(let e of a){u&&Fo(e,m,u);let t=Vs(e,r,u);g+=t;let n=e.instance?.normalizedInjections[r]||{};for(let e in n){let t=/^(v|f)s:#([\w-]+)$/.exec(e);if(t){let r=t[2]===`decl`?y:b;r[e]=r[e]||[],r[e].push(n[e])}else v[e]=v[e]||[],v[e].push(n[e])}}return g+=`// ----- MAIN SHADER SOURCE -------------------------`,g+=Ms,g=Mo(g,r,y),g+=ls(_[r],v),g+=m,g=Mo(g,r,b),i===`glsl`&&d!==f&&(g=rs(g,r)),i===`glsl`&&Ko(g,r,u),g.trim()}function zs(e){return function(t){let n={};for(let r of e){let e=r.getUniforms?.(t,n);Object.assign(n,e)}return n}}function Bs(e={}){let t=``;for(let n in e){let r=e[n];(r||Number.isFinite(r))&&(t+=`#define ${n.toUpperCase()} ${e[n]}\n`)}return t}function Vs(e,t,n){let r;switch(t){case`vertex`:r=e.vs||``;break;case`fragment`:r=e.fs||``;break;case`wgsl`:r=e.source||``;break;default:bo(!1)}if(!e.name)throw Error(`Shader module must have a name`);Wo(e,t,{log:n});let i=e.name.toUpperCase().replace(/[^0-9a-z]/gi,`_`),a=`\ +// ----- MODULE ${e.name} --------------- + +`;return t!==`wgsl`&&(a+=`#define MODULE_${i}\n`),a+=`${r}\n`,a}function Hs(e){let t=new Map;for(let n of xs(e,vs)){let e=Number(n.bindingToken),r=Number(n.groupToken);Xs(r,e,n.name),Qs(t,r,e,`application binding "${n.name}"`)}return t}function Us(e){let t=xs(e,_s),n=new Map;for(let e of t){if(e.bindingToken===`auto`)continue;let t=Number(e.bindingToken),r=Number(e.groupToken);Xs(r,t,e.name),Qs(n,r,t,`application binding "${e.name}"`)}let r={sawSupportedBindingDeclaration:t.length>0},i=Ss(e,_s,e=>Ks(e,n,r));if(Cs(e)&&!r.sawSupportedBindingDeclaration)throw Error(`Unsupported @binding(auto) declaration form in application WGSL. Use adjacent "@group(N)" and "@binding(auto)" decorators followed by a bindable "var" declaration.`);return{source:i}}function Ws(e,t,n){let r=[],i={sawSupportedBindingDeclaration:xs(e,gs).length>0,nextHintedBindingLocation:typeof t.firstBindingSlot==`number`?t.firstBindingSlot:null},a=Ss(e,gs,e=>Gs(e,{module:t,context:n,bindingAssignments:r,relocationState:i}));if(Cs(e)&&!i.sawSupportedBindingDeclaration)throw Error(`Unsupported @binding(auto) declaration form in module "${t.name}". Use adjacent "@group(N)" and "@binding(auto)" decorators followed by a bindable "var" declaration.`);return{source:a,bindingAssignments:r}}function Gs(e,t){let{module:n,context:r,bindingAssignments:i,relocationState:a}=t,{match:o,bindingToken:s,groupToken:c,name:l}=e,u=Number(c);if(s===`auto`){let e=rc(u,n.name,l),t=r.bindingRegistry?.get(e),s=t===void 0?a.nextHintedBindingLocation===null?$s(u,r.usedBindingsByGroup):$s(u,r.usedBindingsByGroup,a.nextHintedBindingLocation):t;return Zs(n.name,u,s,l),t!==void 0&&Js(r.reservedBindingKeysByGroup,u,s,e)?(i.push({moduleName:n.name,name:l,group:u,location:s}),o.replace(/@binding\(\s*auto\s*\)/,`@binding(${s})`)):(Qs(r.usedBindingsByGroup,u,s,`module "${n.name}" binding "${l}"`),r.bindingRegistry?.set(e,s),i.push({moduleName:n.name,name:l,group:u,location:s}),a.nextHintedBindingLocation!==null&&t===void 0&&(a.nextHintedBindingLocation=s+1),o.replace(/@binding\(\s*auto\s*\)/,`@binding(${s})`))}let d=Number(s);return Zs(n.name,u,d,l),Qs(r.usedBindingsByGroup,u,d,`module "${n.name}" binding "${l}"`),i.push({moduleName:n.name,name:l,group:u,location:d}),o}function Ks(e,t,n){let{match:r,bindingToken:i,groupToken:a,name:o}=e,s=Number(a);if(i===`auto`){let e=ec(s,t);return Xs(s,e,o),Qs(t,s,e,`application binding "${o}"`),r.replace(/@binding\(\s*auto\s*\)/,`@binding(${e})`)}return n.sawSupportedBindingDeclaration=!0,r}function qs(e,t,n){let r=new Map;if(!t)return r;for(let i of e)for(let e of Ys(i)){let a=rc(e.group,i.name,e.name),o=t.get(a);if(o!==void 0){let t=r.get(e.group)||new Map,i=t.get(o);if(i&&i!==a)throw Error(`Duplicate WGSL binding reservation for modules "${i}" and "${a}": group ${e.group}, binding ${o}.`);Qs(n,e.group,o,`registered module binding "${a}"`),t.set(o,a),r.set(e.group,t)}}return r}function Js(e,t,n,r){let i=e.get(t);if(!i)return!1;let a=i.get(n);if(!a)return!1;if(a!==r)throw Error(`Registered module binding "${r}" collided with "${a}": group ${t}, binding ${n}.`);return!0}function Ys(e){let t=[],n=e.source||``;for(let e of xs(n,gs))t.push({name:e.name,group:Number(e.groupToken)});return t}function Xs(e,t,n){if(e===0&&t>=Ns)throw Error(`Application binding "${n}" in group 0 uses reserved binding ${t}. Application-owned explicit group-0 bindings must stay below ${Ns}.`)}function Zs(e,t,n,r){if(t===0&&n0?Math.max(...r)+1:0);for(;r.has(i);)i++;return i}function ec(e,t){let n=t.get(e)||new Set,r=0;for(;n.has(r);)r++;return r}function tc(e){let t=ws(e,gs);if(!t)return;let n=ic(e,t.index);throw n?Error(`Unresolved @binding(auto) for module "${n}" binding "${t.name}" remained in assembled WGSL source.`):ac(e,t.index)?Error(`Unresolved @binding(auto) for application binding "${t.name}" remained in assembled WGSL source.`):Error(`Unresolved @binding(auto) remained in assembled WGSL source near "${oc(t.match)}".`)}function nc(e){if(e.length===0)return``;let t=`// ----- MODULE WGSL BINDING ASSIGNMENTS --------------- +`;for(let n of e)t+=`// ${n.moduleName}.${n.name} -> @group(${n.group}) @binding(${n.location})\n`;return t+=` +`,t}function rc(e,t,n){return`${e}:${t}:${n}`}function ic(e,t){let n=/^\/\/ ----- MODULE ([^\n]+) ---------------$/gm,r,i;for(i=n.exec(e);i&&i.index<=t;)r=i[1],i=n.exec(e);return r}function ac(e,t){let n=e.indexOf(Ms);return n>=0?t>n:!0}function oc(e){return e.replace(/\s+/g,` `).trim()}var sc=`([a-zA-Z_][a-zA-Z0-9_]*)`,cc=RegExp(`^\\s*\\#\\s*ifdef\\s*${sc}\\s*$`),lc=RegExp(`^\\s*\\#\\s*ifndef\\s*${sc}\\s*(?:\\/\\/.*)?$`),uc=/^\s*\#\s*else\s*(?:\/\/.*)?$/,dc=/^\s*\#\s*endif\s*$/,fc=RegExp(`^\\s*\\#\\s*ifdef\\s*${sc}\\s*(?:\\/\\/.*)?$`),pc=/^\s*\#\s*endif\s*(?:\/\/.*)?$/;function mc(e,t){let n=e.split(` +`),r=[],i=[],a=!0;for(let e of n){let n=e.match(fc)||e.match(cc),o=e.match(lc),s=e.match(uc),c=e.match(pc)||e.match(dc);if(n||o){let e=(n||o)?.[1],r=!!t?.defines?.[e],s=n?r:!r,c=a&&s;i.push({parentActive:a,branchTaken:s,active:c}),a=c}else if(s){let e=i[i.length-1];if(!e)throw Error(`Encountered #else without matching #ifdef or #ifndef`);e.active=e.parentActive&&!e.branchTaken,e.branchTaken=!0,a=e.active}else c?(i.pop(),a=!i.length||i[i.length-1].active):a&&r.push(e)}if(i.length>0)throw Error(`Unterminated conditional block in shader source`);return r.join(` +`)}var hc=class e{static defaultShaderAssembler;_hookFunctions=[];_defaultModules=[];_wgslBindingRegistry=new Map;static getDefaultShaderAssembler(){return e.defaultShaderAssembler=e.defaultShaderAssembler||new e,e.defaultShaderAssembler}addDefaultModule(e){this._defaultModules.find(t=>t.name===(typeof e==`string`?e:e.name))||this._defaultModules.push(e)}removeDefaultModule(e){let t=typeof e==`string`?e:e.name;this._defaultModules=this._defaultModules.filter(e=>e.name!==t)}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e)}assembleWGSLShader(e){let t=this._getModuleList(e.modules),n=this._hookFunctions,{source:r,getUniforms:i,bindingAssignments:a}=Fs({...e,source:e.source,_bindingRegistry:this._wgslBindingRegistry,modules:t,hookFunctions:n}),o={...t.reduce((e,t)=>(Object.assign(e,t.defines),e),{}),...e.defines},s=e.platformInfo.shaderLanguage===`wgsl`?mc(r,{defines:o}):r;return{source:s,getUniforms:i,modules:t,bindingAssignments:a,bindingTable:Es(s,a)}}assembleGLSLShaderPair(e){let t=this._getModuleList(e.modules),n=this._hookFunctions;return{...Is({...e,vs:e.vs,fs:e.fs,modules:t,hookFunctions:n}),modules:t}}_getModuleList(e=[]){let t=Array(this._defaultModules.length+e.length),n={},r=0;for(let e=0,i=this._defaultModules.length;ee*xc,t)}function Oc(e,t){return Pc(e,e=>e*bc,t)}function kc(e,t,n){return Pc(e,e=>Math.max(t,Math.min(n,e)))}function Ac(e,t,n){return wc(e)?e.map((e,r)=>Ac(e,t[r],n)):n*t+(1-n)*e}function jc(e,t,n){let r=Sc.EPSILON;n&&(Sc.EPSILON=n);try{if(e===t)return!0;if(wc(e)&&wc(t)){if(e.length!==t.length)return!1;for(let n=0;n0?`, `:``)+Cc(this[n],e);return`${e.printTypes?this.constructor.name:``}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function dl(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function fl(e,t,n){let r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],c=n[2];return e[0]=i*c-a*s,e[1]=a*o-r*c,e[2]=r*s-i*o,e}function pl(e,t,n,r){let i=t[0],a=t[1],o=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=o+r*(n[2]-o),e}function ml(e,t,n){let r=t[0],i=t[1],a=t[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o||=1,e[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,e[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,e[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,e}function hl(e,t,n){let r=t[0],i=t[1],a=t[2];return e[0]=r*n[0]+i*n[3]+a*n[6],e[1]=r*n[1]+i*n[4]+a*n[7],e[2]=r*n[2]+i*n[5]+a*n[8],e}function gl(e,t,n){let r=n[0],i=n[1],a=n[2],o=n[3],s=t[0],c=t[1],l=t[2],u=i*l-a*c,d=a*s-r*l,f=r*c-i*s,p=i*f-a*d,m=a*u-r*f,h=r*d-i*u,g=o*2;return u*=g,d*=g,f*=g,p*=2,m*=2,h*=2,e[0]=s+u+p,e[1]=c+d+m,e[2]=l+f+h,e}function _l(e,t,n,r){let i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function vl(e,t,n,r){let i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function yl(e,t,n,r){let i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function bl(e,t){let n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],s=t[2],c=Math.sqrt((n*n+r*r+i*i)*(a*a+o*o+s*s)),l=c&&dl(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}var xl=sl,Sl=al,Cl=cl;(function(){let e=il();return function(t,n,r,i,a,o){let s,c;for(n||=3,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;s0?this.copy([e,...t]):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(zl)}fromObject(e){return this.check()}fromQuaternion(e){return Ll(this,e),this.check()}set(e,t,n,r,i,a,o,s,c){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=c,this.check()}setRowMajor(e,t,n,r,i,a,o,s,c){return this[0]=e,this[1]=r,this[2]=o,this[3]=t,this[4]=i,this[5]=s,this[6]=n,this[7]=a,this[8]=c,this.check()}determinant(){return Ml(this)}transpose(){return Al(this,this),this.check()}invert(){return jl(this,this),this.check()}multiplyLeft(e){return Nl(this,e,this),this.check()}multiplyRight(e){return Nl(this,this,e),this.check()}rotate(e){return Fl(this,this,e),this.check()}scale(e){return Array.isArray(e)?Il(this,this,e):Il(this,this,[e,e]),this.check()}translate(e){return Pl(this,this,e),this.check()}transform(e,t){let n;switch(e.length){case 2:n=Yc(t||[-0,-0],e,this);break;case 3:n=hl(t||[-0,-0,-0],e,this);break;case 4:n=nl(t||[-0,-0,-0,-0],e,this);break;default:throw Error(`Illegal vector`)}return Rc(n,e.length),n}transformVector(e,t){return this.transform(e,t)}transformVector2(e,t){return this.transform(e,t)}transformVector3(e,t){return this.transform(e,t)}},Vl,Hl=null;function Ul(){return Vl||(Vl=new Bl([0,0,0,0,0,0,0,0,0]),Object.freeze(Vl)),Vl}function Wl(){return Hl||(Hl=new Bl,Object.freeze(Hl)),Hl}function Gl(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Kl(e,t){if(e===t){let n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function ql(e,t){let n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14],_=t[15],v=n*s-r*o,y=n*c-i*o,b=n*l-a*o,x=r*c-i*s,S=r*l-a*s,C=i*l-a*c,w=u*h-d*m,T=u*g-f*m,E=u*_-p*m,D=d*g-f*h,O=d*_-p*h,k=f*_-p*g,A=v*k-y*O+b*D+x*E-S*T+C*w;return A?(A=1/A,e[0]=(s*k-c*O+l*D)*A,e[1]=(i*O-r*k-a*D)*A,e[2]=(h*C-g*S+_*x)*A,e[3]=(f*S-d*C-p*x)*A,e[4]=(c*E-o*k-l*T)*A,e[5]=(n*k-i*E+a*T)*A,e[6]=(g*b-m*C-_*y)*A,e[7]=(u*C-f*b+p*y)*A,e[8]=(o*O-s*E+l*w)*A,e[9]=(r*E-n*O-a*w)*A,e[10]=(m*S-h*b+_*v)*A,e[11]=(d*b-u*S-p*v)*A,e[12]=(s*T-o*D-c*w)*A,e[13]=(n*D-r*T+i*w)*A,e[14]=(h*y-m*x-g*v)*A,e[15]=(u*x-d*y+f*v)*A,e):null}function Jl(e){let t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=t*o-n*a,v=t*s-r*a,y=n*s-r*o,b=l*m-u*p,x=l*h-d*p,S=u*h-d*m,C=t*S-n*x+r*b,w=a*S-o*x+s*b,T=l*y-u*v+d*_,E=p*y-m*v+h*_;return c*C-i*w+g*T-f*E}function Yl(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=n[0],b=n[1],x=n[2],S=n[3];return e[0]=y*r+b*s+x*d+S*h,e[1]=y*i+b*c+x*f+S*g,e[2]=y*a+b*l+x*p+S*_,e[3]=y*o+b*u+x*m+S*v,y=n[4],b=n[5],x=n[6],S=n[7],e[4]=y*r+b*s+x*d+S*h,e[5]=y*i+b*c+x*f+S*g,e[6]=y*a+b*l+x*p+S*_,e[7]=y*o+b*u+x*m+S*v,y=n[8],b=n[9],x=n[10],S=n[11],e[8]=y*r+b*s+x*d+S*h,e[9]=y*i+b*c+x*f+S*g,e[10]=y*a+b*l+x*p+S*_,e[11]=y*o+b*u+x*m+S*v,y=n[12],b=n[13],x=n[14],S=n[15],e[12]=y*r+b*s+x*d+S*h,e[13]=y*i+b*c+x*f+S*g,e[14]=y*a+b*l+x*p+S*_,e[15]=y*o+b*u+x*m+S*v,e}function Xl(e,t,n){let r=n[0],i=n[1],a=n[2],o,s,c,l,u,d,f,p,m,h,g,_;return t===e?(e[12]=t[0]*r+t[4]*i+t[8]*a+t[12],e[13]=t[1]*r+t[5]*i+t[9]*a+t[13],e[14]=t[2]*r+t[6]*i+t[10]*a+t[14],e[15]=t[3]*r+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],c=t[2],l=t[3],u=t[4],d=t[5],f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],e[0]=o,e[1]=s,e[2]=c,e[3]=l,e[4]=u,e[5]=d,e[6]=f,e[7]=p,e[8]=m,e[9]=h,e[10]=g,e[11]=_,e[12]=o*r+u*i+m*a+t[12],e[13]=s*r+d*i+h*a+t[13],e[14]=c*r+f*i+g*a+t[14],e[15]=l*r+p*i+_*a+t[15]),e}function Zl(e,t,n){let r=n[0],i=n[1],a=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Ql(e,t,n,r){let i=r[0],a=r[1],o=r[2],s=Math.sqrt(i*i+a*a+o*o),c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j;return s<1e-6?null:(s=1/s,i*=s,a*=s,o*=s,l=Math.sin(n),c=Math.cos(n),u=1-c,d=t[0],f=t[1],p=t[2],m=t[3],h=t[4],g=t[5],_=t[6],v=t[7],y=t[8],b=t[9],x=t[10],S=t[11],C=i*i*u+c,w=a*i*u+o*l,T=o*i*u-a*l,E=i*a*u-o*l,D=a*a*u+c,O=o*a*u+i*l,k=i*o*u+a*l,A=a*o*u-i*l,j=o*o*u+c,e[0]=d*C+h*w+y*T,e[1]=f*C+g*w+b*T,e[2]=p*C+_*w+x*T,e[3]=m*C+v*w+S*T,e[4]=d*E+h*D+y*O,e[5]=f*E+g*D+b*O,e[6]=p*E+_*D+x*O,e[7]=m*E+v*D+S*O,e[8]=d*k+h*A+y*j,e[9]=f*k+g*A+b*j,e[10]=p*k+_*A+x*j,e[11]=m*k+v*A+S*j,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function $l(e,t,n){let r=Math.sin(n),i=Math.cos(n),a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+l*r,e[5]=o*i+u*r,e[6]=s*i+d*r,e[7]=c*i+f*r,e[8]=l*i-a*r,e[9]=u*i-o*r,e[10]=d*i-s*r,e[11]=f*i-c*r,e}function eu(e,t,n){let r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[8],u=t[9],d=t[10],f=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-l*r,e[1]=o*i-u*r,e[2]=s*i-d*r,e[3]=c*i-f*r,e[8]=a*r+l*i,e[9]=o*r+u*i,e[10]=s*r+d*i,e[11]=c*r+f*i,e}function tu(e,t,n){let r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[4],u=t[5],d=t[6],f=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+l*r,e[1]=o*i+u*r,e[2]=s*i+d*r,e[3]=c*i+f*r,e[4]=l*i-a*r,e[5]=u*i-o*r,e[6]=d*i-s*r,e[7]=f*i-c*r,e}function nu(e,t){let n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],s=t[6],c=t[8],l=t[9],u=t[10];return e[0]=Math.sqrt(n*n+r*r+i*i),e[1]=Math.sqrt(a*a+o*o+s*s),e[2]=Math.sqrt(c*c+l*l+u*u),e}function ru(e,t){let n=t[0],r=t[1],i=t[2],a=t[3],o=n+n,s=r+r,c=i+i,l=n*o,u=r*o,d=r*s,f=i*o,p=i*s,m=i*c,h=a*o,g=a*s,_=a*c;return e[0]=1-d-m,e[1]=u+_,e[2]=f-g,e[3]=0,e[4]=u-_,e[5]=1-l-m,e[6]=p+h,e[7]=0,e[8]=f+g,e[9]=p-h,e[10]=1-l-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function iu(e,t,n,r,i,a,o){let s=1/(n-t),c=1/(i-r),l=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*c,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(i+r)*c,e[10]=(o+a)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*l,e[15]=0,e}function au(e,t,n,r,i){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let t=1/(r-i);e[10]=(i+r)*t,e[14]=2*i*r*t}else e[10]=-1,e[14]=-2*r;return e}var ou=au;function su(e,t,n,r,i,a,o){let s=1/(t-n),c=1/(r-i),l=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*c,e[14]=(o+a)*l,e[15]=1,e}var cu=su;function lu(e,t,n,r){let i,a,o,s,c,l,u,d,f,p,m=t[0],h=t[1],g=t[2],_=r[0],v=r[1],y=r[2],b=n[0],x=n[1],S=n[2];return Math.abs(m-b)<1e-6&&Math.abs(h-x)<1e-6&&Math.abs(g-S)<1e-6?Gl(e):(d=m-b,f=h-x,p=g-S,i=1/Math.sqrt(d*d+f*f+p*p),d*=i,f*=i,p*=i,a=v*p-y*f,o=y*d-_*p,s=_*f-v*d,i=Math.sqrt(a*a+o*o+s*s),i?(i=1/i,a*=i,o*=i,s*=i):(a=0,o=0,s=0),c=f*s-p*o,l=p*a-d*s,u=d*o-f*a,i=Math.sqrt(c*c+l*l+u*u),i?(i=1/i,c*=i,l*=i,u*=i):(c=0,l=0,u=0),e[0]=a,e[1]=c,e[2]=d,e[3]=0,e[4]=o,e[5]=l,e[6]=f,e[7]=0,e[8]=s,e[9]=u,e[10]=p,e[11]=0,e[12]=-(a*m+o*h+s*g),e[13]=-(c*m+l*h+u*g),e[14]=-(d*m+f*h+p*g),e[15]=1,e)}function uu(){let e=new Vc(4);return Vc!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function du(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function fu(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function eee(e){let t=e[0],n=e[1],r=e[2],i=e[3];return Math.sqrt(t*t+n*n+r*r+i*i)}function tee(e){let t=e[0],n=e[1],r=e[2],i=e[3];return t*t+n*n+r*r+i*i}function pu(e,t){let n=t[0],r=t[1],i=t[2],a=t[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=r*o,e[2]=i*o,e[3]=a*o,e}function mu(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function hu(e,t,n,r){let i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=o+r*(n[2]-o),e[3]=s+r*(n[3]-s),e}function gu(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,e}function _u(e,t,n){let r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],c=n[2],l=n[3],u=l*r+s*a-c*i,d=l*i+c*r-o*a,f=l*a+o*i-s*r,p=-o*r-s*i-c*a;return e[0]=u*l+p*-o+d*-c-f*-s,e[1]=d*l+p*-s+f*-o-u*-c,e[2]=f*l+p*-c+u*-s-d*-o,e[3]=t[3],e}(function(){let e=uu();return function(t,n,r,i,a,o){let s,c;for(n||=4,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;sMath.PI*2)throw Error(`expected radians`)}function Au(e,t,n,r,i,a){let o=2*a/(n-t),s=2*a/(i-r),c=(n+t)/(n-t),l=(i+r)/(i-r),u=-2*a;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=c,e[9]=l,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=u,e[15]=0,e}function ju(){let e=new Vc(4);return Vc!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Mu(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Nu(e,t,n){n*=.5;let r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}function Pu(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=n[0],c=n[1],l=n[2],u=n[3];return e[0]=r*u+o*s+i*l-a*c,e[1]=i*u+o*c+a*s-r*l,e[2]=a*u+o*l+r*c-i*s,e[3]=o*u-r*s-i*c-a*l,e}function Fu(e,t,n){n*=.5;let r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c+o*s,e[1]=i*c+a*s,e[2]=a*c-i*s,e[3]=o*c-r*s,e}function Iu(e,t,n){n*=.5;let r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c-a*s,e[1]=i*c+o*s,e[2]=a*c+r*s,e[3]=o*c-i*s,e}function Lu(e,t,n){n*=.5;let r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c+i*s,e[1]=i*c-r*s,e[2]=a*c+o*s,e[3]=o*c-a*s,e}function Ru(e,t){let n=t[0],r=t[1],i=t[2];return e[0]=n,e[1]=r,e[2]=i,e[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),e}function zu(e,t,n,r){let i=t[0],a=t[1],o=t[2],s=t[3],c=n[0],l=n[1],u=n[2],d=n[3],f,p,m,h,g;return f=i*c+a*l+o*u+s*d,f<0&&(f=-f,c=-c,l=-l,u=-u,d=-d),1-f>1e-6?(p=Math.acos(f),g=Math.sin(p),m=Math.sin((1-r)*p)/g,h=Math.sin(r*p)/g):(m=1-r,h=r),e[0]=m*i+h*c,e[1]=m*a+h*l,e[2]=m*o+h*u,e[3]=m*s+h*d,e}function Bu(e,t){let n=t[0],r=t[1],i=t[2],a=t[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=a*s,e}function Vu(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function Hu(e,t){let n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{let n=0;t[4]>t[0]&&(n=1),t[8]>t[n*3+n]&&(n=2);let i=(n+1)%3,a=(n+2)%3;r=Math.sqrt(t[n*3+n]-t[i*3+i]-t[a*3+a]+1),e[n]=.5*r,r=.5/r,e[3]=(t[i*3+a]-t[a*3+i])*r,e[i]=(t[i*3+n]+t[n*3+i])*r,e[a]=(t[a*3+n]+t[n*3+a])*r}return e}var Uu=du,Wu=fu,Gu=mu,Ku=hu,qu=eee,Ju=tee,Yu=pu,Xu=(function(){let e=il(),t=ol(1,0,0),n=ol(0,1,0);return function(r,i,a){let o=dl(i,a);return o<-.999999?(fl(e,t,i),Sl(e)<1e-6&&fl(e,n,i),ul(e,e),Nu(r,e,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(fl(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+o,Yu(r,r))}})();(function(){let e=ju(),t=ju();return function(n,r,i,a,o,s){return zu(e,r,o,s),zu(t,i,a,s),zu(n,e,t,2*s*(1-s)),n}})(),(function(){let e=kl();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Yu(t,Hu(t,e))}})();var Zu=[0,0,0,1],Qu=class extends Fc{constructor(e=0,t=0,n=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,t,n,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,n,r){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return Hu(this,e),this.check()}fromAxisRotation(e,t){return Nu(this,e,t),this.check()}identity(){return Mu(this),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=Lc(e)}get y(){return this[1]}set y(e){this[1]=Lc(e)}get z(){return this[2]}set z(e){this[2]=Lc(e)}get w(){return this[3]}set w(e){this[3]=Lc(e)}len(){return qu(this)}lengthSquared(){return Ju(this)}dot(e){return Gu(this,e)}rotationTo(e,t){return Xu(this,e,t),this.check()}add(e){return Uu(this,this,e),this.check()}calculateW(){return Ru(this,this),this.check()}conjugate(){return Vu(this,this),this.check()}invert(){return Bu(this,this),this.check()}lerp(e,t,n){return n===void 0?this.lerp(this,e,t):(Ku(this,e,t,n),this.check())}multiplyRight(e){return Pu(this,this,e),this.check()}multiplyLeft(e){return Pu(this,e,this),this.check()}normalize(){let e=this.len(),t=e>0?1/e:0;return this[0]*=t,this[1]*=t,this[2]*=t,this[3]*=t,e===0&&(this[3]=1),this.check()}rotateX(e){return Fu(this,this,e),this.check()}rotateY(e){return Iu(this,this,e),this.check()}rotateZ(e){return Lu(this,this,e),this.check()}scale(e){return Wu(this,this,e),this.check()}slerp(e,t,n){let r,i,a;switch(arguments.length){case 1:({start:r=Zu,target:i,ratio:a}=e);break;case 2:r=this,i=e,a=t;break;default:r=e,i=t,a=n}return zu(this,r,i,a),this.check()}transformVector4(e,t=new Dl){return _u(t,e,this),Rc(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}},$u=.1,ed=1e-12,td=1e-15,nd=1e-20;Math.PI/2,Math.PI/4,Math.PI/6,Math.PI*2;function rd(e,t=[],n=0){let r=Math.fround(e),i=e-r;return t[n]=r,t[n+1]=i,t}function id(e){return e-Math.fround(e)}function ad(e){let t=new Float32Array(32);for(let n=0;n<4;++n)for(let r=0;r<4;++r){let i=n*4+r;rd(e[r*4+n],t,i*2)}return t}function od(e,t=!0){return e??t}function sd(e=[0,0,0],t=!0){return t?e.map(e=>e/255):[...e]}function cd(e,t=!0){let n=sd(e.slice(0,3),t),r=Number.isFinite(e[3]),i=r?e[3]:1;return[n[0],n[1],n[2],t&&r?i/255:i]}var ld={name:`fp32`,vs:`#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND + +// All these functions are for substituting tan() function from Intel GPU only +const float TWO_PI = 6.2831854820251465; +const float PI_2 = 1.5707963705062866; +const float PI_16 = 0.1963495463132858; + +const float SIN_TABLE_0 = 0.19509032368659973; +const float SIN_TABLE_1 = 0.3826834261417389; +const float SIN_TABLE_2 = 0.5555702447891235; +const float SIN_TABLE_3 = 0.7071067690849304; + +const float COS_TABLE_0 = 0.9807852506637573; +const float COS_TABLE_1 = 0.9238795042037964; +const float COS_TABLE_2 = 0.8314695954322815; +const float COS_TABLE_3 = 0.7071067690849304; + +const float INVERSE_FACTORIAL_3 = 1.666666716337204e-01; // 1/3! +const float INVERSE_FACTORIAL_5 = 8.333333767950535e-03; // 1/5! +const float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04; // 1/7! +const float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06; // 1/9! + +float sin_taylor_fp32(float a) { + float r, s, t, x; + + if (a == 0.0) { + return 0.0; + } + + x = -a * a; + s = a; + r = a; + + r = r * x; + t = r * INVERSE_FACTORIAL_3; + s = s + t; + + r = r * x; + t = r * INVERSE_FACTORIAL_5; + s = s + t; + + r = r * x; + t = r * INVERSE_FACTORIAL_7; + s = s + t; + + r = r * x; + t = r * INVERSE_FACTORIAL_9; + s = s + t; + + return s; +} + +void sincos_taylor_fp32(float a, out float sin_t, out float cos_t) { + if (a == 0.0) { + sin_t = 0.0; + cos_t = 1.0; + } + sin_t = sin_taylor_fp32(a); + cos_t = sqrt(1.0 - sin_t * sin_t); +} + +float tan_taylor_fp32(float a) { + float sin_a; + float cos_a; + + if (a == 0.0) { + return 0.0; + } + + // 2pi range reduction + float z = floor(a / TWO_PI); + float r = a - TWO_PI * z; + + float t; + float q = floor(r / PI_2 + 0.5); + int j = int(q); + + if (j < -2 || j > 2) { + return 1.0 / 0.0; + } + + t = r - PI_2 * q; + + q = floor(t / PI_16 + 0.5); + int k = int(q); + int abs_k = int(abs(float(k))); + + if (abs_k > 4) { + return 1.0 / 0.0; + } else { + t = t - PI_16 * q; + } + + float u = 0.0; + float v = 0.0; + + float sin_t, cos_t; + float s, c; + sincos_taylor_fp32(t, sin_t, cos_t); + + if (k == 0) { + s = sin_t; + c = cos_t; + } else { + if (abs(float(abs_k) - 1.0) < 0.5) { + u = COS_TABLE_0; + v = SIN_TABLE_0; + } else if (abs(float(abs_k) - 2.0) < 0.5) { + u = COS_TABLE_1; + v = SIN_TABLE_1; + } else if (abs(float(abs_k) - 3.0) < 0.5) { + u = COS_TABLE_2; + v = SIN_TABLE_2; + } else if (abs(float(abs_k) - 4.0) < 0.5) { + u = COS_TABLE_3; + v = SIN_TABLE_3; + } + if (k > 0) { + s = u * sin_t + v * cos_t; + c = u * cos_t - v * sin_t; + } else { + s = u * sin_t - v * cos_t; + c = u * cos_t + v * sin_t; + } + } + + if (j == 0) { + sin_a = s; + cos_a = c; + } else if (j == 1) { + sin_a = c; + cos_a = -s; + } else if (j == -1) { + sin_a = -c; + cos_a = s; + } else { + sin_a = -s; + cos_a = -c; + } + return sin_a / cos_a; +} +#endif + +float tan_fp32(float a) { +#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND + return tan_taylor_fp32(a); +#else + return tan(a); +#endif +} +`},ud=` +layout(std140) uniform fp64arithmeticUniforms { + uniform float ONE; + uniform float SPLIT; +} fp64; + +/* +About LUMA_FP64_CODE_ELIMINATION_WORKAROUND + +The purpose of this workaround is to prevent shader compilers from +optimizing away necessary arithmetic operations by swapping their sequences +or transform the equation to some 'equivalent' form. + +These helpers implement Dekker/Veltkamp-style error tracking. If the compiler +folds constants or reassociates the arithmetic, the high/low split can stop +tracking the rounding error correctly. That failure mode tends to look fine in +simple coordinate setup, but then breaks down inside iterative arithmetic such +as fp64 Mandelbrot loops. + +The method is to multiply an artifical variable, ONE, which will be known to +the compiler to be 1 only at runtime. The whole expression is then represented +as a polynomial with respective to ONE. In the coefficients of all terms, only one a +and one b should appear + +err = (a + b) * ONE^6 - a * ONE^5 - (a + b) * ONE^4 + a * ONE^3 - b - (a + b) * ONE^2 + a * ONE +*/ + +float prevent_fp64_optimization(float value) { +#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) + return value + fp64.ONE * 0.0; +#else + return value; +#endif +} + +// Divide float number to high and low floats to extend fraction bits +vec2 split(float a) { + // Keep SPLIT as a runtime uniform so the compiler cannot fold the Dekker + // split into a constant expression and reassociate the recovery steps. + float split = prevent_fp64_optimization(fp64.SPLIT); + float t = prevent_fp64_optimization(a * split); + float temp = t - a; + float a_hi = t - temp; + float a_lo = a - a_hi; + return vec2(a_hi, a_lo); +} + +// Divide float number again when high float uses too many fraction bits +vec2 split2(vec2 a) { + vec2 b = split(a.x); + b.y += a.y; + return b; +} + +// Special sum operation when a > b +vec2 quickTwoSum(float a, float b) { +#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) + float sum = (a + b) * fp64.ONE; + float err = b - (sum - a) * fp64.ONE; +#else + float sum = a + b; + float err = b - (sum - a); +#endif + return vec2(sum, err); +} + +// General sum operation +vec2 twoSum(float a, float b) { + float s = (a + b); +#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) + float v = (s * fp64.ONE - a) * fp64.ONE; + float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE + (b - v); +#else + float v = s - a; + float err = (a - (s - v)) + (b - v); +#endif + return vec2(s, err); +} + +vec2 twoSub(float a, float b) { + float s = (a - b); +#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) + float v = (s * fp64.ONE - a) * fp64.ONE; + float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE - (b + v); +#else + float v = s - a; + float err = (a - (s - v)) - (b + v); +#endif + return vec2(s, err); +} + +vec2 twoSqr(float a) { + float prod = a * a; + vec2 a_fp64 = split(a); +#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) + float err = ((a_fp64.x * a_fp64.x - prod) * fp64.ONE + 2.0 * a_fp64.x * + a_fp64.y * fp64.ONE * fp64.ONE) + a_fp64.y * a_fp64.y * fp64.ONE * fp64.ONE * fp64.ONE; +#else + float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y; +#endif + return vec2(prod, err); +} + +vec2 twoProd(float a, float b) { + float prod = a * b; + vec2 a_fp64 = split(a); + vec2 b_fp64 = split(b); + // twoProd is especially sensitive because mul_fp64 and div_fp64 both depend + // on the split terms and cross terms staying in the original evaluation + // order. If the compiler folds or reassociates them, the low part tends to + // collapse to zero or NaN on some drivers. + float highProduct = prevent_fp64_optimization(a_fp64.x * b_fp64.x); + float crossProduct1 = prevent_fp64_optimization(a_fp64.x * b_fp64.y); + float crossProduct2 = prevent_fp64_optimization(a_fp64.y * b_fp64.x); + float lowProduct = prevent_fp64_optimization(a_fp64.y * b_fp64.y); +#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) + float err1 = (highProduct - prod) * fp64.ONE; + float err2 = crossProduct1 * fp64.ONE * fp64.ONE; + float err3 = crossProduct2 * fp64.ONE * fp64.ONE * fp64.ONE; + float err4 = lowProduct * fp64.ONE * fp64.ONE * fp64.ONE * fp64.ONE; +#else + float err1 = highProduct - prod; + float err2 = crossProduct1; + float err3 = crossProduct2; + float err4 = lowProduct; +#endif + float err = ((err1 + err2) + err3) + err4; + return vec2(prod, err); +} + +vec2 sum_fp64(vec2 a, vec2 b) { + vec2 s, t; + s = twoSum(a.x, b.x); + t = twoSum(a.y, b.y); + s.y += t.x; + s = quickTwoSum(s.x, s.y); + s.y += t.y; + s = quickTwoSum(s.x, s.y); + return s; +} + +vec2 sub_fp64(vec2 a, vec2 b) { + vec2 s, t; + s = twoSub(a.x, b.x); + t = twoSub(a.y, b.y); + s.y += t.x; + s = quickTwoSum(s.x, s.y); + s.y += t.y; + s = quickTwoSum(s.x, s.y); + return s; +} + +vec2 mul_fp64(vec2 a, vec2 b) { + vec2 prod = twoProd(a.x, b.x); + // y component is for the error + prod.y += a.x * b.y; +#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND) + prod = split2(prod); +#endif + prod = quickTwoSum(prod.x, prod.y); + prod.y += a.y * b.x; +#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND) + prod = split2(prod); +#endif + prod = quickTwoSum(prod.x, prod.y); + return prod; +} + +vec2 div_fp64(vec2 a, vec2 b) { + float xn = 1.0 / b.x; +#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND) + vec2 yn = mul_fp64(a, vec2(xn, 0)); +#else + vec2 yn = a * xn; +#endif + float diff = (sub_fp64(a, mul_fp64(b, yn))).x; + vec2 prod = twoProd(xn, diff); + return sum_fp64(yn, prod); +} + +vec2 sqrt_fp64(vec2 a) { + if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0); + if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0); + + float x = 1.0 / sqrt(a.x); + float yn = a.x * x; +#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) + vec2 yn_sqr = twoSqr(yn) * fp64.ONE; +#else + vec2 yn_sqr = twoSqr(yn); +#endif + float diff = sub_fp64(a, yn_sqr).x; + vec2 prod = twoProd(x * 0.5, diff); +#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND) + return sum_fp64(split(yn), prod); +#else + return sum_fp64(vec2(yn, 0.0), prod); +#endif +} +`,dd={name:`fp64arithmetic`,source:`struct Fp64ArithmeticUniforms { + ONE: f32, + SPLIT: f32, +}; + +@group(0) @binding(auto) var fp64arithmetic : Fp64ArithmeticUniforms; + +fn fp64_nan(seed: f32) -> f32 { + let nanBits = 0x7fc00000u | select(0u, 1u, seed < 0.0); + return bitcast(nanBits); +} + +fn fp64_runtime_zero() -> f32 { + return fp64arithmetic.ONE * 0.0; +} + +fn prevent_fp64_optimization(value: f32) -> f32 { +#ifdef LUMA_FP64_CODE_ELIMINATION_WORKAROUND + return value + fp64_runtime_zero(); +#else + return value; +#endif +} + +fn split(a: f32) -> vec2f { + let splitValue = prevent_fp64_optimization(fp64arithmetic.SPLIT + fp64_runtime_zero()); + let t = prevent_fp64_optimization(a * splitValue); + let temp = prevent_fp64_optimization(t - a); + let aHi = prevent_fp64_optimization(t - temp); + let aLo = prevent_fp64_optimization(a - aHi); + return vec2f(aHi, aLo); +} + +fn split2(a: vec2f) -> vec2f { + var b = split(a.x); + b.y = b.y + a.y; + return b; +} + +fn quickTwoSum(a: f32, b: f32) -> vec2f { +#ifdef LUMA_FP64_CODE_ELIMINATION_WORKAROUND + let sum = prevent_fp64_optimization((a + b) * fp64arithmetic.ONE); + let err = prevent_fp64_optimization(b - (sum - a) * fp64arithmetic.ONE); +#else + let sum = prevent_fp64_optimization(a + b); + let err = prevent_fp64_optimization(b - (sum - a)); +#endif + return vec2f(sum, err); +} + +fn twoSum(a: f32, b: f32) -> vec2f { + let s = prevent_fp64_optimization(a + b); +#ifdef LUMA_FP64_CODE_ELIMINATION_WORKAROUND + let v = prevent_fp64_optimization((s * fp64arithmetic.ONE - a) * fp64arithmetic.ONE); + let err = + prevent_fp64_optimization((a - (s - v) * fp64arithmetic.ONE) * + fp64arithmetic.ONE * + fp64arithmetic.ONE * + fp64arithmetic.ONE) + + prevent_fp64_optimization(b - v); +#else + let v = prevent_fp64_optimization(s - a); + let err = prevent_fp64_optimization(a - (s - v)) + prevent_fp64_optimization(b - v); +#endif + return vec2f(s, err); +} + +fn twoSub(a: f32, b: f32) -> vec2f { + let s = prevent_fp64_optimization(a - b); +#ifdef LUMA_FP64_CODE_ELIMINATION_WORKAROUND + let v = prevent_fp64_optimization((s * fp64arithmetic.ONE - a) * fp64arithmetic.ONE); + let err = + prevent_fp64_optimization((a - (s - v) * fp64arithmetic.ONE) * + fp64arithmetic.ONE * + fp64arithmetic.ONE * + fp64arithmetic.ONE) - + prevent_fp64_optimization(b + v); +#else + let v = prevent_fp64_optimization(s - a); + let err = prevent_fp64_optimization(a - (s - v)) - prevent_fp64_optimization(b + v); +#endif + return vec2f(s, err); +} + +fn twoSqr(a: f32) -> vec2f { + let prod = prevent_fp64_optimization(a * a); + let aFp64 = split(a); + let highProduct = prevent_fp64_optimization(aFp64.x * aFp64.x); + let crossProduct = prevent_fp64_optimization(2.0 * aFp64.x * aFp64.y); + let lowProduct = prevent_fp64_optimization(aFp64.y * aFp64.y); +#ifdef LUMA_FP64_CODE_ELIMINATION_WORKAROUND + let err = + (prevent_fp64_optimization(highProduct - prod) * fp64arithmetic.ONE + + crossProduct * fp64arithmetic.ONE * fp64arithmetic.ONE) + + lowProduct * fp64arithmetic.ONE * fp64arithmetic.ONE * fp64arithmetic.ONE; +#else + let err = ((prevent_fp64_optimization(highProduct - prod) + crossProduct) + lowProduct); +#endif + return vec2f(prod, err); +} + +fn twoProd(a: f32, b: f32) -> vec2f { + let prod = prevent_fp64_optimization(a * b); + let aFp64 = split(a); + let bFp64 = split(b); + let highProduct = prevent_fp64_optimization(aFp64.x * bFp64.x); + let crossProduct1 = prevent_fp64_optimization(aFp64.x * bFp64.y); + let crossProduct2 = prevent_fp64_optimization(aFp64.y * bFp64.x); + let lowProduct = prevent_fp64_optimization(aFp64.y * bFp64.y); +#ifdef LUMA_FP64_CODE_ELIMINATION_WORKAROUND + let err1 = (highProduct - prod) * fp64arithmetic.ONE; + let err2 = crossProduct1 * fp64arithmetic.ONE * fp64arithmetic.ONE; + let err3 = crossProduct2 * fp64arithmetic.ONE * fp64arithmetic.ONE * fp64arithmetic.ONE; + let err4 = + lowProduct * + fp64arithmetic.ONE * + fp64arithmetic.ONE * + fp64arithmetic.ONE * + fp64arithmetic.ONE; +#else + let err1 = highProduct - prod; + let err2 = crossProduct1; + let err3 = crossProduct2; + let err4 = lowProduct; +#endif + let err12InputA = prevent_fp64_optimization(err1); + let err12InputB = prevent_fp64_optimization(err2); + let err12 = prevent_fp64_optimization(err12InputA + err12InputB); + let err123InputA = prevent_fp64_optimization(err12); + let err123InputB = prevent_fp64_optimization(err3); + let err123 = prevent_fp64_optimization(err123InputA + err123InputB); + let err1234InputA = prevent_fp64_optimization(err123); + let err1234InputB = prevent_fp64_optimization(err4); + let err = prevent_fp64_optimization(err1234InputA + err1234InputB); + return vec2f(prod, err); +} + +fn sum_fp64(a: vec2f, b: vec2f) -> vec2f { + var s = twoSum(a.x, b.x); + let t = twoSum(a.y, b.y); + s.y = prevent_fp64_optimization(s.y + t.x); + s = quickTwoSum(s.x, s.y); + s.y = prevent_fp64_optimization(s.y + t.y); + s = quickTwoSum(s.x, s.y); + return s; +} + +fn sub_fp64(a: vec2f, b: vec2f) -> vec2f { + var s = twoSub(a.x, b.x); + let t = twoSub(a.y, b.y); + s.y = prevent_fp64_optimization(s.y + t.x); + s = quickTwoSum(s.x, s.y); + s.y = prevent_fp64_optimization(s.y + t.y); + s = quickTwoSum(s.x, s.y); + return s; +} + +fn mul_fp64(a: vec2f, b: vec2f) -> vec2f { + var prod = twoProd(a.x, b.x); + let crossProduct1 = prevent_fp64_optimization(a.x * b.y); + prod.y = prevent_fp64_optimization(prod.y + crossProduct1); +#ifdef LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND + prod = split2(prod); +#endif + prod = quickTwoSum(prod.x, prod.y); + let crossProduct2 = prevent_fp64_optimization(a.y * b.x); + prod.y = prevent_fp64_optimization(prod.y + crossProduct2); +#ifdef LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND + prod = split2(prod); +#endif + prod = quickTwoSum(prod.x, prod.y); + return prod; +} + +fn div_fp64(a: vec2f, b: vec2f) -> vec2f { + let xn = prevent_fp64_optimization(1.0 / b.x); + let yn = mul_fp64(a, vec2f(xn, fp64_runtime_zero())); + let diff = prevent_fp64_optimization(sub_fp64(a, mul_fp64(b, yn)).x); + let prod = twoProd(xn, diff); + return sum_fp64(yn, prod); +} + +fn sqrt_fp64(a: vec2f) -> vec2f { + if (a.x == 0.0 && a.y == 0.0) { + return vec2f(0.0, 0.0); + } + if (a.x < 0.0) { + let nanValue = fp64_nan(a.x); + return vec2f(nanValue, nanValue); + } + + let x = prevent_fp64_optimization(1.0 / sqrt(a.x)); + let yn = prevent_fp64_optimization(a.x * x); +#ifdef LUMA_FP64_CODE_ELIMINATION_WORKAROUND + let ynSqr = twoSqr(yn) * fp64arithmetic.ONE; +#else + let ynSqr = twoSqr(yn); +#endif + let diff = prevent_fp64_optimization(sub_fp64(a, ynSqr).x); + let prod = twoProd(prevent_fp64_optimization(x * 0.5), diff); +#ifdef LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND + return sum_fp64(split(yn), prod); +#else + return sum_fp64(vec2f(yn, 0.0), prod); +#endif +} +`,fs:ud,vs:ud,defaultUniforms:{ONE:1,SPLIT:4097},uniformTypes:{ONE:`f32`,SPLIT:`f32`},fp64ify:rd,fp64LowPart:id,fp64ifyMatrix4:ad},fd=`layout(std140) uniform floatColorsUniforms { + float useByteColors; +} floatColors; + +vec3 floatColors_normalize(vec3 inputColor) { + return floatColors.useByteColors > 0.5 ? inputColor / 255.0 : inputColor; +} + +vec4 floatColors_normalize(vec4 inputColor) { + return floatColors.useByteColors > 0.5 ? inputColor / 255.0 : inputColor; +} + +vec4 floatColors_premultiplyAlpha(vec4 inputColor) { + return vec4(inputColor.rgb * inputColor.a, inputColor.a); +} + +vec4 floatColors_unpremultiplyAlpha(vec4 inputColor) { + return inputColor.a > 0.0 ? vec4(inputColor.rgb / inputColor.a, inputColor.a) : vec4(0.0); +} + +vec4 floatColors_premultiply_alpha(vec4 inputColor) { + return floatColors_premultiplyAlpha(inputColor); +} + +vec4 floatColors_unpremultiply_alpha(vec4 inputColor) { + return floatColors_unpremultiplyAlpha(inputColor); +} +`,pd={name:`floatColors`,props:{},uniforms:{},vs:fd,fs:fd,source:`struct floatColorsUniforms { + useByteColors: f32 +}; + +@group(0) @binding(auto) var floatColors : floatColorsUniforms; + +fn floatColors_normalize(inputColor: vec3) -> vec3 { + return select(inputColor, inputColor / 255.0, floatColors.useByteColors > 0.5); +} + +fn floatColors_normalize4(inputColor: vec4) -> vec4 { + return select(inputColor, inputColor / 255.0, floatColors.useByteColors > 0.5); +} + +fn floatColors_premultiplyAlpha(inputColor: vec4) -> vec4 { + return vec4(inputColor.rgb * inputColor.a, inputColor.a); +} + +fn floatColors_unpremultiplyAlpha(inputColor: vec4) -> vec4 { + return select( + vec4(0.0), + vec4(inputColor.rgb / inputColor.a, inputColor.a), + inputColor.a > 0.0 + ); +} + +fn floatColors_premultiply_alpha(inputColor: vec4) -> vec4 { + return floatColors_premultiplyAlpha(inputColor); +} + +fn floatColors_unpremultiply_alpha(inputColor: vec4) -> vec4 { + return floatColors_unpremultiplyAlpha(inputColor); +} +`,uniformTypes:{useByteColors:`f32`},defaultUniforms:{useByteColors:!0}},md={props:{},uniforms:{},name:`picking`,uniformTypes:{isActive:`f32`,isAttribute:`f32`,isHighlightActive:`f32`,useByteColors:`f32`,highlightedObjectColor:`vec3`,highlightColor:`vec4`},defaultUniforms:{isActive:!1,isAttribute:!1,isHighlightActive:!1,useByteColors:!0,highlightedObjectColor:[0,0,0],highlightColor:[0,1,1,1]},vs:`layout(std140) uniform pickingUniforms { + float isActive; + float isAttribute; + float isHighlightActive; + float useByteColors; + vec3 highlightedObjectColor; + vec4 highlightColor; +} picking; + +out vec4 picking_vRGBcolor_Avalid; + +// Normalize unsigned byte color to 0-1 range +vec3 picking_normalizeColor(vec3 color) { + return picking.useByteColors > 0.5 ? color / 255.0 : color; +} + +// Normalize unsigned byte color to 0-1 range +vec4 picking_normalizeColor(vec4 color) { + return picking.useByteColors > 0.5 ? color / 255.0 : color; +} + +bool picking_isColorZero(vec3 color) { + return dot(color, vec3(1.0)) < 0.00001; +} + +bool picking_isColorValid(vec3 color) { + return dot(color, vec3(1.0)) > 0.00001; +} + +// Check if this vertex is highlighted +bool isVertexHighlighted(vec3 vertexColor) { + vec3 highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor); + return + bool(picking.isHighlightActive) && picking_isColorZero(abs(vertexColor - highlightedObjectColor)); +} + +// Set the current picking color +void picking_setPickingColor(vec3 pickingColor) { + pickingColor = picking_normalizeColor(pickingColor); + + if (bool(picking.isActive)) { + // Use alpha as the validity flag. If pickingColor is [0, 0, 0] fragment is non-pickable + picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor)); + + if (!bool(picking.isAttribute)) { + // Stores the picking color so that the fragment shader can render it during picking + picking_vRGBcolor_Avalid.rgb = pickingColor; + } + } else { + // Do the comparison with selected item color in vertex shader as it should mean fewer compares + picking_vRGBcolor_Avalid.a = float(isVertexHighlighted(pickingColor)); + } +} + +void picking_setPickingAttribute(float value) { + if (bool(picking.isAttribute)) { + picking_vRGBcolor_Avalid.r = value; + } +} + +void picking_setPickingAttribute(vec2 value) { + if (bool(picking.isAttribute)) { + picking_vRGBcolor_Avalid.rg = value; + } +} + +void picking_setPickingAttribute(vec3 value) { + if (bool(picking.isAttribute)) { + picking_vRGBcolor_Avalid.rgb = value; + } +} +`,fs:`layout(std140) uniform pickingUniforms { + float isActive; + float isAttribute; + float isHighlightActive; + float useByteColors; + vec3 highlightedObjectColor; + vec4 highlightColor; +} picking; + +in vec4 picking_vRGBcolor_Avalid; + +/* + * Returns highlight color if this item is selected. + */ +vec4 picking_filterHighlightColor(vec4 color) { + // If we are still picking, we don't highlight + if (picking.isActive > 0.5) { + return color; + } + + bool selected = bool(picking_vRGBcolor_Avalid.a); + + if (selected) { + // Blend in highlight color based on its alpha value + float highLightAlpha = picking.highlightColor.a; + float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha); + float highLightRatio = highLightAlpha / blendedAlpha; + + vec3 blendedRGB = mix(color.rgb, picking.highlightColor.rgb, highLightRatio); + return vec4(blendedRGB, blendedAlpha); + } else { + return color; + } +} + +/* + * Returns picking color if picking enabled else unmodified argument. + */ +vec4 picking_filterPickingColor(vec4 color) { + if (bool(picking.isActive)) { + if (picking_vRGBcolor_Avalid.a == 0.0) { + discard; + } + return picking_vRGBcolor_Avalid; + } + return color; +} + +/* + * Returns picking color if picking is enabled if not + * highlight color if this item is selected, otherwise unmodified argument. + */ +vec4 picking_filterColor(vec4 color) { + vec4 highlightColor = picking_filterHighlightColor(color); + return picking_filterPickingColor(highlightColor); +} +`,getUniforms:hd};function hd(e={},t){let n={},r=od(e.useByteColors,!0);return e.highlightedObjectColor===void 0||(e.highlightedObjectColor===null?n.isHighlightActive=!1:(n.isHighlightActive=!0,n.highlightedObjectColor=e.highlightedObjectColor.slice(0,3))),e.highlightColor&&(n.highlightColor=cd(e.highlightColor,r)),e.isActive!==void 0&&(n.isActive=!!e.isActive,n.isAttribute=!!e.isAttribute),e.useByteColors!==void 0&&(n.useByteColors=!!e.useByteColors),n}var gd=20,_d={props:{},uniforms:{},name:`skin`,bindingLayout:[{name:`skin`,group:0}],dependencies:[],source:` +struct skinUniforms { + jointMatrix: array, ${gd}>, +}; + +@group(0) @binding(auto) var skin: skinUniforms; + +fn getSkinMatrix(weights: vec4f, joints: vec4u) -> mat4x4 { + return (weights.x * skin.jointMatrix[joints.x]) + + (weights.y * skin.jointMatrix[joints.y]) + + (weights.z * skin.jointMatrix[joints.z]) + + (weights.w * skin.jointMatrix[joints.w]); +} +`,vs:` +layout(std140) uniform skinUniforms { + mat4 jointMatrix[SKIN_MAX_JOINTS]; +} skin; + +mat4 getSkinMatrix(vec4 weights, uvec4 joints) { + return (weights.x * skin.jointMatrix[joints.x]) + + (weights.y * skin.jointMatrix[joints.y]) + + (weights.z * skin.jointMatrix[joints.z]) + + (weights.w * skin.jointMatrix[joints.w]); +} + +`,fs:``,defines:{SKIN_MAX_JOINTS:gd},getUniforms:(e={},t)=>{let{scenegraphsFromGLTF:n}=e;if(!n?.gltf?.skins?.[0])return{jointMatrix:[]};let{inverseBindMatrices:r,joints:i,skeleton:a}=n.gltf.skins[0],o=[],s=r.value.length/16;for(let e=0;e{l[e.id]=t});let u=new Float32Array(gd*16);for(let e=0;e`,gd]}},vd=`precision highp int; + +// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX)) +struct AmbientLight { + vec3 color; +}; + +struct PointLight { + vec3 color; + vec3 position; + vec3 attenuation; // 2nd order x:Constant-y:Linear-z:Exponential +}; + +struct SpotLight { + vec3 color; + vec3 position; + vec3 direction; + vec3 attenuation; + vec2 coneCos; +}; + +struct DirectionalLight { + vec3 color; + vec3 direction; +}; + +struct UniformLight { + vec3 color; + vec3 position; + vec3 direction; + vec3 attenuation; + vec2 coneCos; +}; + +layout(std140) uniform lightingUniforms { + int enabled; + int directionalLightCount; + int pointLightCount; + int spotLightCount; + vec3 ambientColor; + UniformLight lights[5]; +} lighting; + +PointLight lighting_getPointLight(int index) { + UniformLight light = lighting.lights[index]; + return PointLight(light.color, light.position, light.attenuation); +} + +SpotLight lighting_getSpotLight(int index) { + UniformLight light = lighting.lights[lighting.pointLightCount + index]; + return SpotLight(light.color, light.position, light.direction, light.attenuation, light.coneCos); +} + +DirectionalLight lighting_getDirectionalLight(int index) { + UniformLight light = + lighting.lights[lighting.pointLightCount + lighting.spotLightCount + index]; + return DirectionalLight(light.color, light.direction); +} + +float getPointLightAttenuation(PointLight pointLight, float distance) { + return pointLight.attenuation.x + + pointLight.attenuation.y * distance + + pointLight.attenuation.z * distance * distance; +} + +float getSpotLightAttenuation(SpotLight spotLight, vec3 positionWorldspace) { + vec3 light_direction = normalize(positionWorldspace - spotLight.position); + float coneFactor = smoothstep( + spotLight.coneCos.y, + spotLight.coneCos.x, + dot(normalize(spotLight.direction), light_direction) + ); + float distanceAttenuation = getPointLightAttenuation( + PointLight(spotLight.color, spotLight.position, spotLight.attenuation), + distance(spotLight.position, positionWorldspace) + ); + return distanceAttenuation / max(coneFactor, 0.0001); +} + +// #endif +`,yd=`// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX)) +const MAX_LIGHTS: i32 = 5; + +struct AmbientLight { + color: vec3, +}; + +struct PointLight { + color: vec3, + position: vec3, + attenuation: vec3, // 2nd order x:Constant-y:Linear-z:Exponential +}; + +struct SpotLight { + color: vec3, + position: vec3, + direction: vec3, + attenuation: vec3, + coneCos: vec2, +}; + +struct DirectionalLight { + color: vec3, + direction: vec3, +}; + +struct UniformLight { + color: vec3, + position: vec3, + direction: vec3, + attenuation: vec3, + coneCos: vec2, +}; + +struct lightingUniforms { + enabled: i32, + directionalLightCount: i32, + pointLightCount: i32, + spotLightCount: i32, + ambientColor: vec3, + lights: array, +}; + +@group(2) @binding(auto) var lighting : lightingUniforms; + +fn lighting_getPointLight(index: i32) -> PointLight { + let light = lighting.lights[index]; + return PointLight(light.color, light.position, light.attenuation); +} + +fn lighting_getSpotLight(index: i32) -> SpotLight { + let light = lighting.lights[lighting.pointLightCount + index]; + return SpotLight(light.color, light.position, light.direction, light.attenuation, light.coneCos); +} + +fn lighting_getDirectionalLight(index: i32) -> DirectionalLight { + let light = lighting.lights[lighting.pointLightCount + lighting.spotLightCount + index]; + return DirectionalLight(light.color, light.direction); +} + +fn getPointLightAttenuation(pointLight: PointLight, distance: f32) -> f32 { + return pointLight.attenuation.x + + pointLight.attenuation.y * distance + + pointLight.attenuation.z * distance * distance; +} + +fn getSpotLightAttenuation(spotLight: SpotLight, positionWorldspace: vec3) -> f32 { + let lightDirection = normalize(positionWorldspace - spotLight.position); + let coneFactor = smoothstep( + spotLight.coneCos.y, + spotLight.coneCos.x, + dot(normalize(spotLight.direction), lightDirection) + ); + let distanceAttenuation = getPointLightAttenuation( + PointLight(spotLight.color, spotLight.position, spotLight.attenuation), + distance(spotLight.position, positionWorldspace) + ); + return distanceAttenuation / max(coneFactor, 0.0001); +} +`,bd=5,xd={props:{},uniforms:{},name:`lighting`,defines:{},uniformTypes:{enabled:`i32`,directionalLightCount:`i32`,pointLightCount:`i32`,spotLightCount:`i32`,ambientColor:`vec3`,lights:[{color:`vec3`,position:`vec3`,direction:`vec3`,attenuation:`vec3`,coneCos:`vec2`},bd]},defaultUniforms:Ed(),bindingLayout:[{name:`lighting`,group:2}],firstBindingSlot:0,source:yd,vs:vd,fs:vd,getUniforms:Sd};function Sd(e,t={}){if(e&&={...e},!e)return Ed();e.lights&&(e={...e,...wd(e.lights),lights:void 0});let{useByteColors:n,ambientLight:r,pointLights:i,spotLights:a,directionalLights:o}=e||{};if(!(r||i&&i.length>0||a&&a.length>0||o&&o.length>0))return{...Ed(),enabled:0};let s={...Ed(),...Cd({useByteColors:n,ambientLight:r,pointLights:i,spotLights:a,directionalLights:o})};return e.enabled!==void 0&&(s.enabled=+!!e.enabled),s}function Cd({useByteColors:e,ambientLight:t,pointLights:n=[],spotLights:r=[],directionalLights:i=[]}){let a=Dd(),o=0,s=0,c=0,l=0;for(let t of n){if(o>=bd)break;a[o]={...a[o],color:Td(t,e),position:t.position,attenuation:t.attenuation||[1,0,0]},o++,s++}for(let t of r){if(o>=bd)break;a[o]={...a[o],color:Td(t,e),position:t.position,direction:t.direction,attenuation:t.attenuation||[1,0,0],coneCos:kd(t)},o++,c++}for(let t of i){if(o>=bd)break;a[o]={...a[o],color:Td(t,e),direction:t.direction},o++,l++}return n.length+r.length+i.length>bd&&z.warn(`MAX_LIGHTS exceeded, truncating to ${bd}`)(),{ambientColor:Td(t,e),directionalLightCount:l,pointLightCount:s,spotLightCount:c,lights:a}}function wd(e){let t={pointLights:[],spotLights:[],directionalLights:[]};for(let n of e||[])switch(n.type){case`ambient`:t.ambientLight=n;break;case`directional`:t.directionalLights?.push(n);break;case`point`:t.pointLights?.push(n);break;case`spot`:t.spotLights?.push(n);break;default:}return t}function Td(e={},t){let{color:n=[0,0,0],intensity:r=1}=e;return sd(n,od(t,!0)).map(e=>e*r)}function Ed(){return{enabled:1,directionalLightCount:0,pointLightCount:0,spotLightCount:0,ambientColor:[.1,.1,.1],lights:Dd()}}function Dd(){return Array.from({length:bd},()=>Od())}function Od(){return{color:[1,1,1],position:[1,1,2],direction:[1,1,1],attenuation:[1,0,0],coneCos:[1,0]}}function kd(e){let t=e.innerConeAngle??0,n=e.outerConeAngle??Math.PI/4;return[Math.cos(t),Math.cos(n)]}var Ad=`#ifdef USE_IBL +@group(2) @binding(auto) var pbr_diffuseEnvSampler: texture_cube; +@group(2) @binding(auto) var pbr_diffuseEnvSamplerSampler: sampler; +@group(2) @binding(auto) var pbr_specularEnvSampler: texture_cube; +@group(2) @binding(auto) var pbr_specularEnvSamplerSampler: sampler; +@group(2) @binding(auto) var pbr_brdfLUT: texture_2d; +@group(2) @binding(auto) var pbr_brdfLUTSampler: sampler; +#endif +`,jd=`#ifdef USE_IBL +uniform samplerCube pbr_diffuseEnvSampler; +uniform samplerCube pbr_specularEnvSampler; +uniform sampler2D pbr_brdfLUT; +#endif +`,Md={name:`ibl`,firstBindingSlot:32,bindingLayout:[{name:`pbr_diffuseEnvSampler`,group:2},{name:`pbr_specularEnvSampler`,group:2},{name:`pbr_brdfLUT`,group:2}],source:Ad,vs:jd,fs:jd},Nd=`layout(std140) uniform phongMaterialUniforms { + uniform bool unlit; + uniform float ambient; + uniform float diffuse; + uniform float shininess; + uniform vec3 specularColor; +} material; +`,Pd=`layout(std140) uniform phongMaterialUniforms { + uniform bool unlit; + uniform float ambient; + uniform float diffuse; + uniform float shininess; + uniform vec3 specularColor; +} material; + +vec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) { + vec3 halfway_direction = normalize(light_direction + view_direction); + float lambertian = dot(light_direction, normal_worldspace); + float specular = 0.0; + if (lambertian > 0.0) { + float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0); + specular = pow(specular_angle, material.shininess); + } + lambertian = max(lambertian, 0.0); + return (lambertian * material.diffuse * surfaceColor + specular * floatColors_normalize(material.specularColor)) * color; +} + +vec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) { + vec3 lightColor = surfaceColor; + + if (material.unlit) { + return surfaceColor; + } + + if (lighting.enabled == 0) { + return lightColor; + } + + vec3 view_direction = normalize(cameraPosition - position_worldspace); + lightColor = material.ambient * surfaceColor * lighting.ambientColor; + + for (int i = 0; i < lighting.pointLightCount; i++) { + PointLight pointLight = lighting_getPointLight(i); + vec3 light_position_worldspace = pointLight.position; + vec3 light_direction = normalize(light_position_worldspace - position_worldspace); + float light_attenuation = getPointLightAttenuation(pointLight, distance(light_position_worldspace, position_worldspace)); + lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color / light_attenuation); + } + + for (int i = 0; i < lighting.spotLightCount; i++) { + SpotLight spotLight = lighting_getSpotLight(i); + vec3 light_position_worldspace = spotLight.position; + vec3 light_direction = normalize(light_position_worldspace - position_worldspace); + float light_attenuation = getSpotLightAttenuation(spotLight, position_worldspace); + lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, spotLight.color / light_attenuation); + } + + for (int i = 0; i < lighting.directionalLightCount; i++) { + DirectionalLight directionalLight = lighting_getDirectionalLight(i); + lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color); + } + + return lightColor; +} +`,Fd=`struct phongMaterialUniforms { + unlit: u32, + ambient: f32, + diffuse: f32, + shininess: f32, + specularColor: vec3, +}; + +@group(3) @binding(auto) var phongMaterial : phongMaterialUniforms; + +fn lighting_getLightColor(surfaceColor: vec3, light_direction: vec3, view_direction: vec3, normal_worldspace: vec3, color: vec3) -> vec3 { + let halfway_direction: vec3 = normalize(light_direction + view_direction); + var lambertian: f32 = dot(light_direction, normal_worldspace); + var specular: f32 = 0.0; + if (lambertian > 0.0) { + let specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0); + specular = pow(specular_angle, phongMaterial.shininess); + } + lambertian = max(lambertian, 0.0); + return ( + lambertian * phongMaterial.diffuse * surfaceColor + + specular * floatColors_normalize(phongMaterial.specularColor) + ) * color; +} + +fn lighting_getLightColor2(surfaceColor: vec3, cameraPosition: vec3, position_worldspace: vec3, normal_worldspace: vec3) -> vec3 { + var lightColor: vec3 = surfaceColor; + + if (phongMaterial.unlit != 0u) { + return surfaceColor; + } + + if (lighting.enabled == 0) { + return lightColor; + } + + let view_direction: vec3 = normalize(cameraPosition - position_worldspace); + lightColor = phongMaterial.ambient * surfaceColor * lighting.ambientColor; + + for (var i: i32 = 0; i < lighting.pointLightCount; i++) { + let pointLight: PointLight = lighting_getPointLight(i); + let light_position_worldspace: vec3 = pointLight.position; + let light_direction: vec3 = normalize(light_position_worldspace - position_worldspace); + let light_attenuation = getPointLightAttenuation( + pointLight, + distance(light_position_worldspace, position_worldspace) + ); + lightColor += lighting_getLightColor( + surfaceColor, + light_direction, + view_direction, + normal_worldspace, + pointLight.color / light_attenuation + ); + } + + for (var i: i32 = 0; i < lighting.spotLightCount; i++) { + let spotLight: SpotLight = lighting_getSpotLight(i); + let light_position_worldspace: vec3 = spotLight.position; + let light_direction: vec3 = normalize(light_position_worldspace - position_worldspace); + let light_attenuation = getSpotLightAttenuation(spotLight, position_worldspace); + lightColor += lighting_getLightColor( + surfaceColor, + light_direction, + view_direction, + normal_worldspace, + spotLight.color / light_attenuation + ); + } + + for (var i: i32 = 0; i < lighting.directionalLightCount; i++) { + let directionalLight: DirectionalLight = lighting_getDirectionalLight(i); + lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color); + } + + return lightColor; +} + +fn lighting_getSpecularLightColor(cameraPosition: vec3, position_worldspace: vec3, normal_worldspace: vec3) -> vec3{ + var lightColor = vec3(0, 0, 0); + let surfaceColor = vec3(0, 0, 0); + + if (lighting.enabled != 0) { + let view_direction = normalize(cameraPosition - position_worldspace); + + for (var i: i32 = 0; i < lighting.pointLightCount; i++) { + let pointLight: PointLight = lighting_getPointLight(i); + let light_position_worldspace: vec3 = pointLight.position; + let light_direction: vec3 = normalize(light_position_worldspace - position_worldspace); + let light_attenuation = getPointLightAttenuation( + pointLight, + distance(light_position_worldspace, position_worldspace) + ); + lightColor += lighting_getLightColor( + surfaceColor, + light_direction, + view_direction, + normal_worldspace, + pointLight.color / light_attenuation + ); + } + + for (var i: i32 = 0; i < lighting.spotLightCount; i++) { + let spotLight: SpotLight = lighting_getSpotLight(i); + let light_position_worldspace: vec3 = spotLight.position; + let light_direction: vec3 = normalize(light_position_worldspace - position_worldspace); + let light_attenuation = getSpotLightAttenuation(spotLight, position_worldspace); + lightColor += lighting_getLightColor( + surfaceColor, + light_direction, + view_direction, + normal_worldspace, + spotLight.color / light_attenuation + ); + } + + for (var i: i32 = 0; i < lighting.directionalLightCount; i++) { + let directionalLight: DirectionalLight = lighting_getDirectionalLight(i); + lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color); + } + } + return lightColor; +} +`,Id={props:{},name:`gouraudMaterial`,bindingLayout:[{name:`gouraudMaterial`,group:3}],vs:Pd.replace(`phongMaterial`,`gouraudMaterial`),fs:Nd.replace(`phongMaterial`,`gouraudMaterial`),source:Fd.replaceAll(`phongMaterial`,`gouraudMaterial`),defines:{LIGHTING_VERTEX:!0},dependencies:[xd,pd],uniformTypes:{unlit:`i32`,ambient:`f32`,diffuse:`f32`,shininess:`f32`,specularColor:`vec3`},defaultUniforms:{unlit:!1,ambient:.35,diffuse:.6,shininess:32,specularColor:[38.25,38.25,38.25]},getUniforms(e){return{...Id.defaultUniforms,...e}}},Ld={name:`phongMaterial`,firstBindingSlot:0,bindingLayout:[{name:`phongMaterial`,group:3}],dependencies:[xd,pd],source:Fd,vs:Nd,fs:Pd,defines:{LIGHTING_FRAGMENT:!0},uniformTypes:{unlit:`i32`,ambient:`f32`,diffuse:`f32`,shininess:`f32`,specularColor:`vec3`},defaultUniforms:{unlit:!1,ambient:.35,diffuse:.6,shininess:32,specularColor:[38.25,38.25,38.25]},getUniforms(e){return{...Ld.defaultUniforms,...e}}},Rd=`out vec3 pbr_vPosition; +out vec2 pbr_vUV0; +out vec2 pbr_vUV1; + +#ifdef HAS_NORMALS +# ifdef HAS_TANGENTS +out mat3 pbr_vTBN; +# else +out vec3 pbr_vNormal; +# endif +#endif + +void pbr_setPositionNormalTangentUV( + vec4 position, + vec4 normal, + vec4 tangent, + vec2 uv0, + vec2 uv1 +) +{ + vec4 pos = pbrProjection.modelMatrix * position; + pbr_vPosition = vec3(pos.xyz) / pos.w; + +#ifdef HAS_NORMALS +#ifdef HAS_TANGENTS + vec3 normalW = normalize(vec3(pbrProjection.normalMatrix * vec4(normal.xyz, 0.0))); + vec3 tangentW = normalize(vec3(pbrProjection.modelMatrix * vec4(tangent.xyz, 0.0))); + vec3 bitangentW = cross(normalW, tangentW) * tangent.w; + pbr_vTBN = mat3(tangentW, bitangentW, normalW); +#else // HAS_TANGENTS != 1 + pbr_vNormal = normalize(vec3(pbrProjection.modelMatrix * vec4(normal.xyz, 0.0))); +#endif +#endif + +#ifdef HAS_UV + pbr_vUV0 = uv0; +#else + pbr_vUV0 = vec2(0.,0.); +#endif + + pbr_vUV1 = uv1; +} +`,zd=`precision highp float; + +layout(std140) uniform pbrMaterialUniforms { + // Material is unlit + bool unlit; + + // Base color map + bool baseColorMapEnabled; + vec4 baseColorFactor; + + bool normalMapEnabled; + float normalScale; // #ifdef HAS_NORMALMAP + + bool emissiveMapEnabled; + vec3 emissiveFactor; // #ifdef HAS_EMISSIVEMAP + + vec2 metallicRoughnessValues; + bool metallicRoughnessMapEnabled; + + bool occlusionMapEnabled; + float occlusionStrength; // #ifdef HAS_OCCLUSIONMAP + + bool alphaCutoffEnabled; + float alphaCutoff; // #ifdef ALPHA_CUTOFF + + vec3 specularColorFactor; + float specularIntensityFactor; + bool specularColorMapEnabled; + bool specularIntensityMapEnabled; + + float ior; + + float transmissionFactor; + bool transmissionMapEnabled; + + float thicknessFactor; + float attenuationDistance; + vec3 attenuationColor; + + float clearcoatFactor; + float clearcoatRoughnessFactor; + bool clearcoatMapEnabled; + bool clearcoatRoughnessMapEnabled; + + vec3 sheenColorFactor; + float sheenRoughnessFactor; + bool sheenColorMapEnabled; + bool sheenRoughnessMapEnabled; + + float iridescenceFactor; + float iridescenceIor; + vec2 iridescenceThicknessRange; + bool iridescenceMapEnabled; + + float anisotropyStrength; + float anisotropyRotation; + vec2 anisotropyDirection; + bool anisotropyMapEnabled; + + float emissiveStrength; + + // IBL + bool IBLenabled; + vec2 scaleIBLAmbient; // #ifdef USE_IBL + + // debugging flags used for shader output of intermediate PBR variables + // #ifdef PBR_DEBUG + vec4 scaleDiffBaseMR; + vec4 scaleFGDSpec; + // #endif + + int baseColorUVSet; + mat3 baseColorUVTransform; + int metallicRoughnessUVSet; + mat3 metallicRoughnessUVTransform; + int normalUVSet; + mat3 normalUVTransform; + int occlusionUVSet; + mat3 occlusionUVTransform; + int emissiveUVSet; + mat3 emissiveUVTransform; + int specularColorUVSet; + mat3 specularColorUVTransform; + int specularIntensityUVSet; + mat3 specularIntensityUVTransform; + int transmissionUVSet; + mat3 transmissionUVTransform; + int thicknessUVSet; + mat3 thicknessUVTransform; + int clearcoatUVSet; + mat3 clearcoatUVTransform; + int clearcoatRoughnessUVSet; + mat3 clearcoatRoughnessUVTransform; + int clearcoatNormalUVSet; + mat3 clearcoatNormalUVTransform; + int sheenColorUVSet; + mat3 sheenColorUVTransform; + int sheenRoughnessUVSet; + mat3 sheenRoughnessUVTransform; + int iridescenceUVSet; + mat3 iridescenceUVTransform; + int iridescenceThicknessUVSet; + mat3 iridescenceThicknessUVTransform; + int anisotropyUVSet; + mat3 anisotropyUVTransform; +} pbrMaterial; + +// Samplers +#ifdef HAS_BASECOLORMAP +uniform sampler2D pbr_baseColorSampler; +#endif +#ifdef HAS_NORMALMAP +uniform sampler2D pbr_normalSampler; +#endif +#ifdef HAS_EMISSIVEMAP +uniform sampler2D pbr_emissiveSampler; +#endif +#ifdef HAS_METALROUGHNESSMAP +uniform sampler2D pbr_metallicRoughnessSampler; +#endif +#ifdef HAS_OCCLUSIONMAP +uniform sampler2D pbr_occlusionSampler; +#endif +#ifdef HAS_SPECULARCOLORMAP +uniform sampler2D pbr_specularColorSampler; +#endif +#ifdef HAS_SPECULARINTENSITYMAP +uniform sampler2D pbr_specularIntensitySampler; +#endif +#ifdef HAS_TRANSMISSIONMAP +uniform sampler2D pbr_transmissionSampler; +#endif +#ifdef HAS_THICKNESSMAP +uniform sampler2D pbr_thicknessSampler; +#endif +#ifdef HAS_CLEARCOATMAP +uniform sampler2D pbr_clearcoatSampler; +#endif +#ifdef HAS_CLEARCOATROUGHNESSMAP +uniform sampler2D pbr_clearcoatRoughnessSampler; +#endif +#ifdef HAS_CLEARCOATNORMALMAP +uniform sampler2D pbr_clearcoatNormalSampler; +#endif +#ifdef HAS_SHEENCOLORMAP +uniform sampler2D pbr_sheenColorSampler; +#endif +#ifdef HAS_SHEENROUGHNESSMAP +uniform sampler2D pbr_sheenRoughnessSampler; +#endif +#ifdef HAS_IRIDESCENCEMAP +uniform sampler2D pbr_iridescenceSampler; +#endif +#ifdef HAS_IRIDESCENCETHICKNESSMAP +uniform sampler2D pbr_iridescenceThicknessSampler; +#endif +#ifdef HAS_ANISOTROPYMAP +uniform sampler2D pbr_anisotropySampler; +#endif +// Inputs from vertex shader + +in vec3 pbr_vPosition; +in vec2 pbr_vUV0; +in vec2 pbr_vUV1; + +#ifdef HAS_NORMALS +#ifdef HAS_TANGENTS +in mat3 pbr_vTBN; +#else +in vec3 pbr_vNormal; +#endif +#endif + +// Encapsulate the various inputs used by the various functions in the shading equation +// We store values in this struct to simplify the integration of alternative implementations +// of the shading terms, outlined in the Readme.MD Appendix. +struct PBRInfo { + float NdotL; // cos angle between normal and light direction + float NdotV; // cos angle between normal and view direction + float NdotH; // cos angle between normal and half vector + float LdotH; // cos angle between light direction and half vector + float VdotH; // cos angle between view direction and half vector + float perceptualRoughness; // roughness value, as authored by the model creator (input to shader) + float metalness; // metallic value at the surface + vec3 reflectance0; // full reflectance color (normal incidence angle) + vec3 reflectance90; // reflectance color at grazing angle + float alphaRoughness; // roughness mapped to a more linear change in the roughness (proposed by [2]) + vec3 diffuseColor; // color contribution from diffuse lighting + vec3 specularColor; // color contribution from specular lighting + vec3 n; // normal at surface point + vec3 v; // vector from surface point to camera +}; + +const float M_PI = 3.141592653589793; +const float c_MinRoughness = 0.04; + +vec3 calculateFinalColor(PBRInfo pbrInfo, vec3 lightColor); + +vec4 SRGBtoLINEAR(vec4 srgbIn) +{ +#ifdef MANUAL_SRGB +#ifdef SRGB_FAST_APPROXIMATION + vec3 linOut = pow(srgbIn.xyz,vec3(2.2)); +#else // SRGB_FAST_APPROXIMATION + vec3 bLess = step(vec3(0.04045),srgbIn.xyz); + vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess ); +#endif //SRGB_FAST_APPROXIMATION + return vec4(linOut,srgbIn.w);; +#else //MANUAL_SRGB + return srgbIn; +#endif //MANUAL_SRGB +} + +vec2 getMaterialUV(int uvSet, mat3 uvTransform) +{ + vec2 baseUV = uvSet == 1 ? pbr_vUV1 : pbr_vUV0; + return (uvTransform * vec3(baseUV, 1.0)).xy; +} + +// Build the tangent basis from interpolated attributes or screen-space derivatives. +mat3 getTBN(vec2 uv) +{ +#ifndef HAS_TANGENTS + vec3 pos_dx = dFdx(pbr_vPosition); + vec3 pos_dy = dFdy(pbr_vPosition); + vec3 tex_dx = dFdx(vec3(uv, 0.0)); + vec3 tex_dy = dFdy(vec3(uv, 0.0)); + vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t); + +#ifdef HAS_NORMALS + vec3 ng = normalize(pbr_vNormal); +#else + vec3 ng = cross(pos_dx, pos_dy); +#endif + + t = normalize(t - ng * dot(ng, t)); + vec3 b = normalize(cross(ng, t)); + mat3 tbn = mat3(t, b, ng); +#else // HAS_TANGENTS + mat3 tbn = pbr_vTBN; +#endif + + return tbn; +} + +// Find the normal for this fragment, pulling either from a predefined normal map +// or from the interpolated mesh normal and tangent attributes. +vec3 getMappedNormal(sampler2D normalSampler, mat3 tbn, float normalScale, vec2 uv) +{ + vec3 n = texture(normalSampler, uv).rgb; + return normalize(tbn * ((2.0 * n - 1.0) * vec3(normalScale, normalScale, 1.0))); +} + +vec3 getNormal(mat3 tbn, vec2 uv) +{ +#ifdef HAS_NORMALMAP + vec3 n = getMappedNormal(pbr_normalSampler, tbn, pbrMaterial.normalScale, uv); +#else + // The tbn matrix is linearly interpolated, so we need to re-normalize + vec3 n = normalize(tbn[2].xyz); +#endif + + return n; +} + +vec3 getClearcoatNormal(mat3 tbn, vec3 baseNormal, vec2 uv) +{ +#ifdef HAS_CLEARCOATNORMALMAP + return getMappedNormal(pbr_clearcoatNormalSampler, tbn, 1.0, uv); +#else + return baseNormal; +#endif +} + +// Calculation of the lighting contribution from an optional Image Based Light source. +// Precomputed Environment Maps are required uniform inputs and are computed as outlined in [1]. +// See our README.md on Environment Maps [3] for additional discussion. +#ifdef USE_IBL +vec3 getIBLContribution(PBRInfo pbrInfo, vec3 n, vec3 reflection) +{ + float mipCount = 9.0; // resolution of 512x512 + float lod = (pbrInfo.perceptualRoughness * mipCount); + // retrieve a scale and bias to F0. See [1], Figure 3 + vec3 brdf = SRGBtoLINEAR(texture(pbr_brdfLUT, + vec2(pbrInfo.NdotV, 1.0 - pbrInfo.perceptualRoughness))).rgb; + vec3 diffuseLight = SRGBtoLINEAR(texture(pbr_diffuseEnvSampler, n)).rgb; + +#ifdef USE_TEX_LOD + vec3 specularLight = SRGBtoLINEAR(texture(pbr_specularEnvSampler, reflection, lod)).rgb; +#else + vec3 specularLight = SRGBtoLINEAR(texture(pbr_specularEnvSampler, reflection)).rgb; +#endif + + vec3 diffuse = diffuseLight * pbrInfo.diffuseColor; + vec3 specular = specularLight * (pbrInfo.specularColor * brdf.x + brdf.y); + + // For presentation, this allows us to disable IBL terms + diffuse *= pbrMaterial.scaleIBLAmbient.x; + specular *= pbrMaterial.scaleIBLAmbient.y; + + return diffuse + specular; +} +#endif + +// Basic Lambertian diffuse +// Implementation from Lambert's Photometria https://archive.org/details/lambertsphotome00lambgoog +// See also [1], Equation 1 +vec3 diffuse(PBRInfo pbrInfo) +{ + return pbrInfo.diffuseColor / M_PI; +} + +// The following equation models the Fresnel reflectance term of the spec equation (aka F()) +// Implementation of fresnel from [4], Equation 15 +vec3 specularReflection(PBRInfo pbrInfo) +{ + return pbrInfo.reflectance0 + + (pbrInfo.reflectance90 - pbrInfo.reflectance0) * + pow(clamp(1.0 - pbrInfo.VdotH, 0.0, 1.0), 5.0); +} + +// This calculates the specular geometric attenuation (aka G()), +// where rougher material will reflect less light back to the viewer. +// This implementation is based on [1] Equation 4, and we adopt their modifications to +// alphaRoughness as input as originally proposed in [2]. +float geometricOcclusion(PBRInfo pbrInfo) +{ + float NdotL = pbrInfo.NdotL; + float NdotV = pbrInfo.NdotV; + float r = pbrInfo.alphaRoughness; + + float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL))); + float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV))); + return attenuationL * attenuationV; +} + +// The following equation(s) model the distribution of microfacet normals across +// the area being drawn (aka D()) +// Implementation from "Average Irregularity Representation of a Roughened Surface +// for Ray Reflection" by T. S. Trowbridge, and K. P. Reitz +// Follows the distribution function recommended in the SIGGRAPH 2013 course notes +// from EPIC Games [1], Equation 3. +float microfacetDistribution(PBRInfo pbrInfo) +{ + float roughnessSq = pbrInfo.alphaRoughness * pbrInfo.alphaRoughness; + float f = (pbrInfo.NdotH * roughnessSq - pbrInfo.NdotH) * pbrInfo.NdotH + 1.0; + return roughnessSq / (M_PI * f * f); +} + +float maxComponent(vec3 value) +{ + return max(max(value.r, value.g), value.b); +} + +float getDielectricF0(float ior) +{ + float clampedIor = max(ior, 1.0); + float ratio = (clampedIor - 1.0) / (clampedIor + 1.0); + return ratio * ratio; +} + +vec2 normalizeDirection(vec2 direction) +{ + float directionLength = length(direction); + return directionLength > 0.0001 ? direction / directionLength : vec2(1.0, 0.0); +} + +vec2 rotateDirection(vec2 direction, float rotation) +{ + float s = sin(rotation); + float c = cos(rotation); + return vec2(direction.x * c - direction.y * s, direction.x * s + direction.y * c); +} + +vec3 getIridescenceTint(float iridescence, float thickness, float NdotV) +{ + if (iridescence <= 0.0) { + return vec3(1.0); + } + + float phase = 0.015 * thickness * pbrMaterial.iridescenceIor + (1.0 - NdotV) * 6.0; + vec3 thinFilmTint = + 0.5 + 0.5 * cos(vec3(phase, phase + 2.0943951, phase + 4.1887902)); + return mix(vec3(1.0), thinFilmTint, iridescence); +} + +vec3 getVolumeAttenuation(float thickness) +{ + if (thickness <= 0.0) { + return vec3(1.0); + } + + vec3 attenuationCoefficient = + -log(max(pbrMaterial.attenuationColor, vec3(0.0001))) / + max(pbrMaterial.attenuationDistance, 0.0001); + return exp(-attenuationCoefficient * thickness); +} + +PBRInfo createClearcoatPBRInfo(PBRInfo basePBRInfo, vec3 clearcoatNormal, float clearcoatRoughness) +{ + float perceptualRoughness = clamp(clearcoatRoughness, c_MinRoughness, 1.0); + float alphaRoughness = perceptualRoughness * perceptualRoughness; + float NdotV = clamp(abs(dot(clearcoatNormal, basePBRInfo.v)), 0.001, 1.0); + + return PBRInfo( + basePBRInfo.NdotL, + NdotV, + basePBRInfo.NdotH, + basePBRInfo.LdotH, + basePBRInfo.VdotH, + perceptualRoughness, + 0.0, + vec3(0.04), + vec3(1.0), + alphaRoughness, + vec3(0.0), + vec3(0.04), + clearcoatNormal, + basePBRInfo.v + ); +} + +vec3 calculateClearcoatContribution( + PBRInfo pbrInfo, + vec3 lightColor, + vec3 clearcoatNormal, + float clearcoatFactor, + float clearcoatRoughness +) { + if (clearcoatFactor <= 0.0) { + return vec3(0.0); + } + + PBRInfo clearcoatPBRInfo = createClearcoatPBRInfo(pbrInfo, clearcoatNormal, clearcoatRoughness); + return calculateFinalColor(clearcoatPBRInfo, lightColor) * clearcoatFactor; +} + +#ifdef USE_IBL +vec3 calculateClearcoatIBLContribution( + PBRInfo pbrInfo, + vec3 clearcoatNormal, + vec3 reflection, + float clearcoatFactor, + float clearcoatRoughness +) { + if (clearcoatFactor <= 0.0) { + return vec3(0.0); + } + + PBRInfo clearcoatPBRInfo = createClearcoatPBRInfo(pbrInfo, clearcoatNormal, clearcoatRoughness); + return getIBLContribution(clearcoatPBRInfo, clearcoatNormal, reflection) * clearcoatFactor; +} +#endif + +vec3 calculateSheenContribution( + PBRInfo pbrInfo, + vec3 lightColor, + vec3 sheenColor, + float sheenRoughness +) { + if (maxComponent(sheenColor) <= 0.0) { + return vec3(0.0); + } + + float sheenFresnel = pow(clamp(1.0 - pbrInfo.VdotH, 0.0, 1.0), 5.0); + float sheenVisibility = mix(1.0, pbrInfo.NdotL * pbrInfo.NdotV, sheenRoughness); + return pbrInfo.NdotL * + lightColor * + sheenColor * + (0.25 + 0.75 * sheenFresnel) * + sheenVisibility * + (1.0 - pbrInfo.metalness); +} + +float calculateAnisotropyBoost( + PBRInfo pbrInfo, + vec3 anisotropyTangent, + float anisotropyStrength +) { + if (anisotropyStrength <= 0.0) { + return 1.0; + } + + vec3 anisotropyBitangent = normalize(cross(pbrInfo.n, anisotropyTangent)); + float bitangentViewAlignment = abs(dot(pbrInfo.v, anisotropyBitangent)); + return mix(1.0, 0.65 + 0.7 * bitangentViewAlignment, anisotropyStrength); +} + +vec3 calculateMaterialLightColor( + PBRInfo pbrInfo, + vec3 lightColor, + vec3 clearcoatNormal, + float clearcoatFactor, + float clearcoatRoughness, + vec3 sheenColor, + float sheenRoughness, + vec3 anisotropyTangent, + float anisotropyStrength +) { + float anisotropyBoost = calculateAnisotropyBoost(pbrInfo, anisotropyTangent, anisotropyStrength); + vec3 color = calculateFinalColor(pbrInfo, lightColor) * anisotropyBoost; + color += calculateClearcoatContribution( + pbrInfo, + lightColor, + clearcoatNormal, + clearcoatFactor, + clearcoatRoughness + ); + color += calculateSheenContribution(pbrInfo, lightColor, sheenColor, sheenRoughness); + return color; +} + +void PBRInfo_setAmbientLight(inout PBRInfo pbrInfo) { + pbrInfo.NdotL = 1.0; + pbrInfo.NdotH = 0.0; + pbrInfo.LdotH = 0.0; + pbrInfo.VdotH = 1.0; +} + +void PBRInfo_setDirectionalLight(inout PBRInfo pbrInfo, vec3 lightDirection) { + vec3 n = pbrInfo.n; + vec3 v = pbrInfo.v; + vec3 l = normalize(lightDirection); // Vector from surface point to light + vec3 h = normalize(l+v); // Half vector between both l and v + + pbrInfo.NdotL = clamp(dot(n, l), 0.001, 1.0); + pbrInfo.NdotH = clamp(dot(n, h), 0.0, 1.0); + pbrInfo.LdotH = clamp(dot(l, h), 0.0, 1.0); + pbrInfo.VdotH = clamp(dot(v, h), 0.0, 1.0); +} + +void PBRInfo_setPointLight(inout PBRInfo pbrInfo, PointLight pointLight) { + vec3 light_direction = normalize(pointLight.position - pbr_vPosition); + PBRInfo_setDirectionalLight(pbrInfo, light_direction); +} + +void PBRInfo_setSpotLight(inout PBRInfo pbrInfo, SpotLight spotLight) { + vec3 light_direction = normalize(spotLight.position - pbr_vPosition); + PBRInfo_setDirectionalLight(pbrInfo, light_direction); +} + +vec3 calculateFinalColor(PBRInfo pbrInfo, vec3 lightColor) { + // Calculate the shading terms for the microfacet specular shading model + vec3 F = specularReflection(pbrInfo); + float G = geometricOcclusion(pbrInfo); + float D = microfacetDistribution(pbrInfo); + + // Calculation of analytical lighting contribution + vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInfo); + vec3 specContrib = F * G * D / (4.0 * pbrInfo.NdotL * pbrInfo.NdotV); + // Obtain final intensity as reflectance (BRDF) scaled by the energy of the light (cosine law) + return pbrInfo.NdotL * lightColor * (diffuseContrib + specContrib); +} + +vec4 pbr_filterColor(vec4 colorUnused) +{ + vec2 baseColorUV = getMaterialUV(pbrMaterial.baseColorUVSet, pbrMaterial.baseColorUVTransform); + vec2 metallicRoughnessUV = getMaterialUV( + pbrMaterial.metallicRoughnessUVSet, + pbrMaterial.metallicRoughnessUVTransform + ); + vec2 normalUV = getMaterialUV(pbrMaterial.normalUVSet, pbrMaterial.normalUVTransform); + vec2 occlusionUV = getMaterialUV(pbrMaterial.occlusionUVSet, pbrMaterial.occlusionUVTransform); + vec2 emissiveUV = getMaterialUV(pbrMaterial.emissiveUVSet, pbrMaterial.emissiveUVTransform); + vec2 specularColorUV = getMaterialUV( + pbrMaterial.specularColorUVSet, + pbrMaterial.specularColorUVTransform + ); + vec2 specularIntensityUV = getMaterialUV( + pbrMaterial.specularIntensityUVSet, + pbrMaterial.specularIntensityUVTransform + ); + vec2 transmissionUV = getMaterialUV( + pbrMaterial.transmissionUVSet, + pbrMaterial.transmissionUVTransform + ); + vec2 thicknessUV = getMaterialUV(pbrMaterial.thicknessUVSet, pbrMaterial.thicknessUVTransform); + vec2 clearcoatUV = getMaterialUV(pbrMaterial.clearcoatUVSet, pbrMaterial.clearcoatUVTransform); + vec2 clearcoatRoughnessUV = getMaterialUV( + pbrMaterial.clearcoatRoughnessUVSet, + pbrMaterial.clearcoatRoughnessUVTransform + ); + vec2 clearcoatNormalUV = getMaterialUV( + pbrMaterial.clearcoatNormalUVSet, + pbrMaterial.clearcoatNormalUVTransform + ); + vec2 sheenColorUV = getMaterialUV( + pbrMaterial.sheenColorUVSet, + pbrMaterial.sheenColorUVTransform + ); + vec2 sheenRoughnessUV = getMaterialUV( + pbrMaterial.sheenRoughnessUVSet, + pbrMaterial.sheenRoughnessUVTransform + ); + vec2 iridescenceUV = getMaterialUV( + pbrMaterial.iridescenceUVSet, + pbrMaterial.iridescenceUVTransform + ); + vec2 iridescenceThicknessUV = getMaterialUV( + pbrMaterial.iridescenceThicknessUVSet, + pbrMaterial.iridescenceThicknessUVTransform + ); + vec2 anisotropyUV = getMaterialUV( + pbrMaterial.anisotropyUVSet, + pbrMaterial.anisotropyUVTransform + ); + + // The albedo may be defined from a base texture or a flat color +#ifdef HAS_BASECOLORMAP + vec4 baseColor = + SRGBtoLINEAR(texture(pbr_baseColorSampler, baseColorUV)) * pbrMaterial.baseColorFactor; +#else + vec4 baseColor = pbrMaterial.baseColorFactor; +#endif + +#ifdef ALPHA_CUTOFF + if (baseColor.a < pbrMaterial.alphaCutoff) { + discard; + } +#endif + + vec3 color = vec3(0, 0, 0); + + float transmission = 0.0; + + if(pbrMaterial.unlit){ + color.rgb = baseColor.rgb; + } + else{ + // Metallic and Roughness material properties are packed together + // In glTF, these factors can be specified by fixed scalar values + // or from a metallic-roughness map + float perceptualRoughness = pbrMaterial.metallicRoughnessValues.y; + float metallic = pbrMaterial.metallicRoughnessValues.x; +#ifdef HAS_METALROUGHNESSMAP + // Roughness is stored in the 'g' channel, metallic is stored in the 'b' channel. + // This layout intentionally reserves the 'r' channel for (optional) occlusion map data + vec4 mrSample = texture(pbr_metallicRoughnessSampler, metallicRoughnessUV); + perceptualRoughness = mrSample.g * perceptualRoughness; + metallic = mrSample.b * metallic; +#endif + perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0); + metallic = clamp(metallic, 0.0, 1.0); + mat3 tbn = getTBN(normalUV); + vec3 n = getNormal(tbn, normalUV); // normal at surface point + vec3 v = normalize(pbrProjection.camera - pbr_vPosition); // Vector from surface point to camera + float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0); +#ifdef USE_MATERIAL_EXTENSIONS + bool useExtendedPBR = + pbrMaterial.specularColorMapEnabled || + pbrMaterial.specularIntensityMapEnabled || + abs(pbrMaterial.specularIntensityFactor - 1.0) > 0.0001 || + maxComponent(abs(pbrMaterial.specularColorFactor - vec3(1.0))) > 0.0001 || + abs(pbrMaterial.ior - 1.5) > 0.0001 || + pbrMaterial.transmissionMapEnabled || + pbrMaterial.transmissionFactor > 0.0001 || + pbrMaterial.clearcoatMapEnabled || + pbrMaterial.clearcoatRoughnessMapEnabled || + pbrMaterial.clearcoatFactor > 0.0001 || + pbrMaterial.clearcoatRoughnessFactor > 0.0001 || + pbrMaterial.sheenColorMapEnabled || + pbrMaterial.sheenRoughnessMapEnabled || + maxComponent(pbrMaterial.sheenColorFactor) > 0.0001 || + pbrMaterial.sheenRoughnessFactor > 0.0001 || + pbrMaterial.iridescenceMapEnabled || + pbrMaterial.iridescenceFactor > 0.0001 || + abs(pbrMaterial.iridescenceIor - 1.3) > 0.0001 || + abs(pbrMaterial.iridescenceThicknessRange.x - 100.0) > 0.0001 || + abs(pbrMaterial.iridescenceThicknessRange.y - 400.0) > 0.0001 || + pbrMaterial.anisotropyMapEnabled || + pbrMaterial.anisotropyStrength > 0.0001 || + abs(pbrMaterial.anisotropyRotation) > 0.0001 || + length(pbrMaterial.anisotropyDirection - vec2(1.0, 0.0)) > 0.0001; +#else + bool useExtendedPBR = false; +#endif + + if (!useExtendedPBR) { + // Keep the baseline metallic-roughness implementation byte-for-byte equivalent in behavior. + float alphaRoughness = perceptualRoughness * perceptualRoughness; + + vec3 f0 = vec3(0.04); + vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0); + diffuseColor *= 1.0 - metallic; + vec3 specularColor = mix(f0, baseColor.rgb, metallic); + + float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b); + float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0); + vec3 specularEnvironmentR0 = specularColor.rgb; + vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90; + vec3 reflection = -normalize(reflect(v, n)); + + PBRInfo pbrInfo = PBRInfo( + 0.0, // NdotL + NdotV, + 0.0, // NdotH + 0.0, // LdotH + 0.0, // VdotH + perceptualRoughness, + metallic, + specularEnvironmentR0, + specularEnvironmentR90, + alphaRoughness, + diffuseColor, + specularColor, + n, + v + ); + +#ifdef USE_LIGHTS + PBRInfo_setAmbientLight(pbrInfo); + color += calculateFinalColor(pbrInfo, lighting.ambientColor); + + for(int i = 0; i < lighting.directionalLightCount; i++) { + if (i < lighting.directionalLightCount) { + PBRInfo_setDirectionalLight(pbrInfo, lighting_getDirectionalLight(i).direction); + color += calculateFinalColor(pbrInfo, lighting_getDirectionalLight(i).color); + } + } + + for(int i = 0; i < lighting.pointLightCount; i++) { + if (i < lighting.pointLightCount) { + PBRInfo_setPointLight(pbrInfo, lighting_getPointLight(i)); + float attenuation = getPointLightAttenuation(lighting_getPointLight(i), distance(lighting_getPointLight(i).position, pbr_vPosition)); + color += calculateFinalColor(pbrInfo, lighting_getPointLight(i).color / attenuation); + } + } + + for(int i = 0; i < lighting.spotLightCount; i++) { + if (i < lighting.spotLightCount) { + PBRInfo_setSpotLight(pbrInfo, lighting_getSpotLight(i)); + float attenuation = getSpotLightAttenuation(lighting_getSpotLight(i), pbr_vPosition); + color += calculateFinalColor(pbrInfo, lighting_getSpotLight(i).color / attenuation); + } + } +#endif + +#ifdef USE_IBL + if (pbrMaterial.IBLenabled) { + color += getIBLContribution(pbrInfo, n, reflection); + } +#endif + +#ifdef HAS_OCCLUSIONMAP + if (pbrMaterial.occlusionMapEnabled) { + float ao = texture(pbr_occlusionSampler, occlusionUV).r; + color = mix(color, color * ao, pbrMaterial.occlusionStrength); + } +#endif + + vec3 emissive = pbrMaterial.emissiveFactor; +#ifdef HAS_EMISSIVEMAP + if (pbrMaterial.emissiveMapEnabled) { + emissive *= SRGBtoLINEAR(texture(pbr_emissiveSampler, emissiveUV)).rgb; + } +#endif + color += emissive * pbrMaterial.emissiveStrength; + +#ifdef PBR_DEBUG + color = mix(color, baseColor.rgb, pbrMaterial.scaleDiffBaseMR.y); + color = mix(color, vec3(metallic), pbrMaterial.scaleDiffBaseMR.z); + color = mix(color, vec3(perceptualRoughness), pbrMaterial.scaleDiffBaseMR.w); +#endif + + return vec4(pow(color, vec3(1.0 / 2.2)), baseColor.a); + } + + float specularIntensity = pbrMaterial.specularIntensityFactor; +#ifdef HAS_SPECULARINTENSITYMAP + if (pbrMaterial.specularIntensityMapEnabled) { + specularIntensity *= texture(pbr_specularIntensitySampler, specularIntensityUV).a; + } +#endif + + vec3 specularFactor = pbrMaterial.specularColorFactor; +#ifdef HAS_SPECULARCOLORMAP + if (pbrMaterial.specularColorMapEnabled) { + specularFactor *= SRGBtoLINEAR(texture(pbr_specularColorSampler, specularColorUV)).rgb; + } +#endif + + transmission = pbrMaterial.transmissionFactor; +#ifdef HAS_TRANSMISSIONMAP + if (pbrMaterial.transmissionMapEnabled) { + transmission *= texture(pbr_transmissionSampler, transmissionUV).r; + } +#endif + transmission = clamp(transmission * (1.0 - metallic), 0.0, 1.0); + float thickness = max(pbrMaterial.thicknessFactor, 0.0); +#ifdef HAS_THICKNESSMAP + thickness *= texture(pbr_thicknessSampler, thicknessUV).g; +#endif + + float clearcoatFactor = pbrMaterial.clearcoatFactor; + float clearcoatRoughness = pbrMaterial.clearcoatRoughnessFactor; +#ifdef HAS_CLEARCOATMAP + if (pbrMaterial.clearcoatMapEnabled) { + clearcoatFactor *= texture(pbr_clearcoatSampler, clearcoatUV).r; + } +#endif +#ifdef HAS_CLEARCOATROUGHNESSMAP + if (pbrMaterial.clearcoatRoughnessMapEnabled) { + clearcoatRoughness *= texture(pbr_clearcoatRoughnessSampler, clearcoatRoughnessUV).g; + } +#endif + clearcoatFactor = clamp(clearcoatFactor, 0.0, 1.0); + clearcoatRoughness = clamp(clearcoatRoughness, c_MinRoughness, 1.0); + vec3 clearcoatNormal = getClearcoatNormal(getTBN(clearcoatNormalUV), n, clearcoatNormalUV); + + vec3 sheenColor = pbrMaterial.sheenColorFactor; + float sheenRoughness = pbrMaterial.sheenRoughnessFactor; +#ifdef HAS_SHEENCOLORMAP + if (pbrMaterial.sheenColorMapEnabled) { + sheenColor *= SRGBtoLINEAR(texture(pbr_sheenColorSampler, sheenColorUV)).rgb; + } +#endif +#ifdef HAS_SHEENROUGHNESSMAP + if (pbrMaterial.sheenRoughnessMapEnabled) { + sheenRoughness *= texture(pbr_sheenRoughnessSampler, sheenRoughnessUV).a; + } +#endif + sheenRoughness = clamp(sheenRoughness, c_MinRoughness, 1.0); + + float iridescence = pbrMaterial.iridescenceFactor; +#ifdef HAS_IRIDESCENCEMAP + if (pbrMaterial.iridescenceMapEnabled) { + iridescence *= texture(pbr_iridescenceSampler, iridescenceUV).r; + } +#endif + iridescence = clamp(iridescence, 0.0, 1.0); + float iridescenceThickness = mix( + pbrMaterial.iridescenceThicknessRange.x, + pbrMaterial.iridescenceThicknessRange.y, + 0.5 + ); +#ifdef HAS_IRIDESCENCETHICKNESSMAP + iridescenceThickness = mix( + pbrMaterial.iridescenceThicknessRange.x, + pbrMaterial.iridescenceThicknessRange.y, + texture(pbr_iridescenceThicknessSampler, iridescenceThicknessUV).g + ); +#endif + + float anisotropyStrength = clamp(pbrMaterial.anisotropyStrength, 0.0, 1.0); + vec2 anisotropyDirection = normalizeDirection(pbrMaterial.anisotropyDirection); +#ifdef HAS_ANISOTROPYMAP + if (pbrMaterial.anisotropyMapEnabled) { + vec3 anisotropySample = texture(pbr_anisotropySampler, anisotropyUV).rgb; + anisotropyStrength *= anisotropySample.b; + vec2 mappedDirection = anisotropySample.rg * 2.0 - 1.0; + if (length(mappedDirection) > 0.0001) { + anisotropyDirection = normalize(mappedDirection); + } + } +#endif + anisotropyDirection = rotateDirection(anisotropyDirection, pbrMaterial.anisotropyRotation); + vec3 anisotropyTangent = normalize(tbn[0] * anisotropyDirection.x + tbn[1] * anisotropyDirection.y); + if (length(anisotropyTangent) < 0.0001) { + anisotropyTangent = normalize(tbn[0]); + } + float anisotropyViewAlignment = abs(dot(v, anisotropyTangent)); + perceptualRoughness = mix( + perceptualRoughness, + clamp(perceptualRoughness * (1.0 - 0.6 * anisotropyViewAlignment), c_MinRoughness, 1.0), + anisotropyStrength + ); + + // Roughness is authored as perceptual roughness; as is convention, + // convert to material roughness by squaring the perceptual roughness [2]. + float alphaRoughness = perceptualRoughness * perceptualRoughness; + + float dielectricF0 = getDielectricF0(pbrMaterial.ior); + vec3 dielectricSpecularF0 = min( + vec3(dielectricF0) * specularFactor * specularIntensity, + vec3(1.0) + ); + vec3 iridescenceTint = getIridescenceTint(iridescence, iridescenceThickness, NdotV); + dielectricSpecularF0 = mix( + dielectricSpecularF0, + dielectricSpecularF0 * iridescenceTint, + iridescence + ); + vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - dielectricSpecularF0); + diffuseColor *= (1.0 - metallic) * (1.0 - transmission); + vec3 specularColor = mix(dielectricSpecularF0, baseColor.rgb, metallic); + + float baseLayerEnergy = 1.0 - clearcoatFactor * 0.25; + diffuseColor *= baseLayerEnergy; + specularColor *= baseLayerEnergy; + + // Compute reflectance. + float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b); + + // For typical incident reflectance range (between 4% to 100%) set the grazing + // reflectance to 100% for typical fresnel effect. + // For very low reflectance range on highly diffuse objects (below 4%), + // incrementally reduce grazing reflecance to 0%. + float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0); + vec3 specularEnvironmentR0 = specularColor.rgb; + vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90; + vec3 reflection = -normalize(reflect(v, n)); + + PBRInfo pbrInfo = PBRInfo( + 0.0, // NdotL + NdotV, + 0.0, // NdotH + 0.0, // LdotH + 0.0, // VdotH + perceptualRoughness, + metallic, + specularEnvironmentR0, + specularEnvironmentR90, + alphaRoughness, + diffuseColor, + specularColor, + n, + v + ); + + +#ifdef USE_LIGHTS + // Apply ambient light + PBRInfo_setAmbientLight(pbrInfo); + color += calculateMaterialLightColor( + pbrInfo, + lighting.ambientColor, + clearcoatNormal, + clearcoatFactor, + clearcoatRoughness, + sheenColor, + sheenRoughness, + anisotropyTangent, + anisotropyStrength + ); + + // Apply directional light + for(int i = 0; i < lighting.directionalLightCount; i++) { + if (i < lighting.directionalLightCount) { + PBRInfo_setDirectionalLight(pbrInfo, lighting_getDirectionalLight(i).direction); + color += calculateMaterialLightColor( + pbrInfo, + lighting_getDirectionalLight(i).color, + clearcoatNormal, + clearcoatFactor, + clearcoatRoughness, + sheenColor, + sheenRoughness, + anisotropyTangent, + anisotropyStrength + ); + } + } + + // Apply point light + for(int i = 0; i < lighting.pointLightCount; i++) { + if (i < lighting.pointLightCount) { + PBRInfo_setPointLight(pbrInfo, lighting_getPointLight(i)); + float attenuation = getPointLightAttenuation(lighting_getPointLight(i), distance(lighting_getPointLight(i).position, pbr_vPosition)); + color += calculateMaterialLightColor( + pbrInfo, + lighting_getPointLight(i).color / attenuation, + clearcoatNormal, + clearcoatFactor, + clearcoatRoughness, + sheenColor, + sheenRoughness, + anisotropyTangent, + anisotropyStrength + ); + } + } + + for(int i = 0; i < lighting.spotLightCount; i++) { + if (i < lighting.spotLightCount) { + PBRInfo_setSpotLight(pbrInfo, lighting_getSpotLight(i)); + float attenuation = getSpotLightAttenuation(lighting_getSpotLight(i), pbr_vPosition); + color += calculateMaterialLightColor( + pbrInfo, + lighting_getSpotLight(i).color / attenuation, + clearcoatNormal, + clearcoatFactor, + clearcoatRoughness, + sheenColor, + sheenRoughness, + anisotropyTangent, + anisotropyStrength + ); + } + } +#endif + + // Calculate lighting contribution from image based lighting source (IBL) +#ifdef USE_IBL + if (pbrMaterial.IBLenabled) { + color += getIBLContribution(pbrInfo, n, reflection) * + calculateAnisotropyBoost(pbrInfo, anisotropyTangent, anisotropyStrength); + color += calculateClearcoatIBLContribution( + pbrInfo, + clearcoatNormal, + -normalize(reflect(v, clearcoatNormal)), + clearcoatFactor, + clearcoatRoughness + ); + color += sheenColor * pbrMaterial.scaleIBLAmbient.x * (1.0 - sheenRoughness) * 0.25; + } +#endif + + // Apply optional PBR terms for additional (optional) shading +#ifdef HAS_OCCLUSIONMAP + if (pbrMaterial.occlusionMapEnabled) { + float ao = texture(pbr_occlusionSampler, occlusionUV).r; + color = mix(color, color * ao, pbrMaterial.occlusionStrength); + } +#endif + + vec3 emissive = pbrMaterial.emissiveFactor; +#ifdef HAS_EMISSIVEMAP + if (pbrMaterial.emissiveMapEnabled) { + emissive *= SRGBtoLINEAR(texture(pbr_emissiveSampler, emissiveUV)).rgb; + } +#endif + color += emissive * pbrMaterial.emissiveStrength; + + if (transmission > 0.0) { + color = mix(color, color * getVolumeAttenuation(thickness), transmission); + } + + // This section uses mix to override final color for reference app visualization + // of various parameters in the lighting equation. +#ifdef PBR_DEBUG + // TODO: Figure out how to debug multiple lights + + // color = mix(color, F, pbr_scaleFGDSpec.x); + // color = mix(color, vec3(G), pbr_scaleFGDSpec.y); + // color = mix(color, vec3(D), pbr_scaleFGDSpec.z); + // color = mix(color, specContrib, pbr_scaleFGDSpec.w); + + // color = mix(color, diffuseContrib, pbr_scaleDiffBaseMR.x); + color = mix(color, baseColor.rgb, pbrMaterial.scaleDiffBaseMR.y); + color = mix(color, vec3(metallic), pbrMaterial.scaleDiffBaseMR.z); + color = mix(color, vec3(perceptualRoughness), pbrMaterial.scaleDiffBaseMR.w); +#endif + + } + + float alpha = clamp(baseColor.a * (1.0 - transmission), 0.0, 1.0); + return vec4(pow(color,vec3(1.0/2.2)), alpha); +} +`,Bd=`struct PBRFragmentInputs { + pbr_vPosition: vec3f, + pbr_vUV0: vec2f, + pbr_vUV1: vec2f, + pbr_vTBN: mat3x3f, + pbr_vNormal: vec3f +}; + +var fragmentInputs: PBRFragmentInputs; + +fn pbr_setPositionNormalTangentUV( + position: vec4f, + normal: vec4f, + tangent: vec4f, + uv0: vec2f, + uv1: vec2f +) +{ + var pos: vec4f = pbrProjection.modelMatrix * position; + fragmentInputs.pbr_vPosition = pos.xyz / pos.w; + fragmentInputs.pbr_vNormal = vec3f(0.0, 0.0, 1.0); + fragmentInputs.pbr_vTBN = mat3x3f( + vec3f(1.0, 0.0, 0.0), + vec3f(0.0, 1.0, 0.0), + vec3f(0.0, 0.0, 1.0) + ); + fragmentInputs.pbr_vUV0 = vec2f(0.0, 0.0); + fragmentInputs.pbr_vUV1 = uv1; + +#ifdef HAS_NORMALS + let normalW: vec3f = normalize((pbrProjection.normalMatrix * vec4f(normal.xyz, 0.0)).xyz); + fragmentInputs.pbr_vNormal = normalW; +#ifdef HAS_TANGENTS + let tangentW: vec3f = normalize((pbrProjection.modelMatrix * vec4f(tangent.xyz, 0.0)).xyz); + let bitangentW: vec3f = cross(normalW, tangentW) * tangent.w; + fragmentInputs.pbr_vTBN = mat3x3f(tangentW, bitangentW, normalW); +#endif +#endif + +#ifdef HAS_UV + fragmentInputs.pbr_vUV0 = uv0; +#endif +} + +struct pbrMaterialUniforms { + // Material is unlit + unlit: u32, + + // Base color map + baseColorMapEnabled: u32, + baseColorFactor: vec4f, + + normalMapEnabled : u32, + normalScale: f32, // #ifdef HAS_NORMALMAP + + emissiveMapEnabled: u32, + emissiveFactor: vec3f, // #ifdef HAS_EMISSIVEMAP + + metallicRoughnessValues: vec2f, + metallicRoughnessMapEnabled: u32, + + occlusionMapEnabled: i32, + occlusionStrength: f32, // #ifdef HAS_OCCLUSIONMAP + + alphaCutoffEnabled: i32, + alphaCutoff: f32, // #ifdef ALPHA_CUTOFF + + specularColorFactor: vec3f, + specularIntensityFactor: f32, + specularColorMapEnabled: i32, + specularIntensityMapEnabled: i32, + + ior: f32, + + transmissionFactor: f32, + transmissionMapEnabled: i32, + + thicknessFactor: f32, + attenuationDistance: f32, + attenuationColor: vec3f, + + clearcoatFactor: f32, + clearcoatRoughnessFactor: f32, + clearcoatMapEnabled: i32, + clearcoatRoughnessMapEnabled: i32, + + sheenColorFactor: vec3f, + sheenRoughnessFactor: f32, + sheenColorMapEnabled: i32, + sheenRoughnessMapEnabled: i32, + + iridescenceFactor: f32, + iridescenceIor: f32, + iridescenceThicknessRange: vec2f, + iridescenceMapEnabled: i32, + + anisotropyStrength: f32, + anisotropyRotation: f32, + anisotropyDirection: vec2f, + anisotropyMapEnabled: i32, + + emissiveStrength: f32, + + // IBL + IBLenabled: i32, + scaleIBLAmbient: vec2f, // #ifdef USE_IBL + + // debugging flags used for shader output of intermediate PBR variables + // #ifdef PBR_DEBUG + scaleDiffBaseMR: vec4f, + scaleFGDSpec: vec4f, + // #endif + + baseColorUVSet: i32, + baseColorUVTransform: mat3x3f, + metallicRoughnessUVSet: i32, + metallicRoughnessUVTransform: mat3x3f, + normalUVSet: i32, + normalUVTransform: mat3x3f, + occlusionUVSet: i32, + occlusionUVTransform: mat3x3f, + emissiveUVSet: i32, + emissiveUVTransform: mat3x3f, + specularColorUVSet: i32, + specularColorUVTransform: mat3x3f, + specularIntensityUVSet: i32, + specularIntensityUVTransform: mat3x3f, + transmissionUVSet: i32, + transmissionUVTransform: mat3x3f, + thicknessUVSet: i32, + thicknessUVTransform: mat3x3f, + clearcoatUVSet: i32, + clearcoatUVTransform: mat3x3f, + clearcoatRoughnessUVSet: i32, + clearcoatRoughnessUVTransform: mat3x3f, + clearcoatNormalUVSet: i32, + clearcoatNormalUVTransform: mat3x3f, + sheenColorUVSet: i32, + sheenColorUVTransform: mat3x3f, + sheenRoughnessUVSet: i32, + sheenRoughnessUVTransform: mat3x3f, + iridescenceUVSet: i32, + iridescenceUVTransform: mat3x3f, + iridescenceThicknessUVSet: i32, + iridescenceThicknessUVTransform: mat3x3f, + anisotropyUVSet: i32, + anisotropyUVTransform: mat3x3f, +} + +@group(3) @binding(auto) var pbrMaterial : pbrMaterialUniforms; + +// Samplers +#ifdef HAS_BASECOLORMAP +@group(3) @binding(auto) var pbr_baseColorSampler: texture_2d; +@group(3) @binding(auto) var pbr_baseColorSamplerSampler: sampler; +#endif +#ifdef HAS_NORMALMAP +@group(3) @binding(auto) var pbr_normalSampler: texture_2d; +@group(3) @binding(auto) var pbr_normalSamplerSampler: sampler; +#endif +#ifdef HAS_EMISSIVEMAP +@group(3) @binding(auto) var pbr_emissiveSampler: texture_2d; +@group(3) @binding(auto) var pbr_emissiveSamplerSampler: sampler; +#endif +#ifdef HAS_METALROUGHNESSMAP +@group(3) @binding(auto) var pbr_metallicRoughnessSampler: texture_2d; +@group(3) @binding(auto) var pbr_metallicRoughnessSamplerSampler: sampler; +#endif +#ifdef HAS_OCCLUSIONMAP +@group(3) @binding(auto) var pbr_occlusionSampler: texture_2d; +@group(3) @binding(auto) var pbr_occlusionSamplerSampler: sampler; +#endif +#ifdef HAS_SPECULARCOLORMAP +@group(3) @binding(auto) var pbr_specularColorSampler: texture_2d; +@group(3) @binding(auto) var pbr_specularColorSamplerSampler: sampler; +#endif +#ifdef HAS_SPECULARINTENSITYMAP +@group(3) @binding(auto) var pbr_specularIntensitySampler: texture_2d; +@group(3) @binding(auto) var pbr_specularIntensitySamplerSampler: sampler; +#endif +#ifdef HAS_TRANSMISSIONMAP +@group(3) @binding(auto) var pbr_transmissionSampler: texture_2d; +@group(3) @binding(auto) var pbr_transmissionSamplerSampler: sampler; +#endif +#ifdef HAS_THICKNESSMAP +@group(3) @binding(auto) var pbr_thicknessSampler: texture_2d; +@group(3) @binding(auto) var pbr_thicknessSamplerSampler: sampler; +#endif +#ifdef HAS_CLEARCOATMAP +@group(3) @binding(auto) var pbr_clearcoatSampler: texture_2d; +@group(3) @binding(auto) var pbr_clearcoatSamplerSampler: sampler; +#endif +#ifdef HAS_CLEARCOATROUGHNESSMAP +@group(3) @binding(auto) var pbr_clearcoatRoughnessSampler: texture_2d; +@group(3) @binding(auto) var pbr_clearcoatRoughnessSamplerSampler: sampler; +#endif +#ifdef HAS_CLEARCOATNORMALMAP +@group(3) @binding(auto) var pbr_clearcoatNormalSampler: texture_2d; +@group(3) @binding(auto) var pbr_clearcoatNormalSamplerSampler: sampler; +#endif +#ifdef HAS_SHEENCOLORMAP +@group(3) @binding(auto) var pbr_sheenColorSampler: texture_2d; +@group(3) @binding(auto) var pbr_sheenColorSamplerSampler: sampler; +#endif +#ifdef HAS_SHEENROUGHNESSMAP +@group(3) @binding(auto) var pbr_sheenRoughnessSampler: texture_2d; +@group(3) @binding(auto) var pbr_sheenRoughnessSamplerSampler: sampler; +#endif +#ifdef HAS_IRIDESCENCEMAP +@group(3) @binding(auto) var pbr_iridescenceSampler: texture_2d; +@group(3) @binding(auto) var pbr_iridescenceSamplerSampler: sampler; +#endif +#ifdef HAS_IRIDESCENCETHICKNESSMAP +@group(3) @binding(auto) var pbr_iridescenceThicknessSampler: texture_2d; +@group(3) @binding(auto) var pbr_iridescenceThicknessSamplerSampler: sampler; +#endif +#ifdef HAS_ANISOTROPYMAP +@group(3) @binding(auto) var pbr_anisotropySampler: texture_2d; +@group(3) @binding(auto) var pbr_anisotropySamplerSampler: sampler; +#endif +// Encapsulate the various inputs used by the various functions in the shading equation +// We store values in this struct to simplify the integration of alternative implementations +// of the shading terms, outlined in the Readme.MD Appendix. +struct PBRInfo { + NdotL: f32, // cos angle between normal and light direction + NdotV: f32, // cos angle between normal and view direction + NdotH: f32, // cos angle between normal and half vector + LdotH: f32, // cos angle between light direction and half vector + VdotH: f32, // cos angle between view direction and half vector + perceptualRoughness: f32, // roughness value, as authored by the model creator (input to shader) + metalness: f32, // metallic value at the surface + reflectance0: vec3f, // full reflectance color (normal incidence angle) + reflectance90: vec3f, // reflectance color at grazing angle + alphaRoughness: f32, // roughness mapped to a more linear change in the roughness (proposed by [2]) + diffuseColor: vec3f, // color contribution from diffuse lighting + specularColor: vec3f, // color contribution from specular lighting + n: vec3f, // normal at surface point + v: vec3f, // vector from surface point to camera +}; + +const M_PI = 3.141592653589793; +const c_MinRoughness = 0.04; + +fn SRGBtoLINEAR(srgbIn: vec4f ) -> vec4f +{ + var linOut: vec3f = srgbIn.xyz; +#ifdef MANUAL_SRGB + let bLess: vec3f = step(vec3f(0.04045), srgbIn.xyz); + linOut = mix( + srgbIn.xyz / vec3f(12.92), + pow((srgbIn.xyz + vec3f(0.055)) / vec3f(1.055), vec3f(2.4)), + bLess + ); +#ifdef SRGB_FAST_APPROXIMATION + linOut = pow(srgbIn.xyz, vec3f(2.2)); +#endif +#endif + return vec4f(linOut, srgbIn.w); +} + +fn getMaterialUV(uvSet: i32, uvTransform: mat3x3f) -> vec2f +{ + var baseUV = fragmentInputs.pbr_vUV0; + if (uvSet == 1) { + baseUV = fragmentInputs.pbr_vUV1; + } + return (uvTransform * vec3f(baseUV, 1.0)).xy; +} + +// Build the tangent basis from interpolated attributes or screen-space derivatives. +fn getTBN(uv: vec2f) -> mat3x3f +{ + let pos_dx: vec3f = dpdx(fragmentInputs.pbr_vPosition); + let pos_dy: vec3f = dpdy(fragmentInputs.pbr_vPosition); + let tex_dx: vec3f = dpdx(vec3f(uv, 0.0)); + let tex_dy: vec3f = dpdy(vec3f(uv, 0.0)); + var t: vec3f = (tex_dy.y * pos_dx - tex_dx.y * pos_dy) / (tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y); + + var ng: vec3f = cross(pos_dx, pos_dy); +#ifdef HAS_NORMALS + ng = normalize(fragmentInputs.pbr_vNormal); +#endif + t = normalize(t - ng * dot(ng, t)); + var b: vec3f = normalize(cross(ng, t)); + var tbn: mat3x3f = mat3x3f(t, b, ng); +#ifdef HAS_TANGENTS + tbn = fragmentInputs.pbr_vTBN; +#endif + + return tbn; +} + +// Find the normal for this fragment, pulling either from a predefined normal map +// or from the interpolated mesh normal and tangent attributes. +fn getMappedNormal( + normalSampler: texture_2d, + normalSamplerBinding: sampler, + tbn: mat3x3f, + normalScale: f32, + uv: vec2f +) -> vec3f +{ + let n = textureSample(normalSampler, normalSamplerBinding, uv).rgb; + return normalize(tbn * ((2.0 * n - 1.0) * vec3f(normalScale, normalScale, 1.0))); +} + +fn getNormal(tbn: mat3x3f, uv: vec2f) -> vec3f +{ + // The tbn matrix is linearly interpolated, so we need to re-normalize + var n: vec3f = normalize(tbn[2].xyz); +#ifdef HAS_NORMALMAP + n = getMappedNormal( + pbr_normalSampler, + pbr_normalSamplerSampler, + tbn, + pbrMaterial.normalScale, + uv + ); +#endif + + return n; +} + +fn getClearcoatNormal(tbn: mat3x3f, baseNormal: vec3f, uv: vec2f) -> vec3f +{ +#ifdef HAS_CLEARCOATNORMALMAP + return getMappedNormal( + pbr_clearcoatNormalSampler, + pbr_clearcoatNormalSamplerSampler, + tbn, + 1.0, + uv + ); +#else + return baseNormal; +#endif +} + +// Calculation of the lighting contribution from an optional Image Based Light source. +// Precomputed Environment Maps are required uniform inputs and are computed as outlined in [1]. +// See our README.md on Environment Maps [3] for additional discussion. +#ifdef USE_IBL +fn getIBLContribution(pbrInfo: PBRInfo, n: vec3f, reflection: vec3f) -> vec3f +{ + let mipCount: f32 = 9.0; // resolution of 512x512 + let lod: f32 = pbrInfo.perceptualRoughness * mipCount; + // retrieve a scale and bias to F0. See [1], Figure 3 + let brdf = SRGBtoLINEAR( + textureSampleLevel( + pbr_brdfLUT, + pbr_brdfLUTSampler, + vec2f(pbrInfo.NdotV, 1.0 - pbrInfo.perceptualRoughness), + 0.0 + ) + ).rgb; + let diffuseLight = + SRGBtoLINEAR( + textureSampleLevel(pbr_diffuseEnvSampler, pbr_diffuseEnvSamplerSampler, n, 0.0) + ).rgb; + var specularLight = SRGBtoLINEAR( + textureSampleLevel( + pbr_specularEnvSampler, + pbr_specularEnvSamplerSampler, + reflection, + 0.0 + ) + ).rgb; +#ifdef USE_TEX_LOD + specularLight = SRGBtoLINEAR( + textureSampleLevel( + pbr_specularEnvSampler, + pbr_specularEnvSamplerSampler, + reflection, + lod + ) + ).rgb; +#endif + + let diffuse = diffuseLight * pbrInfo.diffuseColor * pbrMaterial.scaleIBLAmbient.x; + let specular = + specularLight * (pbrInfo.specularColor * brdf.x + brdf.y) * pbrMaterial.scaleIBLAmbient.y; + + return diffuse + specular; +} +#endif + +// Basic Lambertian diffuse +// Implementation from Lambert's Photometria https://archive.org/details/lambertsphotome00lambgoog +// See also [1], Equation 1 +fn diffuse(pbrInfo: PBRInfo) -> vec3 { + return pbrInfo.diffuseColor / M_PI; +} + +// The following equation models the Fresnel reflectance term of the spec equation (aka F()) +// Implementation of fresnel from [4], Equation 15 +fn specularReflection(pbrInfo: PBRInfo) -> vec3 { + return pbrInfo.reflectance0 + + (pbrInfo.reflectance90 - pbrInfo.reflectance0) * + pow(clamp(1.0 - pbrInfo.VdotH, 0.0, 1.0), 5.0); +} + +// This calculates the specular geometric attenuation (aka G()), +// where rougher material will reflect less light back to the viewer. +// This implementation is based on [1] Equation 4, and we adopt their modifications to +// alphaRoughness as input as originally proposed in [2]. +fn geometricOcclusion(pbrInfo: PBRInfo) -> f32 { + let NdotL: f32 = pbrInfo.NdotL; + let NdotV: f32 = pbrInfo.NdotV; + let r: f32 = pbrInfo.alphaRoughness; + + let attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL))); + let attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV))); + return attenuationL * attenuationV; +} + +// The following equation(s) model the distribution of microfacet normals across +// the area being drawn (aka D()) +// Implementation from "Average Irregularity Representation of a Roughened Surface +// for Ray Reflection" by T. S. Trowbridge, and K. P. Reitz +// Follows the distribution function recommended in the SIGGRAPH 2013 course notes +// from EPIC Games [1], Equation 3. +fn microfacetDistribution(pbrInfo: PBRInfo) -> f32 { + let roughnessSq = pbrInfo.alphaRoughness * pbrInfo.alphaRoughness; + let f = (pbrInfo.NdotH * roughnessSq - pbrInfo.NdotH) * pbrInfo.NdotH + 1.0; + return roughnessSq / (M_PI * f * f); +} + +fn maxComponent(value: vec3f) -> f32 { + return max(max(value.r, value.g), value.b); +} + +fn getDielectricF0(ior: f32) -> f32 { + let clampedIor = max(ior, 1.0); + let ratio = (clampedIor - 1.0) / (clampedIor + 1.0); + return ratio * ratio; +} + +fn normalizeDirection(direction: vec2f) -> vec2f { + let directionLength = length(direction); + if (directionLength > 0.0001) { + return direction / directionLength; + } + + return vec2f(1.0, 0.0); +} + +fn rotateDirection(direction: vec2f, rotation: f32) -> vec2f { + let s = sin(rotation); + let c = cos(rotation); + return vec2f(direction.x * c - direction.y * s, direction.x * s + direction.y * c); +} + +fn getIridescenceTint(iridescence: f32, thickness: f32, NdotV: f32) -> vec3f { + if (iridescence <= 0.0) { + return vec3f(1.0); + } + + let phase = 0.015 * thickness * pbrMaterial.iridescenceIor + (1.0 - NdotV) * 6.0; + let thinFilmTint = + 0.5 + + 0.5 * + cos(vec3f(phase, phase + 2.0943951, phase + 4.1887902)); + return mix(vec3f(1.0), thinFilmTint, iridescence); +} + +fn getVolumeAttenuation(thickness: f32) -> vec3f { + if (thickness <= 0.0) { + return vec3f(1.0); + } + + let attenuationCoefficient = + -log(max(pbrMaterial.attenuationColor, vec3f(0.0001))) / + max(pbrMaterial.attenuationDistance, 0.0001); + return exp(-attenuationCoefficient * thickness); +} + +fn createClearcoatPBRInfo( + basePBRInfo: PBRInfo, + clearcoatNormal: vec3f, + clearcoatRoughness: f32 +) -> PBRInfo { + let perceptualRoughness = clamp(clearcoatRoughness, c_MinRoughness, 1.0); + let alphaRoughness = perceptualRoughness * perceptualRoughness; + let NdotV = clamp(abs(dot(clearcoatNormal, basePBRInfo.v)), 0.001, 1.0); + + return PBRInfo( + basePBRInfo.NdotL, + NdotV, + basePBRInfo.NdotH, + basePBRInfo.LdotH, + basePBRInfo.VdotH, + perceptualRoughness, + 0.0, + vec3f(0.04), + vec3f(1.0), + alphaRoughness, + vec3f(0.0), + vec3f(0.04), + clearcoatNormal, + basePBRInfo.v + ); +} + +fn calculateClearcoatContribution( + pbrInfo: PBRInfo, + lightColor: vec3f, + clearcoatNormal: vec3f, + clearcoatFactor: f32, + clearcoatRoughness: f32 +) -> vec3f { + if (clearcoatFactor <= 0.0) { + return vec3f(0.0); + } + + let clearcoatPBRInfo = createClearcoatPBRInfo(pbrInfo, clearcoatNormal, clearcoatRoughness); + return calculateFinalColor(clearcoatPBRInfo, lightColor) * clearcoatFactor; +} + +#ifdef USE_IBL +fn calculateClearcoatIBLContribution( + pbrInfo: PBRInfo, + clearcoatNormal: vec3f, + reflection: vec3f, + clearcoatFactor: f32, + clearcoatRoughness: f32 +) -> vec3f { + if (clearcoatFactor <= 0.0) { + return vec3f(0.0); + } + + let clearcoatPBRInfo = createClearcoatPBRInfo(pbrInfo, clearcoatNormal, clearcoatRoughness); + return getIBLContribution(clearcoatPBRInfo, clearcoatNormal, reflection) * clearcoatFactor; +} +#endif + +fn calculateSheenContribution( + pbrInfo: PBRInfo, + lightColor: vec3f, + sheenColor: vec3f, + sheenRoughness: f32 +) -> vec3f { + if (maxComponent(sheenColor) <= 0.0) { + return vec3f(0.0); + } + + let sheenFresnel = pow(clamp(1.0 - pbrInfo.VdotH, 0.0, 1.0), 5.0); + let sheenVisibility = mix(1.0, pbrInfo.NdotL * pbrInfo.NdotV, sheenRoughness); + return pbrInfo.NdotL * + lightColor * + sheenColor * + (0.25 + 0.75 * sheenFresnel) * + sheenVisibility * + (1.0 - pbrInfo.metalness); +} + +fn calculateAnisotropyBoost( + pbrInfo: PBRInfo, + anisotropyTangent: vec3f, + anisotropyStrength: f32 +) -> f32 { + if (anisotropyStrength <= 0.0) { + return 1.0; + } + + let anisotropyBitangent = normalize(cross(pbrInfo.n, anisotropyTangent)); + let bitangentViewAlignment = abs(dot(pbrInfo.v, anisotropyBitangent)); + return mix(1.0, 0.65 + 0.7 * bitangentViewAlignment, anisotropyStrength); +} + +fn calculateMaterialLightColor( + pbrInfo: PBRInfo, + lightColor: vec3f, + clearcoatNormal: vec3f, + clearcoatFactor: f32, + clearcoatRoughness: f32, + sheenColor: vec3f, + sheenRoughness: f32, + anisotropyTangent: vec3f, + anisotropyStrength: f32 +) -> vec3f { + let anisotropyBoost = calculateAnisotropyBoost(pbrInfo, anisotropyTangent, anisotropyStrength); + var color = calculateFinalColor(pbrInfo, lightColor) * anisotropyBoost; + color += calculateClearcoatContribution( + pbrInfo, + lightColor, + clearcoatNormal, + clearcoatFactor, + clearcoatRoughness + ); + color += calculateSheenContribution(pbrInfo, lightColor, sheenColor, sheenRoughness); + return color; +} + +fn PBRInfo_setAmbientLight(pbrInfo: ptr) { + (*pbrInfo).NdotL = 1.0; + (*pbrInfo).NdotH = 0.0; + (*pbrInfo).LdotH = 0.0; + (*pbrInfo).VdotH = 1.0; +} + +fn PBRInfo_setDirectionalLight(pbrInfo: ptr, lightDirection: vec3) { + let n = (*pbrInfo).n; + let v = (*pbrInfo).v; + let l = normalize(lightDirection); // Vector from surface point to light + let h = normalize(l + v); // Half vector between both l and v + + (*pbrInfo).NdotL = clamp(dot(n, l), 0.001, 1.0); + (*pbrInfo).NdotH = clamp(dot(n, h), 0.0, 1.0); + (*pbrInfo).LdotH = clamp(dot(l, h), 0.0, 1.0); + (*pbrInfo).VdotH = clamp(dot(v, h), 0.0, 1.0); +} + +fn PBRInfo_setPointLight(pbrInfo: ptr, pointLight: PointLight) { + let light_direction = normalize(pointLight.position - fragmentInputs.pbr_vPosition); + PBRInfo_setDirectionalLight(pbrInfo, light_direction); +} + +fn PBRInfo_setSpotLight(pbrInfo: ptr, spotLight: SpotLight) { + let light_direction = normalize(spotLight.position - fragmentInputs.pbr_vPosition); + PBRInfo_setDirectionalLight(pbrInfo, light_direction); +} + +fn calculateFinalColor(pbrInfo: PBRInfo, lightColor: vec3) -> vec3 { + // Calculate the shading terms for the microfacet specular shading model + let F = specularReflection(pbrInfo); + let G = geometricOcclusion(pbrInfo); + let D = microfacetDistribution(pbrInfo); + + // Calculation of analytical lighting contribution + let diffuseContrib = (1.0 - F) * diffuse(pbrInfo); + let specContrib = F * G * D / (4.0 * pbrInfo.NdotL * pbrInfo.NdotV); + // Obtain final intensity as reflectance (BRDF) scaled by the energy of the light (cosine law) + return pbrInfo.NdotL * lightColor * (diffuseContrib + specContrib); +} + +fn pbr_filterColor(colorUnused: vec4) -> vec4 { + let baseColorUV = getMaterialUV(pbrMaterial.baseColorUVSet, pbrMaterial.baseColorUVTransform); + let metallicRoughnessUV = getMaterialUV( + pbrMaterial.metallicRoughnessUVSet, + pbrMaterial.metallicRoughnessUVTransform + ); + let normalUV = getMaterialUV(pbrMaterial.normalUVSet, pbrMaterial.normalUVTransform); + let occlusionUV = getMaterialUV(pbrMaterial.occlusionUVSet, pbrMaterial.occlusionUVTransform); + let emissiveUV = getMaterialUV(pbrMaterial.emissiveUVSet, pbrMaterial.emissiveUVTransform); + let specularColorUV = getMaterialUV( + pbrMaterial.specularColorUVSet, + pbrMaterial.specularColorUVTransform + ); + let specularIntensityUV = getMaterialUV( + pbrMaterial.specularIntensityUVSet, + pbrMaterial.specularIntensityUVTransform + ); + let transmissionUV = getMaterialUV( + pbrMaterial.transmissionUVSet, + pbrMaterial.transmissionUVTransform + ); + let thicknessUV = getMaterialUV(pbrMaterial.thicknessUVSet, pbrMaterial.thicknessUVTransform); + let clearcoatUV = getMaterialUV(pbrMaterial.clearcoatUVSet, pbrMaterial.clearcoatUVTransform); + let clearcoatRoughnessUV = getMaterialUV( + pbrMaterial.clearcoatRoughnessUVSet, + pbrMaterial.clearcoatRoughnessUVTransform + ); + let clearcoatNormalUV = getMaterialUV( + pbrMaterial.clearcoatNormalUVSet, + pbrMaterial.clearcoatNormalUVTransform + ); + let sheenColorUV = getMaterialUV( + pbrMaterial.sheenColorUVSet, + pbrMaterial.sheenColorUVTransform + ); + let sheenRoughnessUV = getMaterialUV( + pbrMaterial.sheenRoughnessUVSet, + pbrMaterial.sheenRoughnessUVTransform + ); + let iridescenceUV = getMaterialUV( + pbrMaterial.iridescenceUVSet, + pbrMaterial.iridescenceUVTransform + ); + let iridescenceThicknessUV = getMaterialUV( + pbrMaterial.iridescenceThicknessUVSet, + pbrMaterial.iridescenceThicknessUVTransform + ); + let anisotropyUV = getMaterialUV( + pbrMaterial.anisotropyUVSet, + pbrMaterial.anisotropyUVTransform + ); + + // The albedo may be defined from a base texture or a flat color + var baseColor: vec4 = pbrMaterial.baseColorFactor; + #ifdef HAS_BASECOLORMAP + baseColor = SRGBtoLINEAR( + textureSample(pbr_baseColorSampler, pbr_baseColorSamplerSampler, baseColorUV) + ) * pbrMaterial.baseColorFactor; + #endif + + #ifdef ALPHA_CUTOFF + if (baseColor.a < pbrMaterial.alphaCutoff) { + discard; + } + #endif + + var color = vec3(0.0, 0.0, 0.0); + var transmission = 0.0; + + if (pbrMaterial.unlit != 0u) { + color = baseColor.rgb; + } else { + // Metallic and Roughness material properties are packed together + // In glTF, these factors can be specified by fixed scalar values + // or from a metallic-roughness map + var perceptualRoughness = pbrMaterial.metallicRoughnessValues.y; + var metallic = pbrMaterial.metallicRoughnessValues.x; + #ifdef HAS_METALROUGHNESSMAP + // Roughness is stored in the 'g' channel, metallic is stored in the 'b' channel. + // This layout intentionally reserves the 'r' channel for (optional) occlusion map data + let mrSample = textureSample( + pbr_metallicRoughnessSampler, + pbr_metallicRoughnessSamplerSampler, + metallicRoughnessUV + ); + perceptualRoughness = mrSample.g * perceptualRoughness; + metallic = mrSample.b * metallic; + #endif + perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0); + metallic = clamp(metallic, 0.0, 1.0); + let tbn = getTBN(normalUV); + let n = getNormal(tbn, normalUV); // normal at surface point + let v = normalize(pbrProjection.camera - fragmentInputs.pbr_vPosition); // Vector from surface point to camera + let NdotV = clamp(abs(dot(n, v)), 0.001, 1.0); + var useExtendedPBR = false; + #ifdef USE_MATERIAL_EXTENSIONS + useExtendedPBR = + pbrMaterial.specularColorMapEnabled != 0 || + pbrMaterial.specularIntensityMapEnabled != 0 || + abs(pbrMaterial.specularIntensityFactor - 1.0) > 0.0001 || + maxComponent(abs(pbrMaterial.specularColorFactor - vec3f(1.0))) > 0.0001 || + abs(pbrMaterial.ior - 1.5) > 0.0001 || + pbrMaterial.transmissionMapEnabled != 0 || + pbrMaterial.transmissionFactor > 0.0001 || + pbrMaterial.clearcoatMapEnabled != 0 || + pbrMaterial.clearcoatRoughnessMapEnabled != 0 || + pbrMaterial.clearcoatFactor > 0.0001 || + pbrMaterial.clearcoatRoughnessFactor > 0.0001 || + pbrMaterial.sheenColorMapEnabled != 0 || + pbrMaterial.sheenRoughnessMapEnabled != 0 || + maxComponent(pbrMaterial.sheenColorFactor) > 0.0001 || + pbrMaterial.sheenRoughnessFactor > 0.0001 || + pbrMaterial.iridescenceMapEnabled != 0 || + pbrMaterial.iridescenceFactor > 0.0001 || + abs(pbrMaterial.iridescenceIor - 1.3) > 0.0001 || + abs(pbrMaterial.iridescenceThicknessRange.x - 100.0) > 0.0001 || + abs(pbrMaterial.iridescenceThicknessRange.y - 400.0) > 0.0001 || + pbrMaterial.anisotropyMapEnabled != 0 || + pbrMaterial.anisotropyStrength > 0.0001 || + abs(pbrMaterial.anisotropyRotation) > 0.0001 || + length(pbrMaterial.anisotropyDirection - vec2f(1.0, 0.0)) > 0.0001; + #endif + + if (!useExtendedPBR) { + let alphaRoughness = perceptualRoughness * perceptualRoughness; + + let f0 = vec3(0.04); + var diffuseColor = baseColor.rgb * (vec3(1.0) - f0); + diffuseColor *= 1.0 - metallic; + let specularColor = mix(f0, baseColor.rgb, metallic); + + let reflectance = max(max(specularColor.r, specularColor.g), specularColor.b); + let reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0); + let specularEnvironmentR0 = specularColor; + let specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90; + let reflection = -normalize(reflect(v, n)); + + var pbrInfo = PBRInfo( + 0.0, // NdotL + NdotV, + 0.0, // NdotH + 0.0, // LdotH + 0.0, // VdotH + perceptualRoughness, + metallic, + specularEnvironmentR0, + specularEnvironmentR90, + alphaRoughness, + diffuseColor, + specularColor, + n, + v + ); + + #ifdef USE_LIGHTS + PBRInfo_setAmbientLight(&pbrInfo); + color += calculateFinalColor(pbrInfo, lighting.ambientColor); + + for (var i = 0; i < lighting.directionalLightCount; i++) { + if (i < lighting.directionalLightCount) { + PBRInfo_setDirectionalLight(&pbrInfo, lighting_getDirectionalLight(i).direction); + color += calculateFinalColor(pbrInfo, lighting_getDirectionalLight(i).color); + } + } + + for (var i = 0; i < lighting.pointLightCount; i++) { + if (i < lighting.pointLightCount) { + PBRInfo_setPointLight(&pbrInfo, lighting_getPointLight(i)); + let attenuation = getPointLightAttenuation( + lighting_getPointLight(i), + distance(lighting_getPointLight(i).position, fragmentInputs.pbr_vPosition) + ); + color += calculateFinalColor(pbrInfo, lighting_getPointLight(i).color / attenuation); + } + } + + for (var i = 0; i < lighting.spotLightCount; i++) { + if (i < lighting.spotLightCount) { + PBRInfo_setSpotLight(&pbrInfo, lighting_getSpotLight(i)); + let attenuation = getSpotLightAttenuation( + lighting_getSpotLight(i), + fragmentInputs.pbr_vPosition + ); + color += calculateFinalColor(pbrInfo, lighting_getSpotLight(i).color / attenuation); + } + } + #endif + + #ifdef USE_IBL + if (pbrMaterial.IBLenabled != 0) { + color += getIBLContribution(pbrInfo, n, reflection); + } + #endif + + #ifdef HAS_OCCLUSIONMAP + if (pbrMaterial.occlusionMapEnabled != 0) { + let ao = textureSample(pbr_occlusionSampler, pbr_occlusionSamplerSampler, occlusionUV).r; + color = mix(color, color * ao, pbrMaterial.occlusionStrength); + } + #endif + + var emissive = pbrMaterial.emissiveFactor; + #ifdef HAS_EMISSIVEMAP + if (pbrMaterial.emissiveMapEnabled != 0u) { + emissive *= SRGBtoLINEAR( + textureSample(pbr_emissiveSampler, pbr_emissiveSamplerSampler, emissiveUV) + ).rgb; + } + #endif + color += emissive * pbrMaterial.emissiveStrength; + + #ifdef PBR_DEBUG + color = mix(color, baseColor.rgb, pbrMaterial.scaleDiffBaseMR.y); + color = mix(color, vec3(metallic), pbrMaterial.scaleDiffBaseMR.z); + color = mix(color, vec3(perceptualRoughness), pbrMaterial.scaleDiffBaseMR.w); + #endif + + return vec4(pow(color, vec3(1.0 / 2.2)), baseColor.a); + } + + var specularIntensity = pbrMaterial.specularIntensityFactor; + #ifdef HAS_SPECULARINTENSITYMAP + if (pbrMaterial.specularIntensityMapEnabled != 0) { + specularIntensity *= textureSample( + pbr_specularIntensitySampler, + pbr_specularIntensitySamplerSampler, + specularIntensityUV + ).a; + } + #endif + + var specularFactor = pbrMaterial.specularColorFactor; + #ifdef HAS_SPECULARCOLORMAP + if (pbrMaterial.specularColorMapEnabled != 0) { + specularFactor *= SRGBtoLINEAR( + textureSample( + pbr_specularColorSampler, + pbr_specularColorSamplerSampler, + specularColorUV + ) + ).rgb; + } + #endif + + transmission = pbrMaterial.transmissionFactor; + #ifdef HAS_TRANSMISSIONMAP + if (pbrMaterial.transmissionMapEnabled != 0) { + transmission *= textureSample( + pbr_transmissionSampler, + pbr_transmissionSamplerSampler, + transmissionUV + ).r; + } + #endif + transmission = clamp(transmission * (1.0 - metallic), 0.0, 1.0); + var thickness = max(pbrMaterial.thicknessFactor, 0.0); + #ifdef HAS_THICKNESSMAP + thickness *= textureSample( + pbr_thicknessSampler, + pbr_thicknessSamplerSampler, + thicknessUV + ).g; + #endif + + var clearcoatFactor = pbrMaterial.clearcoatFactor; + var clearcoatRoughness = pbrMaterial.clearcoatRoughnessFactor; + #ifdef HAS_CLEARCOATMAP + if (pbrMaterial.clearcoatMapEnabled != 0) { + clearcoatFactor *= textureSample( + pbr_clearcoatSampler, + pbr_clearcoatSamplerSampler, + clearcoatUV + ).r; + } + #endif + #ifdef HAS_CLEARCOATROUGHNESSMAP + if (pbrMaterial.clearcoatRoughnessMapEnabled != 0) { + clearcoatRoughness *= textureSample( + pbr_clearcoatRoughnessSampler, + pbr_clearcoatRoughnessSamplerSampler, + clearcoatRoughnessUV + ).g; + } + #endif + clearcoatFactor = clamp(clearcoatFactor, 0.0, 1.0); + clearcoatRoughness = clamp(clearcoatRoughness, c_MinRoughness, 1.0); + let clearcoatNormal = getClearcoatNormal(getTBN(clearcoatNormalUV), n, clearcoatNormalUV); + + var sheenColor = pbrMaterial.sheenColorFactor; + var sheenRoughness = pbrMaterial.sheenRoughnessFactor; + #ifdef HAS_SHEENCOLORMAP + if (pbrMaterial.sheenColorMapEnabled != 0) { + sheenColor *= SRGBtoLINEAR( + textureSample( + pbr_sheenColorSampler, + pbr_sheenColorSamplerSampler, + sheenColorUV + ) + ).rgb; + } + #endif + #ifdef HAS_SHEENROUGHNESSMAP + if (pbrMaterial.sheenRoughnessMapEnabled != 0) { + sheenRoughness *= textureSample( + pbr_sheenRoughnessSampler, + pbr_sheenRoughnessSamplerSampler, + sheenRoughnessUV + ).a; + } + #endif + sheenRoughness = clamp(sheenRoughness, c_MinRoughness, 1.0); + + var iridescence = pbrMaterial.iridescenceFactor; + #ifdef HAS_IRIDESCENCEMAP + if (pbrMaterial.iridescenceMapEnabled != 0) { + iridescence *= textureSample( + pbr_iridescenceSampler, + pbr_iridescenceSamplerSampler, + iridescenceUV + ).r; + } + #endif + iridescence = clamp(iridescence, 0.0, 1.0); + var iridescenceThickness = mix( + pbrMaterial.iridescenceThicknessRange.x, + pbrMaterial.iridescenceThicknessRange.y, + 0.5 + ); + #ifdef HAS_IRIDESCENCETHICKNESSMAP + iridescenceThickness = mix( + pbrMaterial.iridescenceThicknessRange.x, + pbrMaterial.iridescenceThicknessRange.y, + textureSample( + pbr_iridescenceThicknessSampler, + pbr_iridescenceThicknessSamplerSampler, + iridescenceThicknessUV + ).g + ); + #endif + + var anisotropyStrength = clamp(pbrMaterial.anisotropyStrength, 0.0, 1.0); + var anisotropyDirection = normalizeDirection(pbrMaterial.anisotropyDirection); + #ifdef HAS_ANISOTROPYMAP + if (pbrMaterial.anisotropyMapEnabled != 0) { + let anisotropySample = textureSample( + pbr_anisotropySampler, + pbr_anisotropySamplerSampler, + anisotropyUV + ).rgb; + anisotropyStrength *= anisotropySample.b; + let mappedDirection = anisotropySample.rg * 2.0 - 1.0; + if (length(mappedDirection) > 0.0001) { + anisotropyDirection = normalize(mappedDirection); + } + } + #endif + anisotropyDirection = rotateDirection(anisotropyDirection, pbrMaterial.anisotropyRotation); + var anisotropyTangent = + normalize(tbn[0] * anisotropyDirection.x + tbn[1] * anisotropyDirection.y); + if (length(anisotropyTangent) < 0.0001) { + anisotropyTangent = normalize(tbn[0]); + } + let anisotropyViewAlignment = abs(dot(v, anisotropyTangent)); + perceptualRoughness = mix( + perceptualRoughness, + clamp(perceptualRoughness * (1.0 - 0.6 * anisotropyViewAlignment), c_MinRoughness, 1.0), + anisotropyStrength + ); + + // Roughness is authored as perceptual roughness; as is convention, + // convert to material roughness by squaring the perceptual roughness [2]. + let alphaRoughness = perceptualRoughness * perceptualRoughness; + + let dielectricF0 = getDielectricF0(pbrMaterial.ior); + var dielectricSpecularF0 = min( + vec3f(dielectricF0) * specularFactor * specularIntensity, + vec3f(1.0) + ); + let iridescenceTint = getIridescenceTint(iridescence, iridescenceThickness, NdotV); + dielectricSpecularF0 = mix( + dielectricSpecularF0, + dielectricSpecularF0 * iridescenceTint, + iridescence + ); + var diffuseColor = baseColor.rgb * (vec3f(1.0) - dielectricSpecularF0); + diffuseColor *= (1.0 - metallic) * (1.0 - transmission); + var specularColor = mix(dielectricSpecularF0, baseColor.rgb, metallic); + + let baseLayerEnergy = 1.0 - clearcoatFactor * 0.25; + diffuseColor *= baseLayerEnergy; + specularColor *= baseLayerEnergy; + + // Compute reflectance. + let reflectance = max(max(specularColor.r, specularColor.g), specularColor.b); + + // For typical incident reflectance range (between 4% to 100%) set the grazing + // reflectance to 100% for typical fresnel effect. + // For very low reflectance range on highly diffuse objects (below 4%), + // incrementally reduce grazing reflectance to 0%. + let reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0); + let specularEnvironmentR0 = specularColor; + let specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90; + let reflection = -normalize(reflect(v, n)); + + var pbrInfo = PBRInfo( + 0.0, // NdotL + NdotV, + 0.0, // NdotH + 0.0, // LdotH + 0.0, // VdotH + perceptualRoughness, + metallic, + specularEnvironmentR0, + specularEnvironmentR90, + alphaRoughness, + diffuseColor, + specularColor, + n, + v + ); + + #ifdef USE_LIGHTS + // Apply ambient light + PBRInfo_setAmbientLight(&pbrInfo); + color += calculateMaterialLightColor( + pbrInfo, + lighting.ambientColor, + clearcoatNormal, + clearcoatFactor, + clearcoatRoughness, + sheenColor, + sheenRoughness, + anisotropyTangent, + anisotropyStrength + ); + + // Apply directional light + for (var i = 0; i < lighting.directionalLightCount; i++) { + if (i < lighting.directionalLightCount) { + PBRInfo_setDirectionalLight(&pbrInfo, lighting_getDirectionalLight(i).direction); + color += calculateMaterialLightColor( + pbrInfo, + lighting_getDirectionalLight(i).color, + clearcoatNormal, + clearcoatFactor, + clearcoatRoughness, + sheenColor, + sheenRoughness, + anisotropyTangent, + anisotropyStrength + ); + } + } + + // Apply point light + for (var i = 0; i < lighting.pointLightCount; i++) { + if (i < lighting.pointLightCount) { + PBRInfo_setPointLight(&pbrInfo, lighting_getPointLight(i)); + let attenuation = getPointLightAttenuation( + lighting_getPointLight(i), + distance(lighting_getPointLight(i).position, fragmentInputs.pbr_vPosition) + ); + color += calculateMaterialLightColor( + pbrInfo, + lighting_getPointLight(i).color / attenuation, + clearcoatNormal, + clearcoatFactor, + clearcoatRoughness, + sheenColor, + sheenRoughness, + anisotropyTangent, + anisotropyStrength + ); + } + } + + for (var i = 0; i < lighting.spotLightCount; i++) { + if (i < lighting.spotLightCount) { + PBRInfo_setSpotLight(&pbrInfo, lighting_getSpotLight(i)); + let attenuation = getSpotLightAttenuation(lighting_getSpotLight(i), fragmentInputs.pbr_vPosition); + color += calculateMaterialLightColor( + pbrInfo, + lighting_getSpotLight(i).color / attenuation, + clearcoatNormal, + clearcoatFactor, + clearcoatRoughness, + sheenColor, + sheenRoughness, + anisotropyTangent, + anisotropyStrength + ); + } + } + #endif + + // Calculate lighting contribution from image based lighting source (IBL) + #ifdef USE_IBL + if (pbrMaterial.IBLenabled != 0) { + color += getIBLContribution(pbrInfo, n, reflection) * + calculateAnisotropyBoost(pbrInfo, anisotropyTangent, anisotropyStrength); + color += calculateClearcoatIBLContribution( + pbrInfo, + clearcoatNormal, + -normalize(reflect(v, clearcoatNormal)), + clearcoatFactor, + clearcoatRoughness + ); + color += sheenColor * pbrMaterial.scaleIBLAmbient.x * (1.0 - sheenRoughness) * 0.25; + } + #endif + + // Apply optional PBR terms for additional (optional) shading + #ifdef HAS_OCCLUSIONMAP + if (pbrMaterial.occlusionMapEnabled != 0) { + let ao = textureSample(pbr_occlusionSampler, pbr_occlusionSamplerSampler, occlusionUV).r; + color = mix(color, color * ao, pbrMaterial.occlusionStrength); + } + #endif + + var emissive = pbrMaterial.emissiveFactor; + #ifdef HAS_EMISSIVEMAP + if (pbrMaterial.emissiveMapEnabled != 0u) { + emissive *= SRGBtoLINEAR( + textureSample(pbr_emissiveSampler, pbr_emissiveSamplerSampler, emissiveUV) + ).rgb; + } + #endif + color += emissive * pbrMaterial.emissiveStrength; + + if (transmission > 0.0) { + color = mix(color, color * getVolumeAttenuation(thickness), transmission); + } + + // This section uses mix to override final color for reference app visualization + // of various parameters in the lighting equation. + #ifdef PBR_DEBUG + // TODO: Figure out how to debug multiple lights + + // color = mix(color, F, pbr_scaleFGDSpec.x); + // color = mix(color, vec3(G), pbr_scaleFGDSpec.y); + // color = mix(color, vec3(D), pbr_scaleFGDSpec.z); + // color = mix(color, specContrib, pbr_scaleFGDSpec.w); + + // color = mix(color, diffuseContrib, pbr_scaleDiffBaseMR.x); + color = mix(color, baseColor.rgb, pbrMaterial.scaleDiffBaseMR.y); + color = mix(color, vec3(metallic), pbrMaterial.scaleDiffBaseMR.z); + color = mix(color, vec3(perceptualRoughness), pbrMaterial.scaleDiffBaseMR.w); + #endif + } + + let alpha = clamp(baseColor.a * (1.0 - transmission), 0.0, 1.0); + return vec4(pow(color, vec3(1.0 / 2.2)), alpha); +} +`,Vd=`layout(std140) uniform pbrProjectionUniforms { + mat4 modelViewProjectionMatrix; + mat4 modelMatrix; + mat4 normalMatrix; + vec3 camera; +} pbrProjection; +`,Hd={props:{},uniforms:{},defaultUniforms:{unlit:!1,baseColorMapEnabled:!1,baseColorFactor:[1,1,1,1],normalMapEnabled:!1,normalScale:1,emissiveMapEnabled:!1,emissiveFactor:[0,0,0],metallicRoughnessValues:[1,1],metallicRoughnessMapEnabled:!1,occlusionMapEnabled:!1,occlusionStrength:1,alphaCutoffEnabled:!1,alphaCutoff:.5,IBLenabled:!1,scaleIBLAmbient:[1,1],scaleDiffBaseMR:[0,0,0,0],scaleFGDSpec:[0,0,0,0],specularColorFactor:[1,1,1],specularIntensityFactor:1,specularColorMapEnabled:!1,specularIntensityMapEnabled:!1,ior:1.5,transmissionFactor:0,transmissionMapEnabled:!1,thicknessFactor:0,attenuationDistance:1e9,attenuationColor:[1,1,1],clearcoatFactor:0,clearcoatRoughnessFactor:0,clearcoatMapEnabled:!1,clearcoatRoughnessMapEnabled:!1,sheenColorFactor:[0,0,0],sheenRoughnessFactor:0,sheenColorMapEnabled:!1,sheenRoughnessMapEnabled:!1,iridescenceFactor:0,iridescenceIor:1.3,iridescenceThicknessRange:[100,400],iridescenceMapEnabled:!1,anisotropyStrength:0,anisotropyRotation:0,anisotropyDirection:[1,0],anisotropyMapEnabled:!1,emissiveStrength:1,baseColorUVSet:0,baseColorUVTransform:[1,0,0,0,1,0,0,0,1],metallicRoughnessUVSet:0,metallicRoughnessUVTransform:[1,0,0,0,1,0,0,0,1],normalUVSet:0,normalUVTransform:[1,0,0,0,1,0,0,0,1],occlusionUVSet:0,occlusionUVTransform:[1,0,0,0,1,0,0,0,1],emissiveUVSet:0,emissiveUVTransform:[1,0,0,0,1,0,0,0,1],specularColorUVSet:0,specularColorUVTransform:[1,0,0,0,1,0,0,0,1],specularIntensityUVSet:0,specularIntensityUVTransform:[1,0,0,0,1,0,0,0,1],transmissionUVSet:0,transmissionUVTransform:[1,0,0,0,1,0,0,0,1],thicknessUVSet:0,thicknessUVTransform:[1,0,0,0,1,0,0,0,1],clearcoatUVSet:0,clearcoatUVTransform:[1,0,0,0,1,0,0,0,1],clearcoatRoughnessUVSet:0,clearcoatRoughnessUVTransform:[1,0,0,0,1,0,0,0,1],clearcoatNormalUVSet:0,clearcoatNormalUVTransform:[1,0,0,0,1,0,0,0,1],sheenColorUVSet:0,sheenColorUVTransform:[1,0,0,0,1,0,0,0,1],sheenRoughnessUVSet:0,sheenRoughnessUVTransform:[1,0,0,0,1,0,0,0,1],iridescenceUVSet:0,iridescenceUVTransform:[1,0,0,0,1,0,0,0,1],iridescenceThicknessUVSet:0,iridescenceThicknessUVTransform:[1,0,0,0,1,0,0,0,1],anisotropyUVSet:0,anisotropyUVTransform:[1,0,0,0,1,0,0,0,1]},name:`pbrMaterial`,firstBindingSlot:0,bindingLayout:[{name:`pbrMaterial`,group:3},{name:`pbr_baseColorSampler`,group:3},{name:`pbr_normalSampler`,group:3},{name:`pbr_emissiveSampler`,group:3},{name:`pbr_metallicRoughnessSampler`,group:3},{name:`pbr_occlusionSampler`,group:3},{name:`pbr_specularColorSampler`,group:3},{name:`pbr_specularIntensitySampler`,group:3},{name:`pbr_transmissionSampler`,group:3},{name:`pbr_thicknessSampler`,group:3},{name:`pbr_clearcoatSampler`,group:3},{name:`pbr_clearcoatRoughnessSampler`,group:3},{name:`pbr_clearcoatNormalSampler`,group:3},{name:`pbr_sheenColorSampler`,group:3},{name:`pbr_sheenRoughnessSampler`,group:3},{name:`pbr_iridescenceSampler`,group:3},{name:`pbr_iridescenceThicknessSampler`,group:3},{name:`pbr_anisotropySampler`,group:3}],dependencies:[xd,Md,{name:`pbrProjection`,bindingLayout:[{name:`pbrProjection`,group:0}],source:`struct pbrProjectionUniforms { + modelViewProjectionMatrix: mat4x4, + modelMatrix: mat4x4, + normalMatrix: mat4x4, + camera: vec3 +}; + +@group(0) @binding(auto) var pbrProjection: pbrProjectionUniforms; +`,vs:Vd,fs:Vd,getUniforms:e=>e,uniformTypes:{modelViewProjectionMatrix:`mat4x4`,modelMatrix:`mat4x4`,normalMatrix:`mat4x4`,camera:`vec3`}}],source:Bd,vs:Rd,fs:zd,defines:{LIGHTING_FRAGMENT:!0,HAS_NORMALMAP:!1,HAS_EMISSIVEMAP:!1,HAS_OCCLUSIONMAP:!1,HAS_BASECOLORMAP:!1,HAS_METALROUGHNESSMAP:!1,HAS_SPECULARCOLORMAP:!1,HAS_SPECULARINTENSITYMAP:!1,HAS_TRANSMISSIONMAP:!1,HAS_THICKNESSMAP:!1,HAS_CLEARCOATMAP:!1,HAS_CLEARCOATROUGHNESSMAP:!1,HAS_CLEARCOATNORMALMAP:!1,HAS_SHEENCOLORMAP:!1,HAS_SHEENROUGHNESSMAP:!1,HAS_IRIDESCENCEMAP:!1,HAS_IRIDESCENCETHICKNESSMAP:!1,HAS_ANISOTROPYMAP:!1,USE_MATERIAL_EXTENSIONS:!1,ALPHA_CUTOFF:!1,USE_IBL:!1,PBR_DEBUG:!1},getUniforms:e=>e,uniformTypes:{unlit:`i32`,baseColorMapEnabled:`i32`,baseColorFactor:`vec4`,normalMapEnabled:`i32`,normalScale:`f32`,emissiveMapEnabled:`i32`,emissiveFactor:`vec3`,metallicRoughnessValues:`vec2`,metallicRoughnessMapEnabled:`i32`,occlusionMapEnabled:`i32`,occlusionStrength:`f32`,alphaCutoffEnabled:`i32`,alphaCutoff:`f32`,specularColorFactor:`vec3`,specularIntensityFactor:`f32`,specularColorMapEnabled:`i32`,specularIntensityMapEnabled:`i32`,ior:`f32`,transmissionFactor:`f32`,transmissionMapEnabled:`i32`,thicknessFactor:`f32`,attenuationDistance:`f32`,attenuationColor:`vec3`,clearcoatFactor:`f32`,clearcoatRoughnessFactor:`f32`,clearcoatMapEnabled:`i32`,clearcoatRoughnessMapEnabled:`i32`,sheenColorFactor:`vec3`,sheenRoughnessFactor:`f32`,sheenColorMapEnabled:`i32`,sheenRoughnessMapEnabled:`i32`,iridescenceFactor:`f32`,iridescenceIor:`f32`,iridescenceThicknessRange:`vec2`,iridescenceMapEnabled:`i32`,anisotropyStrength:`f32`,anisotropyRotation:`f32`,anisotropyDirection:`vec2`,anisotropyMapEnabled:`i32`,emissiveStrength:`f32`,IBLenabled:`i32`,scaleIBLAmbient:`vec2`,scaleDiffBaseMR:`vec4`,scaleFGDSpec:`vec4`,baseColorUVSet:`i32`,baseColorUVTransform:`mat3x3`,metallicRoughnessUVSet:`i32`,metallicRoughnessUVTransform:`mat3x3`,normalUVSet:`i32`,normalUVTransform:`mat3x3`,occlusionUVSet:`i32`,occlusionUVTransform:`mat3x3`,emissiveUVSet:`i32`,emissiveUVTransform:`mat3x3`,specularColorUVSet:`i32`,specularColorUVTransform:`mat3x3`,specularIntensityUVSet:`i32`,specularIntensityUVTransform:`mat3x3`,transmissionUVSet:`i32`,transmissionUVTransform:`mat3x3`,thicknessUVSet:`i32`,thicknessUVTransform:`mat3x3`,clearcoatUVSet:`i32`,clearcoatUVTransform:`mat3x3`,clearcoatRoughnessUVSet:`i32`,clearcoatRoughnessUVTransform:`mat3x3`,clearcoatNormalUVSet:`i32`,clearcoatNormalUVTransform:`mat3x3`,sheenColorUVSet:`i32`,sheenColorUVTransform:`mat3x3`,sheenRoughnessUVSet:`i32`,sheenRoughnessUVTransform:`mat3x3`,iridescenceUVSet:`i32`,iridescenceUVTransform:`mat3x3`,iridescenceThicknessUVSet:`i32`,iridescenceThicknessUVTransform:`mat3x3`,anisotropyUVSet:`i32`,anisotropyUVTransform:`mat3x3`}},nee=`struct LayerUniforms { + opacity: f32, +}; + +@group(0) @binding(auto) +var layer: LayerUniforms; +`,Ud=`layout(std140) uniform layerUniforms { + uniform float opacity; +} layer; +`,ree={name:`layer`,source:nee,vs:Ud,fs:Ud,getUniforms:e=>({opacity:e.opacity**(1/2.2)}),uniformTypes:{opacity:`f32`}},Wd={name:`color`,dependencies:[],source:` + +@must_use +fn deckgl_premultiplied_alpha(fragColor: vec4) -> vec4 { + return vec4(fragColor.rgb * fragColor.a, fragColor.a); +}; +`,getUniforms:e=>({})},iee=`const SMOOTH_EDGE_RADIUS: f32 = 0.5; + +struct VertexGeometry { + position: vec4, + worldPosition: vec3, + worldPositionAlt: vec3, + normal: vec3, + uv: vec2, + pickingColor: vec3, +}; + +var geometry_: VertexGeometry = VertexGeometry( + vec4(0.0, 0.0, 1.0, 0.0), + vec3(0.0, 0.0, 0.0), + vec3(0.0, 0.0, 0.0), + vec3(0.0, 0.0, 0.0), + vec2(0.0, 0.0), + vec3(0.0, 0.0, 0.0) +); + +struct FragmentGeometry { + uv: vec2, +}; + +var fragmentGeometry: FragmentGeometry; + +fn smoothedge(edge: f32, x: f32) -> f32 { + return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x); +} +`,Gd=`#define SMOOTH_EDGE_RADIUS 0.5`,Kd={name:`geometry`,source:iee,vs:`\ +${Gd} + +struct VertexGeometry { + vec4 position; + vec3 worldPosition; + vec3 worldPositionAlt; + vec3 normal; + vec2 uv; + vec3 pickingColor; +} geometry = VertexGeometry( + vec4(0.0, 0.0, 1.0, 0.0), + vec3(0.0), + vec3(0.0), + vec3(0.0), + vec2(0.0), + vec3(0.0) +); +`,fs:`\ +${Gd} + +struct FragmentGeometry { + vec2 uv; +} geometry; + +float smoothedge(float edge, float x) { + return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x); +} +`},qd;(function(e){e[e.Start=1]=`Start`,e[e.Move=2]=`Move`,e[e.End=4]=`End`,e[e.Cancel=8]=`Cancel`})(qd||={});var Jd;(function(e){e[e.None=0]=`None`,e[e.Left=1]=`Left`,e[e.Right=2]=`Right`,e[e.Up=4]=`Up`,e[e.Down=8]=`Down`,e[e.Horizontal=3]=`Horizontal`,e[e.Vertical=12]=`Vertical`,e[e.All=15]=`All`})(Jd||={});var Yd;(function(e){e[e.Possible=1]=`Possible`,e[e.Began=2]=`Began`,e[e.Changed=4]=`Changed`,e[e.Ended=8]=`Ended`,e[e.Recognized=8]=`Recognized`,e[e.Cancelled=16]=`Cancelled`,e[e.Failed=32]=`Failed`})(Yd||={});var Xd=`auto`,Zd=`manipulation`,Qd=`none`,$d=`pan-x`,ef=`pan-y`;function tf(e){if(e.includes(`none`))return Qd;let t=e.includes($d),n=e.includes(ef);return t&&n?Qd:t||n?t?$d:ef:e.includes(`manipulation`)?Zd:Xd}var nf=class{constructor(e,t){this.actions=``,this.manager=e,this.set(t)}set(e){e===`compute`&&(e=this.compute()),this.manager.element&&(this.manager.element.style.touchAction=e,this.actions=e)}update(){this.set(this.manager.options.touchAction)}compute(){let e=[];for(let t of this.manager.recognizers)t.options.enable&&(e=e.concat(t.getTouchAction()));return tf(e.join(` `))}};function rf(e){return e.trim().split(/\s+/g)}function af(e,t,n){if(e)for(let r of rf(t))e.addEventListener(r,n,!1)}function of(e,t,n){if(e)for(let r of rf(t))e.removeEventListener(r,n,!1)}function sf(e){return(e.ownerDocument||e).defaultView}function cf(e,t){let n=e;for(;n;){if(n===t)return!0;n=n.parentNode}return!1}function lf(e){let t=e.length;if(t===1)return{x:Math.round(e[0].clientX),y:Math.round(e[0].clientY)};let n=0,r=0,i=0;for(;i=Math.abs(t)?e<0?Jd.Left:Jd.Right:t<0?Jd.Up:Jd.Down}function gf(e,t){let n=t.center,r=e.offsetDelta,i=e.prevDelta,a=e.prevInput;return(t.eventType===qd.Start||a?.eventType===qd.End)&&(i=e.prevDelta={x:a?.deltaX||0,y:a?.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),{deltaX:i.x+(n.x-r.x),deltaY:i.y+(n.y-r.y)}}function _f(e,t,n){return{x:t/e||0,y:n/e||0}}function vf(e,t){return ff(t[0],t[1])/ff(e[0],e[1])}function yf(e,t){return mf(t[1],t[0])-mf(e[1],e[0])}function bf(e,t){let n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,i,a,o,s;if(t.eventType!==qd.Cancel&&(r>25||n.velocity===void 0)){let c=t.deltaX-n.deltaX,l=t.deltaY-n.deltaY,u=_f(r,c,l);a=u.x,o=u.y,i=Math.abs(u.x)>Math.abs(u.y)?u.x:u.y,s=hf(c,l),e.lastInterval=t}else i=n.velocity,a=n.velocityX,o=n.velocityY,s=n.direction;t.velocity=i,t.velocityX=a,t.velocityY=o,t.direction=s}function aee(e,t){let{session:n}=e,{pointers:r}=t,{length:i}=r;n.firstInput||=uf(t),i>1&&!n.firstMultiple?n.firstMultiple=uf(t):i===1&&(n.firstMultiple=!1);let{firstInput:a,firstMultiple:o}=n,s=o?o.center:a.center,c=t.center=lf(r);t.timeStamp=Date.now(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=pf(s,c),t.distance=df(s,c);let{deltaX:l,deltaY:u}=gf(n,t);t.deltaX=l,t.deltaY=u,t.offsetDirection=hf(t.deltaX,t.deltaY);let d=_f(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=Math.abs(d.x)>Math.abs(d.y)?d.x:d.y,t.scale=o?vf(o.pointers,r):1,t.rotation=o?yf(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length;let f=e.element;return cf(t.srcEvent.target,f)&&(f=t.srcEvent.target),t.target=f,bf(n,t),t}function oee(e,t,n){let r=n.pointers.length,i=n.changedPointers.length,a=t&qd.Start&&r-i===0,o=t&(qd.End|qd.Cancel)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t;let s=aee(e,n);e.emit(`hammer.input`,s),e.recognize(s),e.session.prevInput=s}var xf=class{constructor(e){this.evEl=``,this.evWin=``,this.evTarget=``,this.domHandler=e=>{this.manager.options.enable&&this.handler(e)},this.manager=e,this.element=e.element,this.target=e.options.inputTarget||e.element}callback(e,t){oee(this.manager,e,t)}init(){af(this.element,this.evEl,this.domHandler),af(this.target,this.evTarget,this.domHandler),af(sf(this.element),this.evWin,this.domHandler)}destroy(){of(this.element,this.evEl,this.domHandler),of(this.target,this.evTarget,this.domHandler),of(sf(this.element),this.evWin,this.domHandler)}},Sf={pointerdown:qd.Start,pointermove:qd.Move,pointerup:qd.End,pointercancel:qd.Cancel,pointerout:qd.Cancel},Cf=`pointerdown`,wf=`pointermove pointerup pointercancel`,Tf=class extends xf{constructor(e){super(e),this.evEl=Cf,this.evWin=wf,this.store=this.manager.session.pointerEvents=[],this.init()}handler(e){let{store:t}=this,n=!1,r=Sf[e.type],i=e.pointerType,a=i===`touch`,o=t.findIndex(t=>t.pointerId===e.pointerId);r&qd.Start&&(e.buttons||a)?o<0&&(t.push(e),o=t.length-1):r&(qd.End|qd.Cancel)&&(n=!0),!(o<0)&&(t[o]=e,this.callback(r,{pointers:t,changedPointers:[e],eventType:r,pointerType:i,srcEvent:e}),n&&t.splice(o,1))}},Ef=[``,`webkit`,`Moz`,`MS`,`ms`,`o`];function Df(e,t){let n=t[0].toUpperCase()+t.slice(1);for(let r of Ef){let i=r?r+n:t;if(i in e)return i}}var Of=1,kf=2,Af={touchAction:`compute`,enable:!0,inputTarget:null,cssProps:{userSelect:`none`,userDrag:`none`,touchCallout:`none`,tapHighlightColor:`rgba(0,0,0,0)`}},jf=class{constructor(e,t){this.options={...Af,...t,cssProps:{...Af.cssProps,...t.cssProps},inputTarget:t.inputTarget||e},this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new Tf(this),this.touchAction=new nf(this,this.options.touchAction),this.toggleCssProps(!0)}set(e){return Object.assign(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this}stop(e){this.session.stopped=e?kf:Of}recognize(e){let{session:t}=this;if(t.stopped)return;this.session.prevented&&e.srcEvent.preventDefault();let n,{recognizers:r}=this,{curRecognizer:i}=t;(!i||i&&i.state&Yd.Recognized)&&(i=t.curRecognizer=null);let a=0;for(;a-1&&this.requireFail.splice(e,1)}return this}hasRequireFailures(){return!!this.requireFail.find(e=>e.options.enable)}canRecognizeWith(e){return!!this.simultaneous[e.id]}emit(e){if(!e)return;let{state:t}=this;t=Yd.Ended&&this.manager.emit(this.options.event+Pf(t),e)}tryEmit(e){this.canEmit()?this.emit(e):this.state=Yd.Failed}canEmit(){let e=0;for(;e{this.state=Yd.Recognized,this.tryEmit(this._input)},t.interval),Yd.Began):Yd.Recognized}return Yd.Failed}failTimeout(){return this._timer=setTimeout(()=>{this.state=Yd.Failed},this.options.interval),Yd.Failed}reset(){clearTimeout(this._timer)}emit(e){this.state===Yd.Recognized&&(e.tapCount=this.count,this.manager.emit(this.options.event,e))}},Rf=[``,`start`,`move`,`end`,`cancel`,`up`,`down`,`left`,`right`],zf=class extends If{constructor(e={}){super({enable:!0,pointers:1,event:`pan`,threshold:10,direction:Jd.All,...e}),this.pX=null,this.pY=null}getTouchAction(){let{options:{direction:e}}=this,t=[];return e&Jd.Horizontal&&t.push(ef),e&Jd.Vertical&&t.push($d),t}getEventNames(){return Rf.map(e=>this.options.event+e)}directionTest(e){let{options:t}=this,n=!0,{distance:r}=e,{direction:i}=e,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&Jd.Horizontal?(i=a===0?Jd.None:a<0?Jd.Left:Jd.Right,n=a!==this.pX,r=Math.abs(e.deltaX)):(i=o===0?Jd.None:o<0?Jd.Up:Jd.Down,n=o!==this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&!!(i&t.direction)}attrTest(e){return super.attrTest(e)&&(!!(this.state&Yd.Began)||!(this.state&Yd.Began)&&this.directionTest(e))}emit(e){this.pX=e.deltaX,this.pY=e.deltaY;let t=Jd[e.direction].toLowerCase();t&&(e.additionalEvent=this.options.event+t),super.emit(e)}},Bf=[``,`start`,`move`,`end`,`cancel`,`in`,`out`],Vf=class extends If{constructor(e={}){super({enable:!0,event:`pinch`,threshold:0,pointers:2,...e})}getTouchAction(){return[Qd]}getEventNames(){return Bf.map(e=>this.options.event+e)}attrTest(e){return super.attrTest(e)&&(Math.abs(e.scale-1)>this.options.threshold||!!(this.state&Yd.Began))}emit(e){if(e.scale!==1){let t=e.scale<1?`in`:`out`;e.additionalEvent=this.options.event+t}super.emit(e)}},Hf=class{constructor(e,t,n){this.element=e,this.callback=t,this.options=n}},Uf=typeof navigator<`u`&&navigator.userAgent?navigator.userAgent.toLowerCase():``;typeof window<`u`||global;var Wf=Uf.indexOf(`firefox`)!==-1,Gf=4.000244140625,Kf=40,qf=.25,Jf=class extends Hf{constructor(e,t,n){super(e,t,{enable:!0,...n}),this.handleEvent=e=>{if(!this.options.enable)return;let t=e.deltaY;globalThis.WheelEvent&&(Wf&&e.deltaMode===globalThis.WheelEvent.DOM_DELTA_PIXEL&&(t/=globalThis.devicePixelRatio),e.deltaMode===globalThis.WheelEvent.DOM_DELTA_LINE&&(t*=Kf)),t!==0&&t%Gf===0&&(t=Math.floor(t/Gf)),e.shiftKey&&t&&(t*=qf),this.callback({type:`wheel`,center:{x:e.clientX,y:e.clientY},delta:-t,srcEvent:e,pointerType:`mouse`,target:e.target})},e.addEventListener(`wheel`,this.handleEvent,{passive:!1})}destroy(){this.element.removeEventListener(`wheel`,this.handleEvent)}enableEventType(e,t){e===`wheel`&&(this.options.enable=t)}},Yf=[`mousedown`,`mousemove`,`mouseup`,`mouseover`,`mouseout`,`mouseleave`],Xf=class extends Hf{constructor(e,t,n){super(e,t,{enable:!0,...n}),this.handleEvent=e=>{this.handleOverEvent(e),this.handleOutEvent(e),this.handleEnterEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)},this.pressed=!1;let{enable:r}=this.options;this.enableMoveEvent=r,this.enableLeaveEvent=r,this.enableEnterEvent=r,this.enableOutEvent=r,this.enableOverEvent=r,Yf.forEach(t=>e.addEventListener(t,this.handleEvent))}destroy(){Yf.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){switch(e){case`pointermove`:this.enableMoveEvent=t;break;case`pointerover`:this.enableOverEvent=t;break;case`pointerout`:this.enableOutEvent=t;break;case`pointerenter`:this.enableEnterEvent=t;break;case`pointerleave`:this.enableLeaveEvent=t;break;default:}}handleOverEvent(e){this.enableOverEvent&&e.type===`mouseover`&&this._emit(`pointerover`,e)}handleOutEvent(e){this.enableOutEvent&&e.type===`mouseout`&&this._emit(`pointerout`,e)}handleEnterEvent(e){this.enableEnterEvent&&e.type===`mouseenter`&&this._emit(`pointerenter`,e)}handleLeaveEvent(e){this.enableLeaveEvent&&e.type===`mouseleave`&&this._emit(`pointerleave`,e)}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case`mousedown`:e.button>=0&&(this.pressed=!0);break;case`mousemove`:e.buttons===0&&(this.pressed=!1),this.pressed||this._emit(`pointermove`,e);break;case`mouseup`:this.pressed=!1;break;default:}}_emit(e,t){this.callback({type:e,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:`mouse`,target:t.target})}},Zf=[`keydown`,`keyup`],Qf=class extends Hf{constructor(e,t,n){super(e,t,{enable:!0,tabIndex:0,...n}),this.handleEvent=e=>{let t=e.target||e.srcElement;t.tagName===`INPUT`&&t.type===`text`||t.tagName===`TEXTAREA`||(this.enableDownEvent&&e.type===`keydown`&&this.callback({type:`keydown`,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&e.type===`keyup`&&this.callback({type:`keyup`,srcEvent:e,key:e.key,target:e.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,e.tabIndex=this.options.tabIndex,e.style.outline=`none`,Zf.forEach(t=>e.addEventListener(t,this.handleEvent))}destroy(){Zf.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===`keydown`&&(this.enableDownEvent=t),e===`keyup`&&(this.enableUpEvent=t)}},$f=class extends Hf{constructor(e,t,n){super(e,t,n),this.handleEvent=e=>{this.options.enable&&this.callback({type:`contextmenu`,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:`mouse`,target:e.target})},e.addEventListener(`contextmenu`,this.handleEvent)}destroy(){this.element.removeEventListener(`contextmenu`,this.handleEvent)}enableEventType(e,t){e===`contextmenu`&&(this.options.enable=t)}},ep=1,tp=2,np=4,rp={pointerdown:ep,pointermove:tp,pointerup:np,mousedown:ep,mousemove:tp,mouseup:np},ip=0,ap=1,op=2,sp=1,cp=2,lp=4;function up(e){let t=rp[e.srcEvent.type];if(!t)return null;let{buttons:n,button:r}=e.srcEvent,i=!1,a=!1,o=!1;return t===tp?(i=!!(n&sp),a=!!(n&lp),o=!!(n&cp)):(i=r===ip,a=r===ap,o=r===op),{leftButton:i,middleButton:a,rightButton:o}}function dp(e,t){let n=e.center;if(!n)return null;let r=t.getBoundingClientRect(),i=r.width/t.offsetWidth||1,a=r.height/t.offsetHeight||1;return{center:n,offsetCenter:{x:(n.x-r.left-t.clientLeft)/i,y:(n.y-r.top-t.clientTop)/a}}}var fp={srcElement:`root`,priority:0},pp=class{constructor(e,t){this.handleEvent=e=>{if(this.isEmpty())return;let t=this._normalizeEvent(e),n=e.srcEvent.target;for(;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,`root`)},this.eventManager=e,this.recognizerName=t,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(e,t,n,r=!1,i=!1){let{handlers:a,handlersByElement:o}=this,s={...fp,...n},c=o.get(s.srcElement);c||(c=[],o.set(s.srcElement,c));let l={type:e,handler:t,srcElement:s.srcElement,priority:s.priority};r&&(l.once=!0),i&&(l.passive=!0),a.push(l),this._active=this._active||!l.passive;let u=c.length-1;for(;u>=0&&!(c[u].priority>=l.priority);)u--;c.splice(u+1,0,l)}remove(e,t){let{handlers:n,handlersByElement:r}=this;for(let i=n.length-1;i>=0;i--){let a=n[i];if(a.type===e&&a.handler===t){n.splice(i,1);let e=r.get(a.srcElement);e.splice(e.indexOf(a),1),e.length===0&&r.delete(a.srcElement)}}this._active=n.some(e=>!e.passive)}_emit(e,t){let n=this.handlersByElement.get(t);if(n){let t=!1,r=()=>{e.handled=!0},i=()=>{e.handled=!0,t=!0},a=[];for(let o=0;o{e.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:t}}};function mp(e){if(`recognizer`in e)return e;let t,n=Array.isArray(e)?[...e]:[e];return t=typeof n[0]==`function`?new(n.shift())(n.shift()||{}):n.shift(),{recognizer:t,recognizeWith:typeof n[0]==`string`?[n[0]]:n[0],requireFailure:typeof n[1]==`string`?[n[1]]:n[1]}}var hp=class{constructor(e=null,t={}){if(this._onBasicInput=e=>{this.manager.emit(e.srcEvent.type,e)},this._onOtherEvent=e=>{this.manager.emit(e.type,e)},this.options={recognizers:[],events:{},touchAction:`compute`,tabIndex:0,cssProps:{},...t},this.events=new Map,this.element=e,e){this.manager=new jf(e,this.options);for(let e of this.options.recognizers){let{recognizer:t,recognizeWith:n,requireFailure:r}=mp(e);this.manager.add(t),n&&t.recognizeWith(n),r&&t.requireFailure(r)}this.manager.on(`hammer.input`,this._onBasicInput),this.wheelInput=new Jf(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Xf(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Qf(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new $f(e,this._onOtherEvent,{enable:!1}),this.on(this.options.events)}}getElement(){return this.element}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy())}on(e,t,n){this._addEventHandler(e,t,n,!1)}once(e,t,n){this._addEventHandler(e,t,n,!0)}watch(e,t,n){this._addEventHandler(e,t,n,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){let{manager:n}=this;if(!n)return;let r=n.get(e);r&&(r.set({enable:t}),n.touchAction.update()),this.wheelInput?.enableEventType(e,t),this.moveInput?.enableEventType(e,t),this.keyInput?.enableEventType(e,t),this.contextmenuInput?.enableEventType(e,t)}_addEventHandler(e,t,n,r,i){if(typeof e!=`string`){n=t;for(let[t,a]of Object.entries(e))this._addEventHandler(t,a,n,r,i);return}let{manager:a,events:o}=this;if(!a)return;let s=o.get(e);if(!s){let t=this._getRecognizerName(e)||e;s=new pp(this,t),o.set(e,s),a&&a.on(e,s.handleEvent)}s.add(e,t,n,r,i),s.isEmpty()||this._toggleRecognizer(s.recognizerName,!0)}_removeEventHandler(e,t){if(typeof e!=`string`){for(let[t,n]of Object.entries(e))this._removeEventHandler(t,n);return}let{events:n}=this,r=n.get(e);if(r&&(r.remove(e,t),r.isEmpty())){let{recognizerName:e}=r,t=!1;for(let r of n.values())if(r.recognizerName===e&&!r.isEmpty()){t=!0;break}t||this._toggleRecognizer(e,!1)}}_getRecognizerName(e){return this.manager.recognizers.find(t=>t.getEventNames().includes(e))?.options.event}},gp={DEFAULT:`default`,LNGLAT:`lnglat`,METER_OFFSETS:`meter-offsets`,LNGLAT_OFFSETS:`lnglat-offsets`,CARTESIAN:`cartesian`};Object.defineProperty(gp,"IDENTITY",{get:()=>(fo.deprecated(`COORDINATE_SYSTEM.IDENTITY`,`COORDINATE_SYSTEM.CARTESIAN`)(),gp.CARTESIAN)});var _p={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},vp={common:0,meters:1,pixels:2},yp={click:`onClick`,dblclick:`onClick`,panstart:`onDragStart`,panmove:`onDrag`,panend:`onDragEnd`},bp={multipan:[zf,{threshold:10,direction:Jd.Vertical,pointers:2}],pinch:[Vf,{},null,[`multipan`]],pan:[zf,{threshold:1},[`pinch`],[`multipan`]],dblclick:[Lf,{event:`dblclick`,taps:2}],click:[Lf,{event:`click`},null,[`dblclick`]]};function xp(e,t){if(e===t)return!0;if(Array.isArray(e)){let n=e.length;if(!t||t.length!==n)return!1;for(let r=0;r{for(let i in r)if(!xp(r[i],t[i])){n=e(r),t=r;break}return n}}var Cp=[0,0,0,0],wp=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],Tp=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Ep=[0,0,0],Dp=[0,0,0],Op={default:-1,cartesian:0,lnglat:1,"meter-offsets":2,"lnglat-offsets":3};function kp(e){let t=Op[e];if(t===void 0)throw Error(`Invalid coordinateSystem: ${e}`);return t}var Ap=Sp(Pp);function jp(e,t,n=Dp){n.length<3&&(n=[n[0],n[1],0]);let r=n,i,a=!0;switch(i=t===`lnglat-offsets`||t===`meter-offsets`?n:e.isGeospatial?[Math.fround(e.longitude),Math.fround(e.latitude),0]:null,e.projectionMode){case _p.WEB_MERCATOR:(t===`lnglat`||t===`cartesian`)&&(i=[0,0,0],a=!1);break;case _p.WEB_MERCATOR_AUTO_OFFSET:t===`lnglat`?r=i:t===`cartesian`&&(r=[Math.fround(e.center[0]),Math.fround(e.center[1]),0],i=e.unprojectPosition(r),r[0]-=n[0],r[1]-=n[1],r[2]-=n[2]);break;case _p.IDENTITY:r=e.position.map(Math.fround),r[2]=r[2]||0;break;case _p.GLOBE:a=!1,i=null;break;default:a=!1}return{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:a}}function Mp(e,t,n){let{viewMatrixUncentered:r,projectionMatrix:i}=e,{viewMatrix:a,viewProjectionMatrix:o}=e,s=Cp,c=Cp,l=e.cameraPosition,{geospatialOrigin:u,shaderCoordinateOrigin:d,offsetMode:f}=jp(e,t,n);return f&&(c=e.projectPosition(u||d),l=[l[0]-c[0],l[1]-c[1],l[2]-c[2]],c[3]=1,s=gu([],c,o),a=r||a,o=Yl([],i,a),o=Yl([],o,wp)),{viewMatrix:a,viewProjectionMatrix:o,projectionCenter:s,originCommon:c,cameraPosCommon:l,shaderCoordinateOrigin:d,geospatialOrigin:u}}function Np({viewport:e,devicePixelRatio:t=1,modelMatrix:n=null,coordinateSystem:r=`default`,coordinateOrigin:i=Dp,autoWrapLongitude:a=!1}){r==="default"&&(r=e.isGeospatial?`lnglat`:`cartesian`);let o=Ap({viewport:e,devicePixelRatio:t,coordinateSystem:r,coordinateOrigin:i});return o.wrapLongitude=a,o.modelMatrix=n||Tp,o}function Pp({viewport:e,devicePixelRatio:t,coordinateSystem:n,coordinateOrigin:r}){let{projectionCenter:i,viewProjectionMatrix:a,originCommon:o,cameraPosCommon:s,shaderCoordinateOrigin:c,geospatialOrigin:l}=Mp(e,n,r),u=e.getDistanceScales(),d=[e.width*t,e.height*t],f=gu([],[0,0,-e.focalDistance,1],e.projectionMatrix)[3]||1,p={coordinateSystem:kp(n),projectionMode:e.projectionMode,coordinateOrigin:c,commonOrigin:o.slice(0,3),center:i,pseudoMeters:!!e._pseudoMeters,viewportSize:d,devicePixelRatio:t,focalDistance:f,commonUnitsPerMeter:u.unitsPerMeter,commonUnitsPerWorldUnit:u.unitsPerMeter,commonUnitsPerWorldUnit2:Ep,scale:e.scale,wrapLongitude:!1,viewProjectionMatrix:a,modelMatrix:Tp,cameraPosition:s};if(l){let t=e.getDistanceScales(l);switch(n){case`meter-offsets`:p.commonUnitsPerWorldUnit=t.unitsPerMeter,p.commonUnitsPerWorldUnit2=t.unitsPerMeter2;break;case`lnglat`:case`lnglat-offsets`:e._pseudoMeters||(p.commonUnitsPerMeter=t.unitsPerMeter),p.commonUnitsPerWorldUnit=t.unitsPerDegree,p.commonUnitsPerWorldUnit2=t.unitsPerDegree2;break;case`cartesian`:p.commonUnitsPerWorldUnit=[1,1,t.unitsPerMeter[2]],p.commonUnitsPerWorldUnit2=[0,0,t.unitsPerMeter2[2]];break;default:break}}return p}var Fp=`\ +${`\ +${[`default`,`lnglat`,`meter-offsets`,`lnglat-offsets`,`cartesian`].map(e=>`const COORDINATE_SYSTEM_${e.toUpperCase().replaceAll(`-`,`_`)}: i32 = ${kp(e)};`).join(``)} +${Object.keys(_p).map(e=>`const PROJECTION_MODE_${e}: i32 = ${_p[e]};`).join(``)} +${Object.keys(vp).map(e=>`const UNIT_${e.toUpperCase()}: i32 = ${vp[e]};`).join(``)} + +const TILE_SIZE: f32 = 512.0; +const PI: f32 = 3.1415926536; +const WORLD_SCALE: f32 = TILE_SIZE / (PI * 2.0); +const ZERO_64_LOW: vec3 = vec3(0.0, 0.0, 0.0); +const EARTH_RADIUS: f32 = 6370972.0; // meters +const GLOBE_RADIUS: f32 = 256.0; + +// ----------------------------------------------------------------------------- +// Uniform block (converted from GLSL uniform block) +// ----------------------------------------------------------------------------- +struct ProjectUniforms { + wrapLongitude: i32, + coordinateSystem: i32, + commonUnitsPerMeter: vec3, + projectionMode: i32, + scale: f32, + commonUnitsPerWorldUnit: vec3, + commonUnitsPerWorldUnit2: vec3, + center: vec4, + modelMatrix: mat4x4, + viewProjectionMatrix: mat4x4, + viewportSize: vec2, + devicePixelRatio: f32, + focalDistance: f32, + cameraPosition: vec3, + coordinateOrigin: vec3, + commonOrigin: vec3, + pseudoMeters: i32, +}; + +@group(0) @binding(auto) +var project: ProjectUniforms; + +// ----------------------------------------------------------------------------- +// Geometry data shared across the project helpers. +// The active layer shader is responsible for populating this private module +// state before calling the project functions below. +// ----------------------------------------------------------------------------- + +// Structure to carry additional geometry data used by deck.gl filters. +struct Geometry { + worldPosition: vec3, + worldPositionAlt: vec3, + position: vec4, + normal: vec3, + uv: vec2, + pickingColor: vec3, +}; + +var geometry: Geometry; +`} + +// ----------------------------------------------------------------------------- +// Functions +// ----------------------------------------------------------------------------- + +// Returns an adjustment factor for commonUnitsPerMeter +fn _project_size_at_latitude(lat: f32) -> f32 { + let y = clamp(lat, -89.9, 89.9); + return 1.0 / cos(radians(y)); +} + +// Overloaded version: scales a value in meters at a given latitude. +fn _project_size_at_latitude_m(meters: f32, lat: f32) -> f32 { + return meters * project.commonUnitsPerMeter.z * _project_size_at_latitude(lat); +} + +// Computes a non-linear scale factor based on geometry. +// (Note: This function relies on "geometry" being provided.) +fn project_size() -> f32 { + if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR && + project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT && + project.pseudoMeters == 0) { + if (geometry.position.w == 0.0) { + return _project_size_at_latitude(geometry.worldPosition.y); + } + let y: f32 = geometry.position.y / TILE_SIZE * 2.0 - 1.0; + let y2 = y * y; + let y4 = y2 * y2; + let y6 = y4 * y2; + return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6; + } + return 1.0; +} + +// Overloads to scale offsets (meters to world units) +fn project_size_float(meters: f32) -> f32 { + return meters * project.commonUnitsPerMeter.z * project_size(); +} + +fn project_size_vec2(meters: vec2) -> vec2 { + return meters * project.commonUnitsPerMeter.xy * project_size(); +} + +fn project_size_vec3(meters: vec3) -> vec3 { + return meters * project.commonUnitsPerMeter * project_size(); +} + +fn project_size_vec4(meters: vec4) -> vec4 { + return vec4(meters.xyz * project.commonUnitsPerMeter, meters.w); +} + +// Returns a rotation matrix aligning the z‑axis with the given up vector. +fn project_get_orientation_matrix(up: vec3) -> mat3x3 { + let uz = normalize(up); + let ux = select( + vec3(1.0, 0.0, 0.0), + normalize(vec3(uz.y, -uz.x, 0.0)), + abs(uz.z) == 1.0 + ); + let uy = cross(uz, ux); + return mat3x3(ux, uy, uz); +} + +// Since WGSL does not support "out" parameters, we return a struct. +struct RotationResult { + needsRotation: bool, + transform: mat3x3, +}; + +fn project_needs_rotation(commonPosition: vec3) -> RotationResult { + if (project.projectionMode == PROJECTION_MODE_GLOBE) { + return RotationResult(true, project_get_orientation_matrix(commonPosition)); + } else { + return RotationResult(false, mat3x3()); // identity alternative if needed + }; +} + +// Projects a normal vector from the current coordinate system to world space. +fn project_normal(vector: vec3) -> vec3 { + let normal_modelspace = project.modelMatrix * vec4(vector, 0.0); + var n = normalize(normal_modelspace.xyz * project.commonUnitsPerMeter); + let rotResult = project_needs_rotation(geometry.position.xyz); + if (rotResult.needsRotation) { + n = rotResult.transform * n; + } + return n; +} + +// Applies a scale offset based on y-offset (dy) +fn project_offset_(offset: vec4) -> vec4 { + let dy: f32 = offset.y; + let commonUnitsPerWorldUnit = project.commonUnitsPerWorldUnit + project.commonUnitsPerWorldUnit2 * dy; + return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w); +} + +// Projects lng/lat coordinates to a unit tile [0,1] +fn project_mercator_(lnglat: vec2) -> vec2 { + var x = lnglat.x; + if (project.wrapLongitude != 0) { + x = ((x + 180.0) % 360.0) - 180.0; + } + let y = clamp(lnglat.y, -89.9, 89.9); + return vec2( + radians(x) + PI, + PI + log(tan(PI * 0.25 + radians(y) * 0.5)) + ) * WORLD_SCALE; +} + +// Projects lng/lat/z coordinates for a globe projection. +fn project_globe_(lnglatz: vec3) -> vec3 { + let lambda = radians(lnglatz.x); + let phi = radians(lnglatz.y); + let cosPhi = cos(phi); + let D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS; + return vec3( + sin(lambda) * cosPhi, + -cos(lambda) * cosPhi, + sin(phi) + ) * D; +} + +// Projects positions (with an optional 64-bit low part) from the input +// coordinate system to the common space. +fn project_position_vec4_f64(position: vec4, position64Low: vec3) -> vec4 { + var position_world = project.modelMatrix * position; + + // Work around for a Mac+NVIDIA bug: + if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR) { + if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { + return vec4( + project_mercator_(position_world.xy), + _project_size_at_latitude_m(position_world.z, position_world.y), + position_world.w + ); + } + if (project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN) { + position_world = vec4f(position_world.xyz + project.coordinateOrigin, position_world.w); + } + } + if (project.projectionMode == PROJECTION_MODE_GLOBE) { + if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { + return vec4( + project_globe_(position_world.xyz), + position_world.w + ); + } + } + if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) { + if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { + if (abs(position_world.y - project.coordinateOrigin.y) > 0.25) { + return vec4( + project_mercator_(position_world.xy) - project.commonOrigin.xy, + project_size_float(position_world.z), + position_world.w + ); + } + } + } + if (project.projectionMode == PROJECTION_MODE_IDENTITY || + (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET && + (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT || + project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) { + position_world = vec4f(position_world.xyz - project.coordinateOrigin, position_world.w); + } + + return project_offset_(position_world) + + project_offset_(project.modelMatrix * vec4(position64Low, 0.0)); +} + +// Overloaded versions for different input types. +fn project_position_vec4_f32(position: vec4) -> vec4 { + return project_position_vec4_f64(position, ZERO_64_LOW); +} + +fn project_position_vec3_f64(position: vec3, position64Low: vec3) -> vec3 { + let projected_position = project_position_vec4_f64(vec4(position, 1.0), position64Low); + return projected_position.xyz; +} + +fn project_position_vec3_f32(position: vec3) -> vec3 { + let projected_position = project_position_vec4_f64(vec4(position, 1.0), ZERO_64_LOW); + return projected_position.xyz; +} + +fn project_position_vec2_f32(position: vec2) -> vec2 { + let projected_position = project_position_vec4_f64(vec4(position, 0.0, 1.0), ZERO_64_LOW); + return projected_position.xy; +} + +// Transforms a common space position to clip space. +fn project_common_position_to_clipspace_with_projection(position: vec4, viewProjectionMatrix: mat4x4, center: vec4) -> vec4 { + return viewProjectionMatrix * position + center; +} + +// Uses the project viewProjectionMatrix and center. +fn project_common_position_to_clipspace(position: vec4) -> vec4 { + return project_common_position_to_clipspace_with_projection(position, project.viewProjectionMatrix, project.center); +} + +// Returns a clip space offset corresponding to a given number of screen pixels. +fn project_pixel_size_to_clipspace(pixels: vec2) -> vec2 { + let offset = pixels / project.viewportSize * project.devicePixelRatio * 2.0; + return offset * project.focalDistance; +} + +fn project_meter_size_to_pixel(meters: f32) -> f32 { + return project_size_float(meters) * project.scale; +} + +fn project_unit_size_to_pixel(size: f32, unit: i32) -> f32 { + if (unit == UNIT_METERS) { + return project_meter_size_to_pixel(size); + } else if (unit == UNIT_COMMON) { + return size * project.scale; + } + // UNIT_PIXELS: no scaling applied. + return size; +} + +fn project_pixel_size_float(pixels: f32) -> f32 { + return pixels / project.scale; +} + +fn project_pixel_size_vec2(pixels: vec2) -> vec2 { + return pixels / project.scale; +} +`,Ip=`\ +${[`default`,`lnglat`,`meter-offsets`,`lnglat-offsets`,`cartesian`].map(e=>`const int COORDINATE_SYSTEM_${e.toUpperCase().replaceAll(`-`,`_`)} = ${kp(e)};`).join(``)} +${Object.keys(_p).map(e=>`const int PROJECTION_MODE_${e} = ${_p[e]};`).join(``)} +${Object.keys(vp).map(e=>`const int UNIT_${e.toUpperCase()} = ${vp[e]};`).join(``)} +layout(std140) uniform projectUniforms { +bool wrapLongitude; +int coordinateSystem; +vec3 commonUnitsPerMeter; +int projectionMode; +float scale; +vec3 commonUnitsPerWorldUnit; +vec3 commonUnitsPerWorldUnit2; +vec4 center; +mat4 modelMatrix; +mat4 viewProjectionMatrix; +vec2 viewportSize; +float devicePixelRatio; +float focalDistance; +vec3 cameraPosition; +vec3 coordinateOrigin; +vec3 commonOrigin; +bool pseudoMeters; +} project; +const float TILE_SIZE = 512.0; +const float PI = 3.1415926536; +const float WORLD_SCALE = TILE_SIZE / (PI * 2.0); +const vec3 ZERO_64_LOW = vec3(0.0); +const float EARTH_RADIUS = 6370972.0; +const float GLOBE_RADIUS = 256.0; +float project_size_at_latitude(float lat) { +float y = clamp(lat, -89.9, 89.9); +return 1.0 / cos(radians(y)); +} +float project_size() { +if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR && +project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT && +project.pseudoMeters == false) { +if (geometry.position.w == 0.0) { +return project_size_at_latitude(geometry.worldPosition.y); +} +float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0; +float y2 = y * y; +float y4 = y2 * y2; +float y6 = y4 * y2; +return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6; +} +return 1.0; +} +float project_size_at_latitude(float meters, float lat) { +return meters * project.commonUnitsPerMeter.z * project_size_at_latitude(lat); +} +float project_size(float meters) { +return meters * project.commonUnitsPerMeter.z * project_size(); +} +vec2 project_size(vec2 meters) { +return meters * project.commonUnitsPerMeter.xy * project_size(); +} +vec3 project_size(vec3 meters) { +return meters * project.commonUnitsPerMeter * project_size(); +} +vec4 project_size(vec4 meters) { +return vec4(meters.xyz * project.commonUnitsPerMeter, meters.w); +} +mat3 project_get_orientation_matrix(vec3 up) { +vec3 uz = normalize(up); +vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0)); +vec3 uy = cross(uz, ux); +return mat3(ux, uy, uz); +} +bool project_needs_rotation(vec3 commonPosition, out mat3 transform) { +if (project.projectionMode == PROJECTION_MODE_GLOBE) { +transform = project_get_orientation_matrix(commonPosition); +return true; +} +return false; +} +vec3 project_normal(vec3 vector) { +vec4 normal_modelspace = project.modelMatrix * vec4(vector, 0.0); +vec3 n = normalize(normal_modelspace.xyz * project.commonUnitsPerMeter); +mat3 rotation; +if (project_needs_rotation(geometry.position.xyz, rotation)) { +n = rotation * n; +} +return n; +} +vec4 project_offset_(vec4 offset) { +float dy = offset.y; +vec3 commonUnitsPerWorldUnit = project.commonUnitsPerWorldUnit + project.commonUnitsPerWorldUnit2 * dy; +return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w); +} +vec2 project_mercator_(vec2 lnglat) { +float x = lnglat.x; +if (project.wrapLongitude) { +x = mod(x + 180., 360.0) - 180.; +} +float y = clamp(lnglat.y, -89.9, 89.9); +return vec2( +radians(x) + PI, +PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5)) +) * WORLD_SCALE; +} +vec3 project_globe_(vec3 lnglatz) { +float lambda = radians(lnglatz.x); +float phi = radians(lnglatz.y); +float cosPhi = cos(phi); +float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS; +return vec3( +sin(lambda) * cosPhi, +-cos(lambda) * cosPhi, +sin(phi) +) * D; +} +vec4 project_position(vec4 position, vec3 position64Low) { +vec4 position_world = project.modelMatrix * position; +if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR) { +if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { +return vec4( +project_mercator_(position_world.xy), +project_size_at_latitude(position_world.z, position_world.y), +position_world.w +); +} +if (project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN) { +position_world.xyz += project.coordinateOrigin; +} +} +if (project.projectionMode == PROJECTION_MODE_GLOBE) { +if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { +return vec4( +project_globe_(position_world.xyz), +position_world.w +); +} +} +if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) { +if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { +if (abs(position_world.y - project.coordinateOrigin.y) > 0.25) { +return vec4( +project_mercator_(position_world.xy) - project.commonOrigin.xy, +project_size(position_world.z), +position_world.w +); +} +} +} +if (project.projectionMode == PROJECTION_MODE_IDENTITY || +(project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET && +(project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT || +project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) { +position_world.xyz -= project.coordinateOrigin; +} +return project_offset_(position_world) + project_offset_(project.modelMatrix * vec4(position64Low, 0.0)); +} +vec4 project_position(vec4 position) { +return project_position(position, ZERO_64_LOW); +} +vec3 project_position(vec3 position, vec3 position64Low) { +vec4 projected_position = project_position(vec4(position, 1.0), position64Low); +return projected_position.xyz; +} +vec3 project_position(vec3 position) { +vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW); +return projected_position.xyz; +} +vec2 project_position(vec2 position) { +vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW); +return projected_position.xy; +} +vec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) { +return viewProjectionMatrix * position + center; +} +vec4 project_common_position_to_clipspace(vec4 position) { +return project_common_position_to_clipspace(position, project.viewProjectionMatrix, project.center); +} +vec2 project_pixel_size_to_clipspace(vec2 pixels) { +vec2 offset = pixels / project.viewportSize * project.devicePixelRatio * 2.0; +return offset * project.focalDistance; +} +float project_size_to_pixel(float meters) { +return project_size(meters) * project.scale; +} +vec2 project_size_to_pixel(vec2 meters) { +return project_size(meters) * project.scale; +} +float project_size_to_pixel(float size, int unit) { +if (unit == UNIT_METERS) return project_size_to_pixel(size); +if (unit == UNIT_COMMON) return size * project.scale; +return size; +} +float project_pixel_size(float pixels) { +return pixels / project.scale; +} +vec2 project_pixel_size(vec2 pixels) { +return pixels / project.scale; +} +`,Lp={};function Rp(e=Lp){return`viewport`in e?Np(e):{}}var zp={name:`project`,dependencies:[ld,Kd],source:Fp,vs:Ip,getUniforms:Rp,uniformTypes:{wrapLongitude:`f32`,coordinateSystem:`i32`,commonUnitsPerMeter:`vec3`,projectionMode:`i32`,scale:`f32`,commonUnitsPerWorldUnit:`vec3`,commonUnitsPerWorldUnit2:`vec3`,center:`vec4`,modelMatrix:`mat4x4`,viewProjectionMatrix:`mat4x4`,viewportSize:`vec2`,devicePixelRatio:`f32`,focalDistance:`f32`,cameraPosition:`vec3`,coordinateOrigin:`vec3`,commonOrigin:`vec3`,pseudoMeters:`f32`}},Bp={name:`project32`,dependencies:[zp],source:`// Define a structure to hold both the clip-space position and the common position. +struct ProjectResult { + clipPosition: vec4, + commonPosition: vec4, +}; + +// This function mimics the GLSL version with the 'out' parameter by returning both values. +fn project_position_to_clipspace_and_commonspace( + position: vec3, + position64Low: vec3, + offset: vec3 +) -> ProjectResult { + // Compute the projected position. + let projectedPosition: vec3 = project_position_vec3_f64(position, position64Low); + + // Start with the provided offset. + var finalOffset: vec3 = offset; + + // Get whether a rotation is needed and the rotation matrix. + let rotationResult = project_needs_rotation(projectedPosition); + + // If rotation is needed, update the offset. + if (rotationResult.needsRotation) { + finalOffset = rotationResult.transform * offset; + } + + // Compute the common position. + let commonPosition: vec4 = vec4(projectedPosition + finalOffset, 1.0); + + // Convert to clip-space. + let clipPosition: vec4 = project_common_position_to_clipspace(commonPosition); + + return ProjectResult(clipPosition, commonPosition); +} + +// A convenience overload that returns only the clip-space position. +fn project_position_to_clipspace( + position: vec3, + position64Low: vec3, + offset: vec3 +) -> vec4 { + return project_position_to_clipspace_and_commonspace(position, position64Low, offset).clipPosition; +} +`,vs:`vec4 project_position_to_clipspace( + vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition +) { + vec3 projectedPosition = project_position(position, position64Low); + mat3 rotation; + if (project_needs_rotation(projectedPosition, rotation)) { + // offset is specified as ENU + // when in globe projection, rotate offset so that the ground alighs with the surface of the globe + offset = rotation * offset; + } + commonPosition = vec4(projectedPosition + offset, 1.0); + return project_common_position_to_clipspace(commonPosition); +} + +vec4 project_position_to_clipspace( + vec3 position, vec3 position64Low, vec3 offset +) { + vec4 commonPosition; + return project_position_to_clipspace(position, position64Low, offset, commonPosition); +} +`},X=t(i(),1),Z=t(f()),Vp=t(de(),1);function Hp(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Up(e,t){let n=gu([],t,e);return fu(n,n,1/n[3]),n}function Wp(e,t,n){return en?n:e}function Gp(e){return Math.log(e)*Math.LOG2E}var Kp=Math.log2||Gp;function qp(e,t){if(!e)throw Error(t||`@math.gl/web-mercator: assertion failed.`)}var Jp=Math.PI,Yp=Jp/4,Xp=Jp/180,Zp=180/Jp,Qp=512,$p=4003e4,em=85.051129,tm=1.5;function nm(e){return Kp(e)}function rm(e){let[t,n]=e;qp(Number.isFinite(t)),qp(Number.isFinite(n)&&n>=-90&&n<=90,`invalid latitude`);let r=t*Xp,i=n*Xp;return[Qp*(r+Jp)/(2*Jp),Qp*(Jp+Math.log(Math.tan(Yp+i*.5)))/(2*Jp)]}function im(e){let[t,n]=e,r=t/Qp*(2*Jp)-Jp,i=2*(Math.atan(Math.exp(n/Qp*(2*Jp)-Jp))-Yp);return[r*Zp,i*Zp]}function am(e){let{latitude:t}=e;return qp(Number.isFinite(t)),nm($p*Math.cos(t*Xp))-9}function om(e){let t=Math.cos(e*Xp);return Qp/$p/t}function sm(e){let{latitude:t,longitude:n,highPrecision:r=!1}=e;qp(Number.isFinite(t)&&Number.isFinite(n));let i=Qp,a=Math.cos(t*Xp),o=i/360,s=o/a,c=i/$p/a,l={unitsPerMeter:[c,c,c],metersPerUnit:[1/c,1/c,1/c],unitsPerDegree:[o,s,c],degreesPerUnit:[1/o,1/s,1/c]};if(r){let e=Xp*Math.tan(t*Xp)/a,n=o*e/2,r=i/$p*e,u=r/s*c;l.unitsPerDegree2=[0,n,r],l.unitsPerMeter2=[u,0,u]}return l}function cm(e,t){let[n,r,i]=e,[a,o,s]=t,{unitsPerMeter:c,unitsPerMeter2:l}=sm({longitude:n,latitude:r,highPrecision:!0}),u=rm(e);u[0]+=a*(c[0]+l[0]*o),u[1]+=o*(c[1]+l[1]*o);let d=im(u),f=(i||0)+(s||0);return Number.isFinite(i)||Number.isFinite(s)?[d[0],d[1],f]:d}function lm(e){let{height:t,pitch:n,bearing:r,altitude:i,scale:a,center:o}=e,s=Hp();Xl(s,s,[0,0,-i]),$l(s,s,-n*Xp),tu(s,s,r*Xp);let c=a/t;return Zl(s,s,[c,c,c]),o&&Xl(s,s,ll([],o)),s}function um(e){let{width:t,height:n,altitude:r,pitch:i=0,offset:a,center:o,scale:s,nearZMultiplier:c=1,farZMultiplier:l=1}=e,{fovy:u=dm(tm)}=e;r!==void 0&&(u=dm(r));let d=u*Xp,f=i*Xp,p=fm(u),m=p;o&&(m+=o[2]*s/Math.cos(f)/n);let h=d*(.5+(a?a[1]:0)/n),g=Math.sin(h)*m/Math.sin(Wp(Math.PI/2-f-h,.01,Math.PI-.01)),_=Math.sin(f)*g+m,v=m*10,y=Math.min(_*l,v);return{fov:d,aspect:t/n,focalDistance:p,near:c,far:y}}function dm(e){return 2*Math.atan(.5/e)*Zp}function fm(e){return .5/Math.tan(.5*e*Xp)}function pm(e,t){let[n,r,i=0]=e;return qp(Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(i)),Up(t,[n,r,i,1])}function mm(e,t,n=0){let[r,i,a]=e;if(qp(Number.isFinite(r)&&Number.isFinite(i),`invalid pixel coordinate`),Number.isFinite(a))return Up(t,[r,i,a,1]);let o=Up(t,[r,i,0,1]),s=Up(t,[r,i,1,1]),c=o[2],l=s[2];return Kc([],o,s,c===l?0:((n||0)-c)/(l-c))}function see(e){let{width:t,height:n,bounds:r,minExtent:i=0,maxZoom:a=24,offset:o=[0,0]}=e,[[s,c],[l,u]]=r,d=cee(e.padding),f=rm([s,Wp(u,-em,em)]),p=rm([l,Wp(c,-em,em)]),m=[Math.max(Math.abs(p[0]-f[0]),i),Math.max(Math.abs(p[1]-f[1]),i)],h=[t-d.left-d.right-Math.abs(o[0])*2,n-d.top-d.bottom-Math.abs(o[1])*2];qp(h[0]>0&&h[1]>0);let g=h[0]/m[0],_=h[1]/m[1],v=(d.right-d.left)/2/g,y=(d.top-d.bottom)/2/_,b=im([(p[0]+f[0])/2+v,(p[1]+f[1])/2+y]),x=Math.min(a,Kp(Math.abs(Math.min(g,_))));return qp(Number.isFinite(x)),{longitude:b[0],latitude:b[1],zoom:x}}function cee(e=0){return typeof e==`number`?{top:e,bottom:e,left:e,right:e}:(qp(Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)),e)}var hm=Math.PI/180;function gm(e,t=0){let{width:n,height:r,unproject:i}=e,a={targetZ:t},o=i([0,r],a),s=i([n,r],a),c,l;return(e.fovy?.5*e.fovy*hm:Math.atan(.5/e.altitude))>(90-e.pitch)*hm-.01?(c=_m(e,0,t),l=_m(e,n,t)):(c=i([0,0],a),l=i([n,0],a)),[o,s,l,c]}function _m(e,t,n){let{pixelUnprojectionMatrix:r}=e,i=Up(r,[t,0,1,1]),a=Up(r,[t,e.height,1,1]),o=im(Kc([],i,a,(n*e.distanceScales.unitsPerMeter[2]-i[2])/(a[2]-i[2])));return o.push(n),o}var vm=` +layout(std140) uniform shadowUniforms { + bool drawShadowMap; + bool useShadowMap; + vec4 color; + highp int lightId; + float lightCount; + mat4 viewProjectionMatrix0; + mat4 viewProjectionMatrix1; + vec4 projectCenter0; + vec4 projectCenter1; +} shadow; +`,ym=` +${vm} + +const int max_lights = 2; + +out vec3 shadow_vPosition[max_lights]; + +vec4 shadow_setVertexPosition(vec4 position_commonspace) { + mat4 viewProjectionMatrices[max_lights]; + viewProjectionMatrices[0] = shadow.viewProjectionMatrix0; + viewProjectionMatrices[1] = shadow.viewProjectionMatrix1; + vec4 projectCenters[max_lights]; + projectCenters[0] = shadow.projectCenter0; + projectCenters[1] = shadow.projectCenter1; + + if (shadow.drawShadowMap) { + return project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[shadow.lightId], projectCenters[shadow.lightId]); + } + if (shadow.useShadowMap) { + for (int i = 0; i < max_lights; i++) { + if(i < int(shadow.lightCount)) { + vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[i], projectCenters[i]); + shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0; + } + } + } + return gl_Position; +} + +`,bm=` +${vm} + +const int max_lights = 2; +uniform sampler2D shadow_uShadowMap0; +uniform sampler2D shadow_uShadowMap1; + +in vec3 shadow_vPosition[max_lights]; + +const vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0); +const vec4 bitUnpackShift = 1.0 / bitPackShift; +const vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); + +float shadow_getShadowWeight(vec3 position, sampler2D shadowMap) { + vec4 rgbaDepth = texture(shadowMap, position.xy); + + float z = dot(rgbaDepth, bitUnpackShift); + return smoothstep(0.001, 0.01, position.z - z); +} + +vec4 shadow_filterShadowColor(vec4 color) { + if (shadow.drawShadowMap) { + vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift); + rgbaDepth -= rgbaDepth.gbaa * bitMask; + return rgbaDepth; + } + if (shadow.useShadowMap) { + float shadowAlpha = 0.0; + shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0); + if(shadow.lightCount > 1.0) { + shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1); + } + shadowAlpha *= shadow.color.a / shadow.lightCount; + float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha); + + return vec4( + mix(color.rgb, shadow.color.rgb, shadowAlpha / blendedAlpha), + blendedAlpha + ); + } + return color; +} + +`,xm=Sp(Em),Sm=Sp(Dm),Cm=[0,0,0,1],wm=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];function Tm(e,t){let[n,r,i]=e,a=mm([n,r,i],t);return Number.isFinite(i)?a:[a[0],a[1],0]}function Em({viewport:e,center:t}){return new wu(e.viewProjectionMatrix).invert().transform(t)}function Dm({viewport:e,shadowMatrices:t}){let n=[],r=e.pixelUnprojectionMatrix,i=e.isGeospatial?void 0:1,a=[[0,0,i],[e.width,0,i],[0,e.height,i],[e.width,e.height,i],[0,0,-1],[e.width,0,-1],[0,e.height,-1],[e.width,e.height,-1]].map(e=>Tm(e,r));for(let r of t){let t=r.clone().translate(new Y(e.center).negate()),i=a.map(e=>t.transform(e)),o=new wu().ortho({left:Math.min(...i.map(e=>e[0])),right:Math.max(...i.map(e=>e[0])),bottom:Math.min(...i.map(e=>e[1])),top:Math.max(...i.map(e=>e[1])),near:Math.min(...i.map(e=>-e[2])),far:Math.max(...i.map(e=>-e[2]))});n.push(o.multiplyRight(r))}return n}function Om(e){let{shadowEnabled:t=!0,project:n}=e;if(!t||!n||!e.shadowMatrices||!e.shadowMatrices.length)return{drawShadowMap:!1,useShadowMap:!1,shadow_uShadowMap0:e.dummyShadowMap,shadow_uShadowMap1:e.dummyShadowMap};let r=zp.getUniforms(n),i=xm({viewport:n.viewport,center:r.center}),a=[],o=Sm({shadowMatrices:e.shadowMatrices,viewport:n.viewport}).slice();for(let t=0;t0:!1,color:e.shadowColor||Cm,lightId:e.shadowLightId||0,lightCount:e.shadowMatrices.length,shadow_uShadowMap0:e.dummyShadowMap,shadow_uShadowMap1:e.dummyShadowMap};for(let e=0;e`,lightId:`i32`,lightCount:`f32`,viewProjectionMatrix0:`mat4x4`,viewProjectionMatrix1:`mat4x4`,projectCenter0:`vec4`,projectCenter1:`vec4`}},Am=`struct pickingUniforms { + isActive: f32, + isAttribute: f32, + isHighlightActive: f32, + useByteColors: f32, + highlightedObjectColor: vec3, + highlightColor: vec4, +}; + +@group(0) @binding(auto) var picking: pickingUniforms; + +fn picking_normalizeColor(color: vec3) -> vec3 { + return select(color, color / 255.0, picking.useByteColors > 0.5); +} + +fn picking_normalizeColor4(color: vec4) -> vec4 { + return select(color, color / 255.0, picking.useByteColors > 0.5); +} + +fn picking_isColorZero(color: vec3) -> bool { + return dot(color, vec3(1.0)) < 0.00001; +} + +fn picking_isColorValid(color: vec3) -> bool { + return dot(color, vec3(1.0)) > 0.00001; +} +`,jm={...md,source:Am,defaultUniforms:{...md.defaultUniforms,useByteColors:!0},inject:{"vs:DECKGL_FILTER_GL_POSITION":` + // for picking depth values + picking_setPickingAttribute(position.z / position.w); + `,"vs:DECKGL_FILTER_COLOR":` + picking_setPickingColor(geometry.pickingColor); + `,"fs:DECKGL_FILTER_COLOR":{order:99,injection:` + // use highlight color if this fragment belongs to the selected object. + color = picking_filterHighlightColor(color); + + // use picking color if rendering to picking FBO. + color = picking_filterPickingColor(color); + `}}},Mm=[Kd],Nm=[`vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)`,`vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)`,`vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)`,`fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)`],Pm=[];function Fm(e){let t=hc.getDefaultShaderAssembler();for(let e of Mm)t.addDefaultModule(e);t._hookFunctions.length=0;let n=e===`glsl`?Nm:Pm;for(let e of n)t.addShaderHook(e);return t}var Im=[255,255,255],Lm=1,Rm=0,zm=class{constructor(e={}){this.type=`ambient`;let{color:t=Im}=e,{intensity:n=Lm}=e;this.id=e.id||`ambient-${Rm++}`,this.color=t,this.intensity=n}},Bm=[255,255,255],Vm=1,Hm=[0,0,-1],Um=0,Wm=class{constructor(e={}){this.type=`directional`;let{color:t=Bm}=e,{intensity:n=Vm}=e,{direction:r=Hm}=e,{_shadow:i=!1}=e;this.id=e.id||`directional-${Um++}`,this.color=t,this.intensity=n,this.type=`directional`,this.direction=new Y(r).normalize().toArray(),this.shadow=i}getProjectedLight(e){return this}},Gm=class{constructor(e,t={id:`pass`}){let{id:n}=t;this.id=n,this.device=e,this.props={...t}}setProps(e){Object.assign(this.props,e)}render(e){}cleanup(){}},Km={depthWriteEnabled:!0,depthCompare:`less-equal`,blendColorOperation:`add`,blendColorSrcFactor:`src-alpha`,blendColorDstFactor:`one`,blendAlphaOperation:`add`,blendAlphaSrcFactor:`one-minus-dst-alpha`,blendAlphaDstFactor:`one`},qm=class extends Gm{constructor(){super(...arguments),this._lastRenderIndex=-1}render(e){this._render(e)}_render(e){let t=this.device.canvasContext,n=e.target??t.getCurrentFramebuffer(),[r,i]=t.getDrawingBufferSize(),a=e.clearCanvas??!0,o=e.clearColor??(a?[0,0,0,0]:!1),s=a?1:!1,c=a?0:!1,l=e.colorMask??15,u={viewport:[0,0,r,i]};e.colorMask&&(u.colorMask=l),e.scissorRect&&(u.scissorRect=e.scissorRect);let d=this.device.beginRenderPass({framebuffer:n,parameters:u,clearColor:o,clearDepth:s,clearStencil:c});try{return this._drawLayers(d,e)}finally{d.end(),this.device.submit()}}_drawLayers(e,t){let{target:n,shaderModuleProps:r,viewports:i,views:a,onViewportActive:o,clearStack:s=!0}=t;t.pass=t.pass||`unknown`,s&&(this._lastRenderIndex=-1);let c=[];for(let s of i){let i=a&&a[s.id];o?.(s);let l=this._getDrawLayerParams(s,t),u=s.subViewports||[s];for(let a of u){let o=this._drawLayersInViewport(e,{target:n,shaderModuleProps:r,viewport:a,view:i,pass:t.pass,layers:t.layers},l);c.push(o)}}return c}_getDrawLayerParams(e,{layers:t,pass:n,isPicking:r=!1,layerFilter:i,cullRect:a,views:o,effects:s,shaderModuleProps:c},l=!1){let u=[],d=Jm(this._lastRenderIndex+1),f={layer:t[0],viewport:e,isPicking:r,renderPass:n,cullRect:a},p={};for(let r=0;re/255):t===!1&&(e=!1),n!==void 0&&(a=n),r!==void 0&&(o=r),this.device.beginRenderPass({framebuffer:i,parameters:{viewport:c,scissorRect:c},clearColor:e,clearDepth:a,clearStencil:o}).end()}}let l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};e.setParameters({viewport:c});for(let n=0;n{let o=i.props._offset,s=i.id,c=i.parent&&i.parent.id,l;if(c&&!(c in t)&&r(i.parent,!1),c in n){let e=n[c]=n[c]||Jm(t[c],t);l=e(i,a),n[s]=e}else Number.isFinite(o)?(l=o+(t[c]||0),n[s]=null):l=e;return a&&l>=e&&(e=l+1),t[s]=l,l};return r}function Ym(e,{shaderModuleProps:t,target:n,viewport:r}){let i=t?.project?.devicePixelRatio??e.canvasContext.cssToDeviceRatio(),[,a]=e.canvasContext.getDrawingBufferSize(),o=n?n.height:a,s=r;return[s.x*i,o-(s.y+s.height)*i,s.width*i,s.height*i]}function Xm(e,...t){for(let n of t)if(n)for(let t in n)e[t]?Object.assign(e[t],n[t]):e[t]=n[t];return e}var Zm=class extends qm{constructor(e,t){super(e,t);let n=e.createTexture({format:`rgba8unorm`,width:1,height:1,sampler:{minFilter:`linear`,magFilter:`linear`,addressModeU:`clamp-to-edge`,addressModeV:`clamp-to-edge`}}),r=e.createTexture({format:`depth16unorm`,width:1,height:1});this.fbo=e.createFramebuffer({id:`shadowmap`,width:1,height:1,colorAttachments:[n],depthStencilAttachment:r})}delete(){this.fbo&&=(this.fbo.destroy(),null)}getShadowMap(){return this.fbo.colorAttachments[0].texture}render(e){let t=this.fbo,n=this.device.canvasContext.cssToDeviceRatio(),r=e.viewports[0],i=r.width*n,a=r.height*n,o=[1,1,1,1];(i!==t.width||a!==t.height)&&t.resize({width:i,height:a}),super.render({...e,clearColor:o,target:t,pass:`shadow`})}getLayerParameters(e,t,n){return{...e.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:`less-equal`}}shouldDrawLayer(e){return e.props.shadowEnabled!==!1}getShaderModuleProps(e,t,n){return{shadow:{project:n.project,drawToShadowMap:!0}}}},Qm={color:[255,255,255],intensity:1},$m=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],eh=[0,0,0,200/255],th=class{constructor(e={}){this.id=`lighting-effect`,this.shadowColor=eh,this.shadow=!1,this.directionalLights=[],this.pointLights=[],this.shadowPasses=[],this.dummyShadowMap=null,this.setProps(e)}setup(e){this.context=e;let{device:t,deck:n}=e;this.shadow&&!this.dummyShadowMap&&(this._createShadowPasses(t),n._addDefaultShaderModule(km),this.dummyShadowMap=t.createTexture({width:1,height:1}))}setProps(e){this.ambientLight=void 0,this.directionalLights=[],this.pointLights=[];for(let t in e){let n=e[t];switch(n.type){case`ambient`:this.ambientLight=n;break;case`directional`:this.directionalLights.push(n);break;case`point`:this.pointLights.push(n);break;default:}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(e=>e.shadow),this.context&&this.setup(this.context),this.props=e}preRender({layers:e,layerFilter:t,viewports:n,onViewportActive:r,views:i}){if(this.shadow){this.shadowMatrices=this._calculateMatrices();for(let a=0;ae.getShadowMap()),dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{},r={enabled:!0,lights:this._getLights(e)},i=e.props.material;return{shadow:n,lighting:r,phongMaterial:i,gouraudMaterial:i}}cleanup(e){for(let e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.dummyShadowMap&&(this.dummyShadowMap.destroy(),this.dummyShadowMap=null,e.deck._removeDefaultShaderModule(km))}_calculateMatrices(){let e=[];for(let t of this.directionalLights){let n=new wu().lookAt({eye:new Y(t.direction).negate()});e.push(n)}return e}_createShadowPasses(e){for(let t=0;tr&&(i=r);let a=this._pool,o=e.BYTES_PER_ELEMENT*i,s=a.findIndex(e=>e.byteLength>=o);if(s>=0){let t=new e(a.splice(s,1)[0],0,i);return n&&t.fill(0),t}return new e(i)}_release(e){if(!ArrayBuffer.isView(e))return;let t=this._pool,{buffer:n}=e,{byteLength:r}=n,i=t.findIndex(e=>e.byteLength>=r);i<0?t.push(n):(i>0||t.lengththis.opts.poolSize&&t.shift()}};function rh(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function ih(e,t){let n=e%t;return n<0?t+n:n}function ah(e){return[e[12],e[13],e[14]]}function oh(e){return{left:ch(e[3]+e[0],e[7]+e[4],e[11]+e[8],e[15]+e[12]),right:ch(e[3]-e[0],e[7]-e[4],e[11]-e[8],e[15]-e[12]),bottom:ch(e[3]+e[1],e[7]+e[5],e[11]+e[9],e[15]+e[13]),top:ch(e[3]-e[1],e[7]-e[5],e[11]-e[9],e[15]-e[13]),near:ch(e[3]+e[2],e[7]+e[6],e[11]+e[10],e[15]+e[14]),far:ch(e[3]-e[2],e[7]-e[6],e[11]-e[10],e[15]-e[14])}}var sh=new Y;function ch(e,t,n,r){sh.set(e,t,n);let i=sh.len();return{distance:r/i,normal:new Y(-e/i,-t/i,-n/i)}}function lh(e){return e-Math.fround(e)}var uh;function dh(e,t){let{size:n=1,startIndex:r=0}=t,i=t.endIndex===void 0?e.length:t.endIndex,a=(i-r)/n;uh=nh.allocate(uh,a,{type:Float32Array,size:n*2});let o=r,s=0;for(;o=t.delay+t.duration*t.repeat}getTime(e){if(e===void 0)return this.time;let t=this.channels.get(e);return t===void 0?-1:t.time}setTime(e){this.time=Math.max(0,e);let t=this.channels.values();for(let e of t)this._setChannelTime(e,this.time);let n=this.animations.values();for(let e of n){let{animation:t,channel:n}=e;t.setTime(this.getTime(n))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){let n=Eh++;return this.animations.set(n,{animation:e,channel:t}),e.setTime(this.getTime(t)),n}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){let n=t-e.delay;n>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,n)%e.duration,e.time*=e.rate)}};function Oh(e){let t=typeof window<`u`?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame:null;return t?t.call(window,e):setTimeout(()=>e(typeof performance<`u`?performance.now():Date.now()),1e3/60)}function kh(e){let t=typeof window<`u`?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame:null;if(t){t.call(window,e);return}clearTimeout(e)}var Ah=0,jh=`Animation Loop`,Mh=class e{static defaultAnimationLoopProps={device:null,onAddHTML:()=>``,onInitialize:async()=>null,onRender:()=>{},onFinalize:()=>{},onError:e=>console.error(e),stats:void 0,autoResizeViewport:!1};device=null;canvas=null;props;animationProps=null;timeline=null;stats;sharedStats;cpuTime;gpuTime;frameRate;display;_needsRedraw=`initialized`;_initialized=!1;_running=!1;_animationFrameId=null;_nextFramePromise=null;_resolveNextFrame=null;_cpuStartTime=0;_error=null;_lastFrameTime=0;constructor(t){if(this.props={...e.defaultAnimationLoopProps,...t},t=this.props,!t.device)throw Error(`No device provided`);this.stats=t.stats||new Te({id:`animation-loop-${Ah++}`}),this.sharedStats=Ve.stats.get(jh),this.frameRate=this.stats.get(`Frame Rate`),this.frameRate.setSampleSize(1),this.cpuTime=this.stats.get(`CPU Time`),this.gpuTime=this.stats.get(`GPU Time`),this.setProps({autoResizeViewport:t.autoResizeViewport}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}destroy(){this.stop(),this._setDisplay(null),this.device?._disableDebugGPUTime()}delete(){this.destroy()}reportError(e){this.props.onError(e),this._error=e}setNeedsRedraw(e){return this._needsRedraw=this._needsRedraw||e,this}needsRedraw(){let e=this._needsRedraw;return this._needsRedraw=!1,e}setProps(e){return`autoResizeViewport`in e&&(this.props.autoResizeViewport=e.autoResizeViewport||!1),this}async start(){if(this._running)return this;this._running=!0;try{if(!this._initialized){if(this._initialized=!0,await this._initDevice(),this._initialize(),!this._running)return null;await this.props.onInitialize(this._getAnimationProps())}return this._running?(this._cancelAnimationFrame(),this._requestAnimationFrame(),this):null}catch(e){let t=e instanceof Error?e:Error(`Unknown error`);throw this.props.onError(t),t}}stop(){return this._running&&(this.animationProps&&!this._error&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1,this._lastFrameTime=0),this}redraw(e){return this.device?.isLost||this._error?this:(this._beginFrameTimers(e),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&=(this._resolveNextFrame(this),this._nextFramePromise=null,null),this._endFrameTimers(),this)}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw(`waitForRender`),this._nextFramePromise||=new Promise(e=>{this._resolveNextFrame=e}),this._nextFramePromise}async toDataURL(){if(this.setNeedsRedraw(`toDataURL`),await this.waitForRender(),this.canvas instanceof HTMLCanvasElement)return this.canvas.toDataURL();throw Error(`OffscreenCanvas`)}_initialize(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeViewport(),this.device?._enableDebugGPUTime()}_setDisplay(e){this.display&&(this.display.destroy(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_requestAnimationFrame(){this._running&&(this._animationFrameId=Oh(this._animationFrame.bind(this)))}_cancelAnimationFrame(){this._animationFrameId!==null&&(kh(this._animationFrameId),this._animationFrameId=null)}_animationFrame(e){this._running&&(this.redraw(e),this._requestAnimationFrame())}_renderFrame(e){if(this.display){this.display._renderFrame(e);return}this.props.onRender(this._getAnimationProps()),this.device?.submit()}_clearNeedsRedraw(){this._needsRedraw=!1}_setupFrame(){this._resizeViewport()}_initializeAnimationProps(){let e=this.device?.getDefaultCanvasContext();if(!this.device||!e)throw Error(`loop`);let t=e?.canvas,n=e.props.useDevicePixels;this.animationProps={animationLoop:this,device:this.device,canvasContext:e,canvas:t,useDevicePixels:n,timeline:this.timeline,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}}_getAnimationProps(){if(!this.animationProps)throw Error(`animationProps`);return this.animationProps}_updateAnimationProps(){if(!this.animationProps)return;let{width:e,height:t,aspect:n}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw(`drawing buffer resized`),n!==this.animationProps.aspect&&this.setNeedsRedraw(`drawing buffer aspect changed`),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=n,this.animationProps.needsRedraw=this._needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}async _initDevice(){if(this.device=await this.props.device,!this.device)throw Error(`No device provided`);this.canvas=this.device.getDefaultCanvasContext().canvas||null}_createInfoDiv(){if(this.canvas&&this.props.onAddHTML){let e=document.createElement(`div`);document.body.appendChild(e),e.style.position=`relative`;let t=document.createElement(`div`);t.style.position=`absolute`,t.style.left=`10px`,t.style.bottom=`10px`,t.style.width=`300px`,t.style.background=`white`,this.canvas instanceof HTMLCanvasElement&&e.appendChild(this.canvas),e.appendChild(t);let n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}_getSizeAndAspect(){if(!this.device)return{width:1,height:1,aspect:1};let[e,t]=this.device.getDefaultCanvasContext().getDrawingBufferSize();return{width:e,height:t,aspect:e>0&&t>0?e/t:1}}_resizeViewport(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)}_beginFrameTimers(e){let t=e??(typeof performance<`u`?performance.now():Date.now());if(this._lastFrameTime){let e=t-this._lastFrameTime;e>0&&this.frameRate.addTime(e)}this._lastFrameTime=t,this.device?._isDebugGPUTimeEnabled()&&this._consumeEncodedGpuTime(),this.cpuTime.timeStart()}_endFrameTimers(){this.device?._isDebugGPUTimeEnabled()&&this._consumeEncodedGpuTime(),this.cpuTime.timeEnd(),this._updateSharedStats()}_consumeEncodedGpuTime(){if(!this.device)return;let e=this.device.commandEncoder._gpuTimeMs;e!==void 0&&(this.gpuTime.addTime(e),this.device.commandEncoder._gpuTimeMs=void 0)}_updateSharedStats(){if(this.stats!==this.sharedStats){for(let e of Object.keys(this.sharedStats.stats))this.stats.stats[e]||delete this.sharedStats.stats[e];this.stats.forEach(e=>{let t=this.sharedStats.get(e.name,e.type);t.sampleSize=e.sampleSize,t.time=e.time,t.count=e.count,t.samples=e.samples,t.lastTiming=e.lastTiming,t.lastSampleTime=e.lastSampleTime,t.lastSampleCount=e.lastSampleCount,t._count=e._count,t._time=e._time,t._samples=e._samples,t._startTime=e._startTime,t._timerPending=e._timerPending})}}_startEventHandling(){this.canvas&&(this.canvas.addEventListener(`mousemove`,this._onMousemove.bind(this)),this.canvas.addEventListener(`mouseleave`,this._onMouseleave.bind(this)))}_onMousemove(e){e instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[e.offsetX,e.offsetY])}_onMouseleave(e){this._getAnimationProps()._mousePosition=null}},Nh={};function Ph(e=`id`){return Nh[e]=Nh[e]||1,`${e}-${Nh[e]++}`}var Fh=class{id;userData={};topology;bufferLayout=[];vertexCount;indices;attributes;constructor(e){if(this.id=e.id||Ph(`geometry`),this.topology=e.topology,this.indices=e.indices||null,this.attributes=e.attributes,this.vertexCount=e.vertexCount,this.bufferLayout=e.bufferLayout||[],this.indices&&!(this.indices.usage&U.INDEX))throw Error(`Index buffer must have INDEX usage`)}destroy(){this.indices?.destroy();for(let e of Object.values(this.attributes))e.destroy()}getVertexCount(){return this.vertexCount}getAttributes(){return this.attributes}getIndexes(){return this.indices||null}_calculateVertexCount(e){return e.byteLength/12}};function Ih(e,t){if(t instanceof Fh)return t;let n=Lh(e,t),{attributes:r,bufferLayout:i}=Rh(e,t);return new Fh({topology:t.topology||`triangle-list`,bufferLayout:i,vertexCount:t.vertexCount,indices:n,attributes:r})}function Lh(e,t){if(!t.indices)return;let n=t.indices.value;return e.createBuffer({usage:U.INDEX,data:n})}function Rh(e,t){let n=[],r={};for(let[i,a]of Object.entries(t.attributes)){let t=i;switch(i){case`POSITION`:t=`positions`;break;case`NORMAL`:t=`normals`;break;case`TEXCOORD_0`:t=`texCoords`;break;case`TEXCOORD_1`:t=`texCoords1`;break;case`COLOR_0`:t=`colors`;break}if(a){r[t]=e.createBuffer({data:a.value,id:`${i}-buffer`});let{value:o,size:s,normalized:c}=a;if(s===void 0)throw Error(`Attribute ${i} is missing a size`);n.push({name:t,format:_e.getVertexFormatFromAttribute(o,s,c)})}}return{attributes:r,bufferLayout:n,vertexCount:t._calculateVertexCount(t.attributes,t.indices)}}function zh(e,t){let n={},r=`Values`;if(e.attributes.length===0&&!e.varyings?.length)return{"No attributes or varyings":{[r]:`N/A`}};for(let t of e.attributes)if(t){let e=`${t.location} ${t.name}: ${t.type}`;n[`in ${e}`]={[r]:t.stepMode||`vertex`}}for(let t of e.varyings||[]){let e=`${t.location} ${t.name}`;n[`out ${e}`]={[r]:JSON.stringify(t)}}return n}var Bh=`__debugFramebufferState`,Vh=8;function Hh(e,t,n){if(e.device.type!==`webgl`)return;let r=Gh(e.device);if(!r.flushing){if(qh(e)){Uh(e,n,r);return}t&&Kh(t)&&t.handle!==null&&(r.queuedFramebuffers.includes(t)||r.queuedFramebuffers.push(t))}}function Uh(e,t,n){if(n.queuedFramebuffers.length===0)return;let{gl:r}=e.device,i=r.getParameter(36010),a=r.getParameter(36006),[o,s]=e.device.getDefaultCanvasContext().getDrawingBufferSize(),c=Jh(t.top,Vh),l=Jh(t.left,Vh);n.flushing=!0;try{for(let e of n.queuedFramebuffers){let[n,i,a,u,d]=Wh({framebuffer:e,targetWidth:o,targetHeight:s,topPx:c,leftPx:l,minimap:t.minimap});r.bindFramebuffer(36008,e.handle),r.bindFramebuffer(36009,null),r.blitFramebuffer(0,0,e.width,e.height,n,i,a,u,16384,9728),c+=d+Vh}}finally{r.bindFramebuffer(36008,i),r.bindFramebuffer(36009,a),n.flushing=!1}}function Wh(e){let{framebuffer:t,targetWidth:n,targetHeight:r,topPx:i,leftPx:a,minimap:o}=e,s=o?Math.max(Math.floor(n/4),1):n,c=o?Math.max(Math.floor(r/4),1):r,l=Math.min(s/t.width,c/t.height),u=Math.max(Math.floor(t.width*l),1),d=Math.max(Math.floor(t.height*l),1),f=a,p=Math.max(r-i-d,0);return[f,p,f+u,p+d,d]}function Gh(e){return e.userData[Bh]||={flushing:!1,queuedFramebuffers:[]},e.userData[Bh]}function Kh(e){return`colorAttachments`in e}function qh(e){let t=e.props.framebuffer;return!t||t.handle===null}function Jh(e,t){if(!e)return t;let n=Number.parseInt(e,10);return Number.isFinite(n)?n:t}function Yh(e,t,n){if(e===t)return!0;if(!n||!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;rt.name===e)||null}getAttributeNamesForBuffer(e){return e.attributes?e.attributes?.map(e=>e.attribute):[e.name]}mergeBufferLayouts(e,t){let n=[...e];for(let e of t){let t=n.findIndex(t=>t.name===e.name);t<0?n.push(e):n[t]=e}return n}getBufferIndex(e){let t=this.bufferLayouts.findIndex(t=>t.name===e);return t===-1&&z.warn(`BufferLayout: Missing buffer for "${e}".`)(),t}};function Zh(e,t){let n=1/0;for(let r of e){let e=t[r];e!==void 0&&(n=Math.min(n,e))}return n}function Qh(e,t){let n=Object.fromEntries(e.attributes.map(e=>[e.name,e.location])),r=t.slice();return r.sort((e,t)=>{let r=e.attributes?e.attributes.map(e=>e.attribute):[e.name],i=t.attributes?t.attributes.map(e=>e.attribute):[t.name];return Zh(r,n)-Zh(i,n)}),r}function $h(e,t){if(!e||!t.some(e=>e.bindingLayout?.length))return e;let n={...e,bindings:e.bindings.map(e=>({...e}))};`attributes`in(e||{})&&(n.attributes=e?.attributes||[]);for(let e of t)for(let t of e.bindingLayout||[])for(let e of tg(t.name)){let r=n.bindings.find(t=>t.name===e);r?.group===0&&(r.group=t.group)}return n}function eg(e){return!!(e.uniformTypes&&!ng(e.uniformTypes))}function tg(e){let t=new Set([e,`${e}Uniforms`]);return e.endsWith(`Uniforms`)||t.add(`${e}Sampler`),[...t]}function ng(e){for(let t in e)return!1;return!0}function rg(e){return ra(e)||typeof e==`number`||typeof e==`boolean`}function ig(e,t={}){let n={bindings:{},uniforms:{}};return Object.keys(e).forEach(r=>{let i=e[r];Object.prototype.hasOwnProperty.call(t,r)||rg(i)?n.uniforms[r]=i:n.bindings[r]=i}),n}var ag=class{options={disableWarnings:!1};modules;moduleUniforms;moduleBindings;constructor(e,t){Object.assign(this.options,t);let n=Lo(Object.values(e).filter(dg));for(let t of n)e[t.name]=t;z.log(1,`Creating ShaderInputs with modules`,Object.keys(e))(),this.modules=e,this.moduleUniforms={},this.moduleBindings={};for(let[t,n]of Object.entries(e))n&&(this._addModule(n),n.name&&t!==n.name&&!this.options.disableWarnings&&z.warn(`Module name: ${t} vs ${n.name}`)())}destroy(){}setProps(e){for(let t of Object.keys(e)){let n=t,r=e[n]||{},i=this.modules[n];if(!i)this.options.disableWarnings||z.warn(`Module ${t} not found`)();else{let e=this.moduleUniforms[n],t=this.moduleBindings[n],{uniforms:a,bindings:o}=ig(i.getUniforms?.(r,e)||r,i.uniformTypes);this.moduleUniforms[n]=og(e,a,i.uniformTypes),this.moduleBindings[n]={...t,...o}}}}getModules(){return Object.values(this.modules)}getUniformValues(){return this.moduleUniforms}getBindingValues(){let e={};for(let t of Object.values(this.moduleBindings))Object.assign(e,t);return e}getDebugTable(){let e={};for(let[t,n]of Object.entries(this.moduleUniforms))for(let[r,i]of Object.entries(n))e[`${t}.${r}`]={type:this.modules[t].uniformTypes?.[r],value:String(i)};return e}_addModule(e){let t=e.name;this.moduleUniforms[t]=og({},e.defaultUniforms||{},e.uniformTypes),this.moduleBindings[t]={}}};function og(e={},t={},n={}){let r={...e};for(let[i,a]of Object.entries(t))a!==void 0&&(r[i]=sg(e[i],a,n[i]));return r}function sg(e,t,n){if(!n||typeof n==`string`)return cg(t);if(Array.isArray(n)){if(lg(t)||!Array.isArray(t))return cg(t);let r=Array.isArray(e)&&!lg(e)?[...e]:[],i=r.slice();for(let e=0;ee===void 0?void 0:cg(e)):ug(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t===void 0?void 0:cg(t)])):e}function lg(e){return ArrayBuffer.isView(e)||Array.isArray(e)&&(e.length===0||typeof e[0]==`number`)}function ug(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&!ArrayBuffer.isView(e)}function dg(e){return!!e?.dependencies}var fg={"+X":0,"-X":1,"+Y":2,"-Y":3,"+Z":4,"-Z":5};function pg(e){return e?Array.isArray(e)?e[0]??null:e:null}function mg(e){let{dimension:t,data:n}=e;if(!n)return null;switch(t){case`1d`:{let e=pg(n);if(!e)return null;let{width:t}=hg(e);return{width:t,height:1}}case`2d`:{let e=pg(n);return e?hg(e):null}case`3d`:case`2d-array`:{if(!Array.isArray(n)||n.length===0)return null;let e=pg(n[0]);return e?hg(e):null}case`cube`:{let e=Object.keys(n)[0]??null;if(!e)return null;let t=n[e],r=pg(t);return r?hg(r):null}case`cube-array`:{if(!Array.isArray(n)||n.length===0)return null;let e=n[0],t=Object.keys(e)[0]??null;if(!t)return null;let r=pg(e[t]);return r?hg(r):null}default:return null}}function hg(e){if(V(e))return Le(e);if(typeof e==`object`&&`width`in e&&`height`in e)return{width:e.width,height:e.height};throw Error(`Unsupported mip-level data`)}function gg(e){return typeof e==`object`&&!!e&&`data`in e&&`width`in e&&`height`in e}function _g(e){return ArrayBuffer.isView(e)}function vg(e){let{textureFormat:t,format:n}=e;if(t&&n&&t!==n)throw Error(`Conflicting texture formats "${t}" and "${n}" provided for the same mip level`);return t??n}function yg(e){let t=fg[e];if(t===void 0)throw Error(`Invalid cube face: ${e}`);return t}function bg(e,t){return 6*e+yg(t)}function xg(e){throw Error(`setTexture1DData not supported in WebGL.`)}function Sg(e){return Array.isArray(e)?e:[e]}function Cg(e,t,n,r){let i=Sg(t),a=e,o=[];for(let e=0;e>e),height:Math.max(1,n.height>>e),...r?{format:r}:{}},textureFormat:r,z:a,mipLevel:e});else throw Error(`Unsupported 2D mip-level payload`)}return o}function wg(e){let t=[];for(let n=0;n{for(let[r,i]of Object.entries(e)){let e=bg(n,r);t.push(...Cg(e,i))}}),t}var Og=class e{device;id;props;_texture=null;_sampler=null;_view=null;ready;isReady=!1;destroyed=!1;resolveReady=()=>{};rejectReady=()=>{};get texture(){if(!this._texture)throw Error(`Texture not initialized yet`);return this._texture}get sampler(){if(!this._sampler)throw Error(`Sampler not initialized yet`);return this._sampler}get view(){if(!this._view)throw Error(`View not initialized yet`);return this._view}get[Symbol.toStringTag](){return`DynamicTexture`}toString(){let e=this._texture?.width??this.props.width??`?`,t=this._texture?.height??this.props.height??`?`;return`DynamicTexture:"${this.id}":${e}x${t}px:(${this.isReady?`ready`:`loading...`})`}constructor(t,n){this.device=t;let r=Ph(`dynamic-texture`),i=n;this.props={...e.defaultProps,id:r,...n,data:null},this.id=this.props.id,this.ready=new Promise((e,t)=>{this.resolveReady=e,this.rejectReady=t}),this.initAsync(i)}async initAsync(e){try{let t=await this._loadAllData(e);this._checkNotDestroyed();let n=t.data?kg({...t,width:e.width,height:e.height,format:e.format}):[],r=`format`in e&&e.format!==void 0,i=`usage`in e&&e.usage!==void 0,a=this.props.width&&this.props.height?{width:this.props.width,height:this.props.height}:mg(t)||{width:this.props.width||1,height:this.props.height||1};if(!a||a.width<=0||a.height<=0)throw Error(`${this} size could not be determined or was zero`);let o=Ag(this.device,n,a,{format:r?e.format:void 0}),s=o.format??this.props.format,c={...this.props,...a,format:s,mipLevels:1,data:void 0};this.device.isTextureFormatCompressed(s)&&!i&&(c.usage=Se.SAMPLE|Se.COPY_DST);let l=this.props.mipmaps&&!o.hasExplicitMipChain&&!this.device.isTextureFormatCompressed(s);if(this.device.type===`webgpu`&&l){let e=this.props.dimension===`3d`?Se.SAMPLE|Se.STORAGE|Se.COPY_DST|Se.COPY_SRC:Se.SAMPLE|Se.RENDER|Se.COPY_DST|Se.COPY_SRC;c.usage|=e}let u=this.device.getMipLevelCount(c.width,c.height),d=o.hasExplicitMipChain?o.mipLevels:this.props.mipLevels===`auto`?u:Math.max(1,Math.min(u,this.props.mipLevels??1)),f={...c,mipLevels:d};this._texture=this.device.createTexture(f),this._sampler=this.texture.sampler,this._view=this.texture.view,o.subresources.length&&this._setTextureSubresources(o.subresources),this.props.mipmaps&&!o.hasExplicitMipChain&&!l&&z.warn(`${this} skipping auto-generated mipmaps for compressed texture format`)(),l&&this.generateMipmaps(),this.isReady=!0,this.resolveReady(this.texture),z.info(0,`${this} created`)()}catch(e){let t=e instanceof Error?e:Error(String(e));this.rejectReady(t)}}destroy(){this._texture&&(this._texture.destroy(),this._texture=null,this._sampler=null,this._view=null),this.destroyed=!0}generateMipmaps(){this.device.type===`webgl`?this.texture.generateMipmapsWebGL():this.device.type===`webgpu`?this.device.generateMipmapsWebGPU(this.texture):z.warn(`${this} mipmaps not supported on ${this.device.type}`)}setSampler(e={}){this._checkReady();let t=e instanceof B?e:this.device.createSampler(e);this.texture.setSampler(t),this._sampler=t}async readBuffer(e={}){this.isReady||await this.ready;let t=e.width??this.texture.width,n=e.height??this.texture.height,r=e.depthOrArrayLayers??this.texture.depth,i=this.texture.computeMemoryLayout({width:t,height:n,depthOrArrayLayers:r}),a=this.device.createBuffer({byteLength:i.byteLength,usage:U.COPY_DST|U.MAP_READ});this.texture.readBuffer({...e,width:t,height:n,depthOrArrayLayers:r},a);let o=this.device.createFence();return await o.signaled,o.destroy(),a}async readAsync(e={}){this.isReady||await this.ready;let t=e.width??this.texture.width,n=e.height??this.texture.height,r=e.depthOrArrayLayers??this.texture.depth,i=this.texture.computeMemoryLayout({width:t,height:n,depthOrArrayLayers:r}),a=await this.readBuffer(e),o=await a.readAsync(0,i.byteLength);return a.destroy(),o.buffer}resize(e){if(this._checkReady(),e.width===this.texture.width&&e.height===this.texture.height)return!1;let t=this.texture;return this._texture=t.clone(e),this._sampler=this.texture.sampler,this._view=this.texture.view,t.destroy(),z.info(`${this} resized`),!0}getCubeFaceIndex(e){let t=fg[e];if(t===void 0)throw Error(`Invalid cube face: ${e}`);return t}getCubeArrayFaceIndex(e,t){return 6*e+this.getCubeFaceIndex(t)}setTexture1DData(e){if(this._checkReady(),this.texture.props.dimension!==`1d`)throw Error(`${this} is not 1d`);let t=xg(e);this._setTextureSubresources(t)}setTexture2DData(e,t=0){if(this._checkReady(),this.texture.props.dimension!==`2d`)throw Error(`${this} is not 2d`);let n=Cg(t,e);this._setTextureSubresources(n)}setTexture3DData(e){if(this.texture.props.dimension!==`3d`)throw Error(`${this} is not 3d`);let t=wg(e);this._setTextureSubresources(t)}setTextureArrayData(e){if(this.texture.props.dimension!==`2d-array`)throw Error(`${this} is not 2d-array`);let t=Tg(e);this._setTextureSubresources(t)}setTextureCubeData(e){if(this.texture.props.dimension!==`cube`)throw Error(`${this} is not cube`);let t=Eg(e);this._setTextureSubresources(t)}setTextureCubeArrayData(e){if(this.texture.props.dimension!==`cube-array`)throw Error(`${this} is not cube-array`);let t=Dg(e);this._setTextureSubresources(t)}_setTextureSubresources(e){for(let t of e){let{z:e,mipLevel:n}=t;switch(t.type){case`external-image`:let{image:r,flipY:i}=t;this.texture.copyExternalImage({image:r,z:e,mipLevel:n,flipY:i});break;case`texture-data`:let{data:a,textureFormat:o}=t;if(o&&o!==this.texture.format)throw Error(`${this} mip level ${n} uses format "${o}" but texture format is "${this.texture.format}"`);this.texture.writeData(a.data,{x:0,y:0,z:e,width:a.width,height:a.height,depthOrArrayLayers:1,mipLevel:n});break;default:throw Error(`Unsupported 2D mip-level payload`)}}}async _loadAllData(e){let t=await Pg(e.data);return{dimension:e.dimension??`2d`,data:t??null}}_checkNotDestroyed(){this.destroyed&&z.warn(`${this} already destroyed`)}_checkReady(){this.isReady||z.warn(`${this} Cannot perform this operation before ready`)}static defaultProps={...Se.defaultProps,dimension:`2d`,data:null,mipmaps:!1}};function kg(e){if(!e.data)return[];let t=e.width&&e.height?{width:e.width,height:e.height}:void 0,n=`format`in e?e.format:void 0;switch(e.dimension){case`1d`:return xg(e.data);case`2d`:return Cg(0,e.data,t,n);case`3d`:return wg(e.data);case`2d-array`:return Tg(e.data);case`cube`:return Eg(e.data);case`cube-array`:return Dg(e.data);default:throw Error(`Unhandled dimension ${e.dimension}`)}}function Ag(e,t,n,r){if(t.length===0)return{subresources:t,mipLevels:1,format:r.format,hasExplicitMipChain:!1};let i=new Map;for(let e of t){let t=i.get(e.z)??[];t.push(e),i.set(e.z,t)}let a=t.some(e=>e.mipLevel>0),o=r.format,s=1/0,c=[];for(let[t,r]of i){let i=[...r].sort((e,t)=>e.mipLevel-t.mipLevel),a=i[0];if(!a||a.mipLevel!==0)throw Error(`DynamicTexture: slice ${t} is missing mip level 0`);let l=Mg(e,a);if(l.width!==n.width||l.height!==n.height)throw Error(`DynamicTexture: slice ${t} base level dimensions ${l.width}x${l.height} do not match expected ${n.width}x${n.height}`);let u=jg(a);if(u){if(o&&o!==u)throw Error(`DynamicTexture: slice ${t} base level format "${u}" does not match texture format "${o}"`);o=u}let d=o&&e.isTextureFormatCompressed(o)?Ng(e,l.width,l.height,o):e.getMipLevelCount(l.width,l.height),f=0;for(let t=0;t=d)break;let r=Mg(e,n),a=Math.max(1,l.width>>t),s=Math.max(1,l.height>>t);if(r.width!==a||r.height!==s)break;let u=jg(n);if(u&&(o||=u,u!==o))break;f++,c.push(n)}s=Math.min(s,f)}let l=Number.isFinite(s)?Math.max(1,s):1;return{subresources:c.filter(e=>e.mipLevel>e),s=Math.max(1,n>>e);if(r[e.name,e])||[]),i=n.shaderInputs||new ag(r,{disableWarnings:this.props.disableWarnings});this.setShaderInputs(i);let a=zg(t),o=(this.props.modules?.length>0?this.props.modules:this.shaderInputs?.getModules())||[];if(this.props.shaderLayout=$h(this.props.shaderLayout,o)||null,this.device.type===`webgpu`&&this.props.source){let{source:e,getUniforms:n,bindingTable:r}=this.props.shaderAssembler.assembleWGSLShader({platformInfo:a,...this.props,modules:o});this.source=e,this._getModuleUniforms=n,this._bindingTable=r;let i=t.getShaderLayout?.(this.source);this.props.shaderLayout=$h(this.props.shaderLayout||i||null,o)||null}else{let{vs:e,fs:t,getUniforms:n}=this.props.shaderAssembler.assembleGLSLShaderPair({platformInfo:a,...this.props,modules:o});this.vs=e,this.fs=t,this._getModuleUniforms=n,this._bindingTable=[]}this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,n.geometry&&this.setGeometry(n.geometry),this.pipelineFactory=n.pipelineFactory||qe.getDefaultPipelineFactory(this.device),this.shaderFactory=n.shaderFactory||Je.getDefaultShaderFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=t.createVertexArray({shaderLayout:this.pipeline.shaderLayout,bufferLayout:this.pipeline.bufferLayout}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),`isInstanced`in n&&(this.isInstanced=n.isInstanced),n.instanceCount&&this.setInstanceCount(n.instanceCount),n.vertexCount&&this.setVertexCount(n.vertexCount),n.indexBuffer&&this.setIndexBuffer(n.indexBuffer),n.attributes&&this.setAttributes(n.attributes),n.constantAttributes&&this.setConstantAttributes(n.constantAttributes),n.bindings&&this.setBindings(n.bindings),n.transformFeedback&&(this.transformFeedback=n.transformFeedback)}destroy(){this._destroyed||=(this.pipelineFactory.release(this.pipeline),this.shaderFactory.release(this.pipeline.vs),this.pipeline.fs&&this.pipeline.fs!==this.pipeline.vs&&this.shaderFactory.release(this.pipeline.fs),this._uniformStore.destroy(),this._gpuGeometry?.destroy(),!0)}needsRedraw(){this._getBindingsUpdateTimestamp()>this._lastDrawTimestamp&&this.setNeedsRedraw(`contents of bound textures or buffers updated`);let e=this._needsRedraw;return this._needsRedraw=!1,e}setNeedsRedraw(e){this._needsRedraw||=e}getBindingDebugTable(){return this._bindingTable}predraw(){this.updateShaderInputs(),this.pipeline=this._updatePipeline()}draw(e){let t=this._areBindingsLoading();if(t)return z.info(Fg,`>>> DRAWING ABORTED ${this.id}: ${t} not loaded`)(),!1;try{e.pushDebugGroup(`${this}.predraw(${e})`),this.predraw()}finally{e.popDebugGroup()}let n,r=this.pipeline.isErrored;try{if(e.pushDebugGroup(`${this}.draw(${e})`),this._logDrawCallStart(),this.pipeline=this._updatePipeline(),r=this.pipeline.isErrored,r)z.info(Fg,`>>> DRAWING ABORTED ${this.id}: ${Lg}`)(),n=!1;else{let t=this._getBindings(),r=this._getBindGroups(),{indexBuffer:i}=this.vertexArray,a=i?i.byteLength/(i.indexType===`uint32`?4:2):void 0;n=this.pipeline.draw({renderPass:e,vertexArray:this.vertexArray,isInstanced:this.isInstanced,vertexCount:this.vertexCount,instanceCount:this.instanceCount,indexCount:a,transformFeedback:this.transformFeedback||void 0,bindings:t,bindGroups:r,_bindGroupCacheKeys:this._getBindGroupCacheKeys(),uniforms:this.props.uniforms,parameters:this.parameters,topology:this.topology})}}finally{e.popDebugGroup(),this._logDrawCallEnd()}return this._logFramebuffer(e),n?(this._lastDrawTimestamp=this.device.timestamp,this._needsRedraw=!1):r?this._needsRedraw=Lg:this._needsRedraw=`waiting for resource initialization`,n}setGeometry(e){this._gpuGeometry?.destroy();let t=e&&Ih(this.device,e);if(t){this.setTopology(t.topology||`triangle-list`);let e=new Xh(this.bufferLayout);this.bufferLayout=e.mergeBufferLayouts(t.bufferLayout,this.bufferLayout),this.vertexArray&&this._setGeometryAttributes(t)}this._gpuGeometry=t}setTopology(e){e!==this.topology&&(this.topology=e,this._setPipelineNeedsUpdate(`topology`))}setBufferLayout(e){let t=new Xh(this.bufferLayout);this.bufferLayout=this._gpuGeometry?t.mergeBufferLayouts(e,this._gpuGeometry.bufferLayout):e,this._setPipelineNeedsUpdate(`bufferLayout`),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({shaderLayout:this.pipeline.shaderLayout,bufferLayout:this.pipeline.bufferLayout}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)}setParameters(e){Yh(e,this.parameters,2)||(this.parameters=e,this._setPipelineNeedsUpdate(`parameters`))}setInstanceCount(e){this.instanceCount=e,this.isInstanced===void 0&&e>0&&(this.isInstanced=!0),this.setNeedsRedraw(`instanceCount`)}setVertexCount(e){this.vertexCount=e,this.setNeedsRedraw(`vertexCount`)}setShaderInputs(e){this.shaderInputs=e,this._uniformStore=new _t(this.device,this.shaderInputs.modules);for(let[e,t]of Object.entries(this.shaderInputs.modules))if(eg(t)&&!this.material?.ownsModule(e)){let t=this._uniformStore.getManagedUniformBuffer(e);this.bindings[`${e}Uniforms`]=t}this.setNeedsRedraw(`shaderInputs`)}setMaterial(e){this.material=e,this.setNeedsRedraw(`material`)}updateShaderInputs(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues()),this.setBindings(this._getNonMaterialBindings(this.shaderInputs.getBindingValues())),this.setNeedsRedraw(`shaderInputs`)}setBindings(e){Object.assign(this.bindings,e),this.setNeedsRedraw(`bindings`)}setTransformFeedback(e){this.transformFeedback=e,this.setNeedsRedraw(`transformFeedback`)}setIndexBuffer(e){this.vertexArray.setIndexBuffer(e),this.setNeedsRedraw(`indexBuffer`)}setAttributes(e,t){let n=t?.disableWarnings??this.props.disableWarnings;e.indices&&z.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`)(),this.bufferLayout=Qh(this.pipeline.shaderLayout,this.bufferLayout);let r=new Xh(this.bufferLayout);for(let[t,i]of Object.entries(e)){let e=r.getBufferLayout(t);if(!e){n||z.warn(`Model(${this.id}): Missing layout for buffer "${t}".`)();continue}let a=r.getAttributeNamesForBuffer(e),o=!1;for(let e of a){let t=this._attributeInfos[e];if(t){let e=this.device.type===`webgpu`?r.getBufferIndex(t.bufferName):t.location;this.vertexArray.setBuffer(e,i),o=!0}}!o&&!n&&z.warn(`Model(${this.id}): Ignoring buffer "${i.id}" for unknown attribute "${t}"`)()}this.setNeedsRedraw(`attributes`)}setConstantAttributes(e,t){for(let[n,r]of Object.entries(e)){let e=this._attributeInfos[n];e?this.vertexArray.setConstantWebGL(e.location,r):(t?.disableWarnings??this.props.disableWarnings)||z.warn(`Model "${this.id}: Ignoring constant supplied for unknown attribute "${n}"`)()}this.setNeedsRedraw(`constants`)}_areBindingsLoading(){for(let e of Object.values(this.bindings))if(e instanceof Og&&!e.isReady)return e.id;for(let e of Object.values(this.material?.bindings||{}))if(e instanceof Og&&!e.isReady)return e.id;return!1}_getBindings(){let e={};for(let[t,n]of Object.entries(this.bindings))n instanceof Og?n.isReady&&(e[t]=n.texture):e[t]=n;return e}_getBindGroups(){let e=this.pipeline?.shaderLayout||this.props.shaderLayout||{bindings:[]},t=e.bindings.length?xe(e,this._getBindings()):{0:this._getBindings()};if(!this.material)return t;for(let[e,n]of Object.entries(this.material.getBindingsByGroup())){let r=Number(e);t[r]={...t[r]||{},...n}}return t}_getBindGroupCacheKeys(){let e=this.material?.getBindGroupCacheKey(3);return e?{3:e}:{}}_getBindingsUpdateTimestamp(){let e=0;for(let t of Object.values(this.bindings))t instanceof Ce?e=Math.max(e,t.texture.updateTimestamp):t instanceof U||t instanceof Se?e=Math.max(e,t.updateTimestamp):t instanceof Og?e=t.texture?Math.max(e,t.texture.updateTimestamp):1/0:t instanceof B||(e=Math.max(e,t.buffer.updateTimestamp));return Math.max(e,this.material?.getBindingsUpdateTimestamp()||0)}_setGeometryAttributes(e){let t={...e.attributes};for(let[e]of Object.entries(t))!this.pipeline.shaderLayout.attributes.find(t=>t.name===e)&&e!==`positions`&&delete t[e];this.vertexCount=e.vertexCount,this.setIndexBuffer(e.indices||null),this.setAttributes(e.attributes,{disableWarnings:!0}),this.setAttributes(t,{disableWarnings:this.props.disableWarnings}),this.setNeedsRedraw(`geometry attributes`)}_setPipelineNeedsUpdate(e){this._pipelineNeedsUpdate||=e,this.setNeedsRedraw(e)}_updatePipeline(){if(this._pipelineNeedsUpdate){let e=null,t=null;this.pipeline&&(z.log(1,`Model ${this.id}: Recreating pipeline because "${this._pipelineNeedsUpdate}".`)(),e=this.pipeline.vs,t=this.pipeline.fs),this._pipelineNeedsUpdate=!1;let n=this.shaderFactory.createShader({id:`${this.id}-vertex`,stage:`vertex`,source:this.source||this.vs,debugShaders:this.props.debugShaders}),r=null;this.source?r=n:this.fs&&(r=this.shaderFactory.createShader({id:`${this.id}-fragment`,stage:`fragment`,source:this.source||this.fs,debugShaders:this.props.debugShaders})),this.pipeline=this.pipelineFactory.createRenderPipeline({...this.props,bindings:void 0,bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,bindGroups:this._getBindGroups(),vs:n,fs:r}),this._attributeInfos=De(this.pipeline.shaderLayout,this.bufferLayout),e&&this.shaderFactory.release(e),t&&t!==e&&this.shaderFactory.release(t)}return this.pipeline}_lastLogTime=0;_logOpen=!1;_logDrawCallStart(){let e=z.level>3?0:Ig;z.level<2||Date.now()-this._lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:z.level<=2})())}_logDrawCallEnd(){if(this._logOpen){let e=zh(this.pipeline.shaderLayout,this.id);z.table(Fg,e)();let t=this.shaderInputs.getDebugTable();z.table(Fg,t)();let n=this._getAttributeDebugTable();z.table(Fg,this._attributeInfos)(),z.table(Fg,n)(),z.groupEnd(Fg)(),this._logOpen=!1}}_drawCount=0;_logFramebuffer(e){let t=this.device.props.debugFramebuffers;if(this._drawCount++,!t)return;let n=e.props.framebuffer;Hh(e,n,{id:n?.id||`${this.id}-framebuffer`,minimap:!0})}_getAttributeDebugTable(){let e={};for(let[t,n]of Object.entries(this._attributeInfos)){let r=this.vertexArray.attributes[n.location];e[n.location]={name:t,type:n.shaderType,values:r?this._getBufferOrConstantValues(r,n.bufferDataType):`null`}}if(this.vertexArray.indexBuffer){let{indexBuffer:t}=this.vertexArray,n=t.indexType===`uint32`?new Uint32Array(t.debugData):new Uint16Array(t.debugData);e.indices={name:`indices`,type:t.indexType,values:n.toString()}}return e}_getBufferOrConstantValues(e,t){let n=R.getTypedArrayConstructor(t);return(e instanceof U?new n(e.debugData):e).toString()}_getNonMaterialBindings(e){if(!this.material)return e;let t={};for(let[n,r]of Object.entries(e))this.material.ownsBinding(n)||(t[n]=r);return t}};function zg(e){return{type:e.type,shaderLanguage:e.info.shadingLanguage,shaderLanguageVersion:e.info.shadingLanguageVersion,gpu:e.info.gpu,features:e.features}}var Bg=class{device;modules;_materialBindingNames;_materialModuleNames;constructor(e,t={}){this.device=e,this.modules=t.modules||[];let n=new ag(Object.fromEntries(this.modules.map(e=>[e.name,e])));this._materialBindingNames=Hg(n),this._materialModuleNames=Ug(n)}createMaterial(e={}){return new Wg(this.device,{...e,factory:this})}getBindingNames(){return Array.from(this._materialBindingNames)}ownsBinding(e){if(this._materialBindingNames.has(e))return!0;let t=Vg(e);return t?this._materialModuleNames.has(t):!1}ownsModule(e){return this._materialModuleNames.has(e)}getBindingsByGroup(e){return Object.keys(e).length>0?{3:e}:{}}};function Vg(e){return e.endsWith(`Uniforms`)?e.slice(0,-8):null}function Hg(e){let t=new Set;for(let n of Object.values(e.modules))for(let e of n.bindingLayout||[])e.group===3&&t.add(e.name);return t}function Ug(e){let t=new Set;for(let n of Object.values(e.modules))n.name&&n.bindingLayout?.some(e=>e.group===3&&e.name===n.name)&&t.add(n.name);return t}var Wg=class{id;device;factory;shaderInputs;bindings={};_uniformStore;_bindGroupCacheToken={};constructor(e,t={}){this.id=t.id||Ph(`material`),this.device=e,this.factory=t.factory||new Bg(e,{modules:t.modules||t.shaderInputs?.getModules()||[]});let n=Object.fromEntries((t.shaderInputs?.getModules()||this.factory.modules).map(e=>[e.name,e]));this.shaderInputs=t.shaderInputs||new ag(n),this._uniformStore=new _t(this.device,this.shaderInputs.modules);for(let[e,t]of Object.entries(this.shaderInputs.modules))if(this.ownsModule(e)&&eg(t)){let t=this._uniformStore.getManagedUniformBuffer(e);this.bindings[`${e}Uniforms`]=t}this.updateShaderInputs(),t.bindings&&this._replaceOwnedBindings(t.bindings)}destroy(){this._uniformStore.destroy()}clone(e={}){let t=this.factory.createMaterial({id:e.id,shaderInputs:e.shaderInputs,bindings:{...this.getResourceBindings(),...e.bindings}});return e.shaderInputs||t.setProps(this.shaderInputs.getUniformValues()),e.moduleProps&&t.setProps(e.moduleProps),t}ownsBinding(e){return this.factory.ownsBinding(e)}ownsModule(e){return this.factory.ownsModule(e)}setProps(e){this.shaderInputs.setProps(e),this.updateShaderInputs()}updateShaderInputs(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues()),this._setOwnedBindings(this.shaderInputs.getBindingValues())&&(this._bindGroupCacheToken={})}getResourceBindings(){let e={};for(let[t,n]of Object.entries(this.bindings))Vg(t)||(e[t]=n);return e}getBindings(){let e={},t=e;for(let[e,n]of Object.entries(this.bindings))n instanceof Og?n.isReady&&(t[e]=n.texture):t[e]=n;return e}getBindingsByGroup(){return this.factory.getBindingsByGroup(this.getBindings())}getBindGroupCacheKey(e){return e===3?this._bindGroupCacheToken:null}getBindingsUpdateTimestamp(){let e=0;for(let t of Object.values(this.bindings))t instanceof Ce?e=Math.max(e,t.texture.updateTimestamp):t instanceof U||t instanceof Se?e=Math.max(e,t.updateTimestamp):t instanceof Og?e=t.texture?Math.max(e,t.texture.updateTimestamp):1/0:t instanceof B||(e=Math.max(e,t.buffer.updateTimestamp));return e}_replaceOwnedBindings(e){this._setOwnedBindings(e)&&(this._bindGroupCacheToken={})}_setOwnedBindings(e){let t=!1;for(let[n,r]of Object.entries(e))r!==void 0&&this.ownsBinding(n)&&this.bindings[n]!==r&&(this.bindings[n]=r,t=!0);return t}},Gg=class e{device;model;transformFeedback;static defaultProps={...Rg.defaultProps,outputs:void 0,feedbackBuffers:void 0};static isSupported(e){return e?.info?.type===`webgl`}constructor(t,n=e.defaultProps){if(!e.isSupported(t))throw Error(`BufferTransform not yet implemented on WebGPU`);this.device=t,this.model=new Rg(this.device,{id:n.id||`buffer-transform-model`,fs:n.fs||_c(),topology:n.topology||`point-list`,varyings:n.outputs||n.varyings,...n}),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:n.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}destroy(){this.model&&this.model.destroy()}delete(){this.destroy()}run(e){e?.inputBuffers&&this.model.setAttributes(e.inputBuffers),e?.outputBuffers&&this.transformFeedback.setBuffers(e.outputBuffers);let t=this.device.beginRenderPass(e);this.model.draw(t),t.end()}getBuffer(e){return this.transformFeedback.getBuffer(e)}readAsync(e){let t=this.getBuffer(e);if(!t)throw Error(`BufferTransform#getBuffer`);if(t instanceof U)return t.readAsync();let{buffer:n,byteOffset:r=0,byteLength:i=n.byteLength}=t;return n.readAsync(r,i)}},Kg=`transform_output`,qg=class{device;model;sampler;currentIndex=0;samplerTextureMap=null;bindings=[];resources={};constructor(e,t){this.device=e,this.sampler=e.createSampler({addressModeU:`clamp-to-edge`,addressModeV:`clamp-to-edge`,minFilter:`nearest`,magFilter:`nearest`,mipmapFilter:`nearest`}),this.model=new Rg(this.device,{id:t.id||Ph(`texture-transform-model`),fs:t.fs||_c({input:t.targetTextureVarying,inputChannels:t.targetTextureChannels,output:Kg}),vertexCount:t.vertexCount,...t}),this._initialize(t),Object.seal(this)}destroy(){this.model.destroy();for(let e of this.bindings)e.framebuffer?.destroy()}delete(){this.destroy()}run(e){let{framebuffer:t}=this.bindings[this.currentIndex],n=this.device.beginRenderPass({framebuffer:t,...e});this.model.draw(n),n.end(),this.device.submit()}getTargetTexture(){let{targetTexture:e}=this.bindings[this.currentIndex];return e}getFramebuffer(){return this.bindings[this.currentIndex].framebuffer}_initialize(e){this._updateBindings(e)}_updateBindings(e){this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e)}_updateBinding(e,{sourceBuffers:t,sourceTextures:n,targetTexture:r}){if(e||={sourceBuffers:{},sourceTextures:{},targetTexture:null},Object.assign(e.sourceTextures,n),Object.assign(e.sourceBuffers,t),r){e.targetTexture=r;let{width:t,height:n}=r;e.framebuffer&&e.framebuffer.destroy(),e.framebuffer=this.device.createFramebuffer({id:`transform-framebuffer`,width:t,height:n,colorAttachments:[r]}),e.framebuffer.resize({width:t,height:n})}return e}_setSourceTextureParameters(){let e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(let e in t)t[e].sampler=this.sampler}},Jg=class{id;topology;vertexCount;indices;attributes;userData={};constructor(e){let{attributes:t={},indices:n=null,vertexCount:r=null}=e;this.id=e.id||Ph(`geometry`),this.topology=e.topology,n&&(this.indices=ArrayBuffer.isView(n)?{value:n,size:1}:n),this.attributes={};for(let[e,n]of Object.entries(t)){let t=ArrayBuffer.isView(n)?{value:n}:n;if(!ArrayBuffer.isView(t.value))throw Error(`${this._print(e)}: must be typed array or object with value as typed array`);if((e===`POSITION`||e===`positions`)&&!t.size&&(t.size=3),e===`indices`){if(this.indices)throw Error(`Multiple indices detected`);this.indices=t}else this.attributes[e]=t}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=r||this._calculateVertexCount(this.attributes,this.indices)}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){return this}_calculateVertexCount(e,t){if(t)return t.value.length;let n=1/0;for(let t of Object.values(e)){let{value:e,size:r,constant:i}=t;!i&&e&&r!==void 0&&r>=1&&(n=Math.min(n,e.length/r))}return n}},Yg=`struct VertexInputs { + @location(0) clipSpacePositions: vec2, + @location(1) texCoords: vec2, + @location(2) coordinates: vec2 +} + +struct FragmentInputs { + @builtin(position) Position : vec4, + @location(0) position : vec2, + @location(1) coordinate : vec2, + @location(2) uv : vec2 +}; + +@vertex +fn vertexMain(inputs: VertexInputs) -> FragmentInputs { + var outputs: FragmentInputs; + outputs.Position = vec4(inputs.clipSpacePositions, 0., 1.); + outputs.position = inputs.clipSpacePositions; + outputs.coordinate = inputs.coordinates; + outputs.uv = inputs.texCoords; + return outputs; +} +`,Xg=`#version 300 es +in vec2 clipSpacePositions; +in vec2 texCoords; +in vec2 coordinates; + +out vec2 position; +out vec2 coordinate; +out vec2 uv; + +void main(void) { + gl_Position = vec4(clipSpacePositions, 0., 1.); + position = clipSpacePositions; + coordinate = coordinates; + uv = texCoords; +} +`,Zg=[-1,-1,1,-1,-1,1,1,1],Qg=class extends Rg{constructor(e,t){let n=Zg.map(e=>e===-1?0:e);t.source&&(t={...t,source:`${Yg}\n${t.source}`}),super(e,{id:t.id||Ph(`clip-space`),...t,vs:Xg,vertexCount:4,geometry:new Jg({topology:`triangle-strip`,vertexCount:4,attributes:{clipSpacePositions:{size:2,value:new Float32Array(Zg)},texCoords:{size:2,value:new Float32Array(n)},coordinates:{size:2,value:new Float32Array(n)}}})})}};function $g(e,t){if(!e)throw Error(t)}var e_=class{id;matrix=new wu;display=!0;position=new Y;rotation=new Y;scale=new Y(1,1,1);userData={};props={};constructor(e={}){let{id:t}=e;this.id=t||Ph(this.constructor.name),this._setScenegraphNodeProps(e)}getBounds(){return null}destroy(){}delete(){this.destroy()}setProps(e){return this._setScenegraphNodeProps(e),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(e){return $g(e.length===3,`setPosition requires vector argument`),this.position=e,this}setRotation(e){return $g(e.length===3||e.length===4,`setRotation requires vector argument`),this.rotation=e,this}setScale(e){return $g(e.length===3,`setScale requires vector argument`),this.scale=e,this}setMatrix(e,t=!0){t?this.matrix.copy(e):this.matrix=e}setMatrixComponents(e){let{position:t,rotation:n,scale:r,update:i=!0}=e;return t&&this.setPosition(t),n&&this.setRotation(n),r&&this.setScale(r),i&&this.updateMatrix(),this}updateMatrix(){if(this.matrix.identity(),this.matrix.translate(this.position),this.rotation.length===4){let e=new wu().fromQuaternion(this.rotation);this.matrix.multiplyRight(e)}else this.matrix.rotateXYZ(this.rotation);return this.matrix.scale(this.scale),this}update({position:e,rotation:t,scale:n}={}){return e&&this.setPosition(e),t&&this.setRotation(t),n&&this.setScale(n),this.updateMatrix(),this}getCoordinateUniforms(e,t){t||=this.matrix;let n=new wu(e).multiplyRight(t),r=n.invert(),i=r.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:r,worldInverseTransposeMatrix:i}}_setScenegraphNodeProps(e){e?.position&&this.setPosition(e.position),e?.rotation&&this.setRotation(e.rotation),e?.scale&&this.setScale(e.scale),this.updateMatrix(),e?.matrix&&this.setMatrix(e.matrix),Object.assign(this.props,e)}},t_=class e extends e_{children;constructor(e={}){e=Array.isArray(e)?{children:e}:e;let{children:t=[]}=e;z.assert(t.every(e=>e instanceof e_),`every child must an instance of ScenegraphNode`),super(e),this.children=t}getBounds(){let e=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];return this.traverse((t,{worldMatrix:n})=>{let r=t.getBounds();if(!r)return;let[i,a]=r,o=new Y(i).add(a).divide([2,2,2]);n.transformAsPoint(o,o);let s=new Y(a).subtract(i).divide([2,2,2]);n.transformAsVector(s,s);for(let t=0;t<8;t++){let n=new Y(t&1?-1:1,t&2?-1:1,t&4?-1:1).multiply(s).add(o);for(let t=0;t<3;t++)e[0][t]=Math.min(e[0][t],n[t]),e[1][t]=Math.max(e[1][t],n[t])}}),Number.isFinite(e[0][0])?e:null}destroy(){this.children.forEach(e=>e.destroy()),this.removeAll(),super.destroy()}add(...e){for(let t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){let t=this.children,n=t.indexOf(e);return n>-1&&t.splice(n,1),this}removeAll(){return this.children=[],this}traverse(t,{worldMatrix:n=new wu}={}){let r=new wu(n).multiplyRight(this.matrix);for(let n of this.children)n instanceof e?n.traverse(t,{worldMatrix:r}):t(n,{worldMatrix:r})}preorderTraversal(t,{worldMatrix:n=new wu}={}){let r=new wu(n).multiplyRight(this.matrix);t(this,{worldMatrix:r});for(let n of this.children)n instanceof e?n.preorderTraversal(t,{worldMatrix:r}):t(n,{worldMatrix:r})}},n_=class extends e_{model;bounds=null;managedResources;constructor(e){super(e),this.model=e.model,this.managedResources=e.managedResources||[],this.bounds=e.bounds||null,this.setProps(e)}destroy(){this.model&&=(this.model.destroy(),null),this.managedResources.forEach(e=>e.destroy()),this.managedResources=[]}getBounds(){return this.bounds}draw(e){return this.model.draw(e)}},r_=class extends Jg{constructor(e={}){let{id:t=Ph(`cube-geometry`),indices:n=!0}=e;super(n?{...e,id:t,topology:`triangle-list`,indices:{size:1,value:i_},attributes:{...d_,...e.attributes}}:{...e,id:t,topology:`triangle-list`,indices:void 0,attributes:{...f_,...e.attributes}})}},i_=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),a_=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),o_=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),s_=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),c_=new Float32Array([1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1]),l_=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),u_=new Float32Array([1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1,0,1]),d_={POSITION:{size:3,value:a_},NORMAL:{size:3,value:o_},TEXCOORD_0:{size:2,value:s_}},f_={POSITION:{size:3,value:c_},TEXCOORD_0:{size:2,value:l_},COLOR_0:{size:3,value:u_}},p_={name:`screen`,fs:`layout(std140) uniform screenUniforms { + vec2 texSize; +} screen; +`,uniformTypes:{texSize:`vec2`}},m_=class extends Gm{constructor(e,t){super(e,t);let{module:n,fs:r,id:i}=t,a={depthWriteEnabled:!1,depthCompare:`always`,depthBias:0,blend:!0,blendColorSrcFactor:`one`,blendColorDstFactor:`one-minus-src-alpha`,blendAlphaSrcFactor:`one`,blendAlphaDstFactor:`one-minus-src-alpha`,blendColorOperation:`add`,blendAlphaOperation:`add`};this.model=new Qg(e,{id:i,fs:r,modules:[n,p_],parameters:a})}render(e){this._renderPass(this.device,e)}delete(){this.model.destroy(),this.model=null}_renderPass(e,t){let{clearCanvas:n,inputBuffer:r,outputBuffer:i}=t,a=[r.width,r.height],o={texSrc:r.colorAttachments[0],texSize:a};this.model.shaderInputs.setProps({screen:o,...t.moduleProps});let s=this.device.beginRenderPass({framebuffer:i,parameters:{viewport:[0,0,...a]},clearColor:n?[0,0,0,0]:!1,clearDepth:1,clearStencil:!1});this.model.draw(s),s.end()}},h_=class{constructor(e,t){this.id=`${e.name}-pass`,this.props=t,Po(e),this.module=e}setup({device:e}){this.passes=g_(e,this.module,this.id)}setProps(e){this.props=e}preRender(){}postRender(e){let t=this.passes,{target:n}=e,r=e.inputBuffer,i=e.swapBuffer;for(let a=0;a{let a=b_(t,r);return new m_(e,{id:`${n}-${i}`,module:t,fs:a})})}var __=`#version 300 es +uniform sampler2D texSrc; + +in vec2 position; +in vec2 coordinate; +in vec2 uv; + +out vec4 fragColor; +`,v_=e=>`\ +${__} +void main() { + fragColor = texture(texSrc, coordinate); + fragColor = ${e}(fragColor, screen.texSize, coordinate); +} +`,y_=e=>`\ +${__} +void main() { + fragColor = ${e}(texSrc, screen.texSize, coordinate); +} +`;function b_(e,t){return t.filter?v_(typeof t.filter==`string`?t.filter:`${e.name}_filterColor_ext`):t.sampler?y_(typeof t.sampler==`string`?t.sampler:`${e.name}_sampleColor`):``}var x_={blendColorOperation:`add`,blendColorSrcFactor:`one`,blendColorDstFactor:`zero`,blendAlphaOperation:`add`,blendAlphaSrcFactor:`constant`,blendAlphaDstFactor:`zero`},S_=class extends qm{constructor(){super(...arguments),this._colorEncoderState=null}render(e){return`pickingFBO`in e?this._drawPickingBuffer(e):{decodePickingColor:null,stats:super._render(e)}}_drawPickingBuffer({layers:e,layerFilter:t,views:n,viewports:r,onViewportActive:i,pickingFBO:a,deviceRect:{x:o,y:s,width:c,height:l},cullRect:u,effects:d,pass:f=`picking`,pickZ:p,shaderModuleProps:m,clearColor:h}){this.pickZ=p;let g=this._resetColorEncoder(p),_=[o,s,c,l],v=super._render({target:a,layers:e,layerFilter:t,views:n,viewports:r,onViewportActive:i,cullRect:u,effects:d?.filter(e=>e.useInPicking),pass:f,isPicking:!0,shaderModuleProps:m,clearColor:h??[0,0,0,0],colorMask:15,scissorRect:_});return this._colorEncoderState=null,{decodePickingColor:g&&w_.bind(null,g),stats:v}}shouldDrawLayer(e){let{pickable:t,operation:n}=e.props;return t&&n.includes(`draw`)||n.includes(`terrain`)||n.includes(`mask`)}getShaderModuleProps(e,t,n){return{picking:{isActive:1,isAttribute:this.pickZ},lighting:{enabled:!1}}}getLayerParameters(e,t,n){let r={...e.props.parameters},{pickable:i,operation:a}=e.props;return this._colorEncoderState?i&&a.includes(`draw`)?(Object.assign(r,x_),r.blend=!0,this.device.type===`webgpu`?r.blendConstant=C_(this._colorEncoderState,e,n):r.blendColor=C_(this._colorEncoderState,e,n),a.includes(`terrain`)&&e.state?._hasPickingCover&&(r.blendAlphaSrcFactor=`one`)):a.includes(`terrain`)&&(r.blend=!1):r.blend=!1,r}_resetColorEncoder(e){return this._colorEncoderState=e?null:{byLayer:new Map,byAlpha:[]},this._colorEncoderState}};function C_(e,t,n){let{byLayer:r,byAlpha:i}=e,a,o=r.get(t);return o?(o.viewports.push(n),a=o.a):(a=r.size+1,a<=255?(o={a,layer:t,viewports:[n]},r.set(t,o),i[a]=o):(fo.warn(`Too many pickable layers, only picking the first 255`)(),a=0)),[0,0,0,a/255]}function w_(e,t){let n=e.byAlpha[t[3]];return n&&{pickedLayer:n.layer,pickedViewports:n.viewports,pickedObjectIndex:n.layer.decodePickingColor(t)}}var T_={NO_STATE:`Awaiting state`,MATCHED:`Matched. State transferred from previous layer`,INITIALIZED:`Initialized`,AWAITING_GC:`Discarded. Awaiting garbage collection`,AWAITING_FINALIZATION:`No longer matched. Awaiting garbage collection`,FINALIZED:`Finalized! Awaiting garbage collection`},E_=Symbol.for(`component`),D_=Symbol.for(`propTypes`),O_=Symbol.for(`deprecatedProps`),k_=Symbol.for(`asyncPropDefaults`),A_=Symbol.for(`asyncPropOriginal`),j_=Symbol.for(`asyncPropResolved`);function M_(e,t=()=>!0){return Array.isArray(e)?N_(e,t,[]):t(e)?[e]:[]}function N_(e,t,n){let r=-1;for(;++r0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,t){if(e===this._data&&!t)return;this._data=e;let n=++this._loadCount,r=e;typeof e==`string`&&(r=ga(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(e=>{this._loadCount===n&&(this.isLoaded=!0,this._error=void 0,this._content=e)}).catch(e=>{this._loadCount===n&&(this.isLoaded=!0,this._error=e||!0)})):(this.isLoaded=!0,this._error=void 0,this._content=e);for(let e of this._subscribers)e.onChange(this.getData())}},I_=class{constructor(e){this.protocol=e.protocol||`resource://`,this._context={device:e.device,gl:e.device?.gl,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return e.startsWith(this.protocol)?!0:e in this._resources}add({resourceId:e,data:t,forceUpdate:n=!1,persistent:r=!0}){let i=this._resources[e];i?i.setData(t,n):(i=new F_(e,t,this._context),this._resources[e]=i),i.persistent=r}remove(e){let t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){let t=this._consumers[e];if(t){for(let e in t){let n=t[e],r=this._resources[n.resourceId];r&&r.unsubscribe(n)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:n,requestId:r=`default`}){let{_resources:i,protocol:a}=this;e.startsWith(a)&&(e=e.replace(a,``),i[e]||this.add({resourceId:e,data:null,persistent:!1}));let o=i[e];if(this._track(n,r,o,t),o)return o.getData()}prune(){this._pruneRequest||=setTimeout(()=>this._prune(),0)}finalize(){for(let e in this._resources)this._resources[e].delete()}_track(e,t,n,r){let i=this._consumers,a=i[e]=i[e]||{},o=a[t],s=o&&o.resourceId&&this._resources[o.resourceId];s&&(s.unsubscribe(o),this.prune()),n&&(o?(o.onChange=r,o.resourceId=n.id):o={onChange:r,resourceId:n.id},a[t]=o,n.subscribe(o))}_prune(){this._pruneRequest=null;for(let e of Object.keys(this._resources)){let t=this._resources[e];!t.persistent&&!t.inUse()&&(t.delete(),delete this._resources[e])}}},L_=`layerManager.setLayers`,R_=`layerManager.activateViewport`,z_=class{constructor(e,t){this._lastRenderedLayers=[],this._needsRedraw=!1,this._needsUpdate=!1,this._nextLayers=null,this._debug=!1,this._defaultShaderModulesChanged=!1,this.activateViewport=e=>{ho(R_,this,e),e&&(this.context.viewport=e)};let{deck:n,stats:r,viewport:i,timeline:a}=t||{};this.layers=[],this.resourceManager=new I_({device:e,protocol:`deck://`}),this.context={mousePosition:null,userData:{},layerManager:this,device:e,gl:e?.gl,deck:n,shaderAssembler:Fm(e?.info?.shadingLanguage||`glsl`),defaultShaderModules:[ree],renderPass:void 0,stats:r||new Te({id:`deck.gl`}),viewport:i||new vh({id:`DEFAULT-INITIAL-VIEWPORT`}),timeline:a||new Dh,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}finalize(){this.resourceManager.finalize();for(let e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(let n of this.layers){let r=n.getNeedsRedraw(e);t||=r}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?`layers changed`:this._defaultShaderModulesChanged?`shader modules changed`:this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e}={}){return e?this.layers.filter(t=>e.find(e=>t.id.indexOf(e)===0)):this.layers}setProps(e){`debug`in e&&(this._debug=e.debug),`userData`in e&&(this.context.userData=e.userData),`layers`in e&&(this._nextLayers=e.layers),`onError`in e&&(this.context.onError=e.onError)}setLayers(e,t){ho(L_,this,t,e),this._lastRenderedLayers=e;let n=M_(e,Boolean);for(let e of n)e.context=this.context;this._updateLayers(this.layers,n)}updateLayers(){let e=this.needsUpdate();e&&(this.setNeedsRedraw(`updating layers: ${e}`),this.setLayers(this._nextLayers||this._lastRenderedLayers,e)),this._nextLayers=null}addDefaultShaderModule(e){let{defaultShaderModules:t}=this.context;t.find(t=>t.name===e.name)||(t.push(e),this._defaultShaderModulesChanged=!0)}removeDefaultShaderModule(e){let{defaultShaderModules:t}=this.context,n=t.findIndex(t=>t.name===e.name);n>=0&&(t.splice(n,1),this._defaultShaderModulesChanged=!0)}_handleError(e,t,n){n.raiseError(t,`${e} of ${n}`)}_updateLayers(e,t){let n={};for(let t of e)n[t.id]?fo.warn(`Multiple old layers with same id ${t.id}`)():n[t.id]=t;if(this._defaultShaderModulesChanged){for(let t of e)t.setNeedsUpdate(),t.setChangeFlags({extensionsChanged:!0});this._defaultShaderModulesChanged=!1}let r=[];this._updateSublayersRecursively(t,n,r),this._finalizeOldLayers(n);let i=!1;for(let e of r)if(e.hasUniformTransition()){i=`Uniform transition in ${e}`;break}this._needsUpdate=i,this.layers=r}_updateSublayersRecursively(e,t,n){for(let r of e){r.context=this.context;let e=t[r.id];e===null&&fo.warn(`Multiple new layers with same id ${r.id}`)(),t[r.id]=null;let i=null;try{this._debug&&e!==r&&r.validateProps(),e?(this._transferLayerState(e,r),this._updateLayer(r)):this._initializeLayer(r),n.push(r),i=r.isComposite?r.getSubLayers():null}catch(e){this._handleError(`matching`,e,r)}i&&this._updateSublayersRecursively(i,t,n)}}_finalizeOldLayers(e){for(let t in e){let n=e[t];n&&this._finalizeLayer(n)}}_initializeLayer(e){try{e._initialize(),e.lifecycle=T_.INITIALIZED}catch(t){this._handleError(`initialization`,t,e)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle=T_.MATCHED,t!==e&&(e.lifecycle=T_.AWAITING_GC)}_updateLayer(e){try{e._update()}catch(t){this._handleError(`update`,t,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||`finalized ${e}`,e.lifecycle=T_.AWAITING_FINALIZATION;try{e._finalize(),e.lifecycle=T_.FINALIZED}catch(t){this._handleError(`finalization`,t,e)}}};function B_(e,t,n){if(e===t)return!0;if(!n||!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;rt.containsPixel(e)):this._viewports}getViews(){let e={};return this.views.forEach(t=>{e[t.id]=t}),e}getView(e){return this.views.find(t=>t.id===e)}getViewState(e){let t=typeof e==`string`?this.getView(e):e,n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}getViewport(e){return this._viewportMap[e]}unproject(e,t){let n=this.getViewports(),r={x:e[0],y:e[1]};for(let i=n.length-1;i>=0;--i){let a=n[i];if(a.containsPixel(r)){let n=e.slice();return n[0]-=a.x,n[1]-=a.y,a.unproject(n,t)}}return null}setProps(e){e.views&&this._setViews(e.views),e.viewState&&this._setViewState(e.viewState),(`width`in e||`height`in e)&&this._setSize(e.width,e.height),`pickPosition`in e&&(this._pickPosition=e.pickPosition),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate(`Size changed`))}_setViews(e){e=M_(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate(`views changed`),this.views=e}_setViewState(e){e?(B_(e,this.viewState,3)||this.setNeedsUpdate(`viewState changed`),this.viewState=e):fo.warn("missing `viewState` or `initialViewState`")()}_createController(e,t){let n=t.type;return new n({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._eventCallbacks.onViewStateChange,onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:t=>this.getView(e.id)?.makeViewport({viewState:t,width:this.width,height:this.height}),pickPosition:this._pickPosition})}_updateController(e,t,n,r){let i=e.controller;if(i&&n){let a={...t,...i,id:e.id,x:n.x,y:n.y,width:n.width,height:n.height};return(!r||r.constructor!==i.type)&&(r=this._createController(e,a)),r&&r.setProps(a),r}return null}_rebuildViewports(){let{views:e}=this,t=this.controllers;this._viewports=[],this.controllers={};let n=!1;for(let r=e.length;r--;){let i=e[r],a=this.getViewState(i),o=i.makeViewport({viewState:a,width:this.width,height:this.height}),s=t[i.id],c=!!i.controller;c&&!s&&(n=!0),(n||!c)&&s&&(s.finalize(),s=null),this.controllers[i.id]=this._updateController(i,a,o,s),o&&this._viewports.unshift(o)}for(let e in t){let n=t[e];n&&!this.controllers[e]&&n.finalize()}this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,t){return e.length!==t.length||e.some((n,r)=>!e[r].equals(t[r]))}},H_=/^(?:\d+\.?\d*|\.\d+)$/;function U_(e){switch(typeof e){case`number`:if(!Number.isFinite(e))throw Error(`Could not parse position string ${e}`);return{type:`literal`,value:e};case`string`:try{return new q_(K_(e)).parseExpression()}catch(t){let n=t instanceof Error?t.message:String(t);throw Error(`Could not parse position string ${e}: ${n}`)}default:throw Error(`Could not parse position string ${e}`)}}function W_(e,t){switch(e.type){case`literal`:return e.value;case`percentage`:return Math.round(e.value*t);case`binary`:let n=W_(e.left,t),r=W_(e.right,t);return e.operator===`+`?n+r:n-r;default:throw Error(`Unknown layout expression type`)}}function G_(e,t){return W_(e,t)}function K_(e){let t=[],n=0;for(;n=`0`&&e<=`9`}function Y_(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`}function X_(e){return!!(e&&e.type===`symbol`&&(e.value===`+`||e.value===`-`))}function Z_(e,t){let n={...e};for(let e in t)e!==`id`&&(Array.isArray(n[e])&&Array.isArray(t[e])?n[e]=Q_(n[e],t[e]):n[e]=t[e]);return n}function Q_(e,t){e=e.slice();for(let n=0;n{},nv={BREAK:1,SNAP_TO_END:2,IGNORE:3},rv=e=>e,iv=nv.BREAK,av=class{constructor(e){this._onTransitionUpdate=e=>{let{time:t,settings:{interpolator:n,startProps:r,endProps:i,duration:a,easing:o}}=e,s=o(t/a),c=n.interpolateProps(r,i,s);this.propsInTransition=this.getControllerState({...this.props,...c}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})},this.getControllerState=e.getControllerState,this.propsInTransition=null,this.transition=new ev(e.timeline),this.onViewStateChange=e.onViewStateChange||tv,this.onStateChange=e.onStateChange||tv}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1,n=this.props;if(this.props=e,!n||this._shouldIgnoreViewportChange(n,e))return!1;if(this._isTransitionEnabled(e)){let r=n;if(this.transition.inProgress){let{interruption:e,endProps:t}=this.transition.settings;r={...n,...e===nv.SNAP_TO_END?t:this.propsInTransition||n}}this._triggerTransition(r,e),t=!0}else this.transition.cancel();return t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){let{transitionDuration:t,transitionInterpolator:n}=e;return(t>0||t===`auto`)&&!!n}_isUpdateDueToCurrentTransition(e){return this.transition.inProgress&&this.propsInTransition?this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition):!1}_shouldIgnoreViewportChange(e,t){return this.transition.inProgress?this.transition.settings.interruption===nv.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}_triggerTransition(e,t){let n=this.getControllerState(e),r=this.getControllerState(t).shortestPathFrom(n),i=t.transitionInterpolator,a=i.getDuration?i.getDuration(e,t):t.transitionDuration;if(a===0)return;let o=i.initializeProps(e,r);this.propsInTransition={};let s={duration:a,easing:t.transitionEasing||rv,interpolator:i,interruption:t.transitionInterruption||iv,startProps:o.start,endProps:o.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)};this.transition.start(s),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return t=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e?.(t)}}};function ov(e,t){if(!e)throw Error(t||`deck.gl: assertion failed.`)}var sv=class{constructor(e){let{compare:t,extract:n,required:r}=e;this._propsToCompare=t,this._propsToExtract=n||t,this._requiredProps=r}arePropsEqual(e,t){for(let n of this._propsToCompare)if(!(n in e)||!(n in t)||!jc(e[n],t[n]))return!1;return!0}initializeProps(e,t){let n={},r={};for(let i of this._propsToExtract)(i in e||i in t)&&(n[i]=e[i],r[i]=t[i]);return this._checkRequiredProps(n),this._checkRequiredProps(r),{start:n,end:r}}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){this._requiredProps&&this._requiredProps.forEach(t=>{let n=e[t];ov(Number.isFinite(n)||Array.isArray(n),`${t} is required for transition`)})}},cv=Math.PI/180,lv=180/Math.PI,uv=6370972;function dv(){let e=256/uv,t=Math.PI/180*256;return{unitsPerMeter:[e,e,e],unitsPerMeter2:[0,0,0],metersPerUnit:[1/e,1/e,1/e],unitsPerDegree:[t,t,e],unitsPerDegree2:[0,0,0],degreesPerUnit:[1/t,1/t,1/e]}}var fv=class extends vh{constructor(e={}){let{longitude:t=0,zoom:n=0,nearZMultiplier:r=.5,farZMultiplier:i=1,resolution:a=10}=e,{latitude:o=0,height:s,altitude:c=1.5,fovy:l}=e;o=Math.max(Math.min(o,em),-em),s||=1,l?c=fm(l):l=dm(c);let u=2**(n-pv(o)),d=e.nearZ??r,f=e.farZ??(c+256*2*u/s)*i,p=new wu().lookAt({eye:[0,-c,0],up:[0,0,1]});p.rotateX(o*cv),p.rotateZ(-t*cv),p.scale(u/s),super({...e,height:s,viewMatrix:p,longitude:t,latitude:o,zoom:n,distanceScales:dv(),fovy:l,focalDistance:c,near:d,far:f}),this.scale=u,this.latitude=o,this.longitude=t,this.fovy=l,this.resolution=a}get projectionMode(){return _p.GLOBE}getDistanceScales(){return this.distanceScales}getBounds(e={}){let t={targetZ:e.z||0},n=this.unproject([0,this.height/2],t),r=this.unproject([this.width/2,0],t),i=this.unproject([this.width,this.height/2],t),a=this.unproject([this.width/2,this.height],t);return i[0]this.longitude&&(n[0]-=360),[Math.min(n[0],i[0],r[0],a[0]),Math.min(n[1],i[1],r[1],a[1]),Math.max(n[0],i[0],r[0],a[0]),Math.max(n[1],i[1],r[1],a[1])]}unproject(e,{topLeft:t=!0,targetZ:n}={}){let[r,i,a]=e,o=t?i:this.height-i,{pixelUnprojectionMatrix:s}=this,c;if(Number.isFinite(a))c=mv(s,[r,o,a,1]);else{let e=mv(s,[r,o,-1,1]),t=mv(s,[r,o,1,1]),i=((n||0)/uv+1)*256,a=Cl(xl([],e,t)),l=Cl(e),u=Cl(t),d=4*((4*l*u-(a-l-u)**2)/16)/a;c=pl([],e,t,(Math.sqrt(l-d)-Math.sqrt(Math.max(0,i*i-d)))/Math.sqrt(a))}let[l,u,d]=this.unprojectPosition(c);return Number.isFinite(a)?[l,u,d]:Number.isFinite(n)?[l,u,n]:[l,u]}projectPosition(e){let[t,n,r=0]=e,i=t*cv,a=n*cv,o=Math.cos(a),s=(r/uv+1)*256;return[Math.sin(i)*o*s,-Math.cos(i)*o*s,Math.sin(a)*s]}unprojectPosition(e){let[t,n,r]=e,i=Sl(e),a=Math.asin(r/i);return[Math.atan2(t,-n)*lv,a*lv,(i/256-1)*uv]}projectFlat(e){return e}unprojectFlat(e){return e}panByPosition([e,t,n],r,i){let a=.25/2**(this.zoom-pv(this.latitude)),o=e+a*(i[0]-r[0]),s=t-a*(i[1]-r[1]);s=Math.max(Math.min(s,em),-em);let c={longitude:o,latitude:s,zoom:n-pv(t)};return c.zoom+=pv(c.latitude),c}};fv.displayName=`GlobeViewport`;function pv(e){let t=Math.PI*Math.cos(e*Math.PI/180);return Math.log2(t)}function mv(e,t){let n=gu([],t,e);return fu(n,n,1/n[3]),n}var hv=[`longitude`,`latitude`,`zoom`,`bearing`,`pitch`],gv=[`longitude`,`latitude`,`zoom`],_v=class extends sv{constructor(e={}){let t=Array.isArray(e)?e:e.transitionProps,n=Array.isArray(e)?{}:e;n.transitionProps=Array.isArray(t)?{compare:t,required:t}:t||{compare:hv,required:gv},super(n.transitionProps),this.opts=n}initializeProps(e,t){let n=super.initializeProps(e,t),{makeViewport:r,around:i}=this.opts;if(r&&i)if(r(e)instanceof fv)fo.warn(`around not supported in GlobeView`)();else{let a=r(e),o=r(t),s=a.unproject(i);n.start.around=i,Object.assign(n.end,{around:o.project(s),aroundPosition:s,width:t.width,height:t.height})}return n}interpolateProps(e,t,n){let r={};for(let i of this._propsToExtract)r[i]=Ac(e[i]||0,t[i]||0,n);if(t.aroundPosition&&this.opts.makeViewport){let i=this.opts.makeViewport({...t,...r});Object.assign(r,i.panByPosition(t.aroundPosition,Ac(e.around,t.around,n)))}return r}},vv={transitionDuration:0},yv=300,bv=e=>1-(1-e)*(1-e),xv={WHEEL:[`wheel`],PAN:[`panstart`,`panmove`,`panend`],PINCH:[`pinchstart`,`pinchmove`,`pinchend`],MULTI_PAN:[`multipanstart`,`multipanmove`,`multipanend`],DOUBLE_CLICK:[`dblclick`],KEYBOARD:[`keydown`]},Sv={},Cv=class{constructor(e){this.state={},this._events={},this._interactionState={isDragging:!1},this._customEvents=[],this._eventStartBlocked=null,this._panMove=!1,this.invertPan=!1,this.dragMode=`rotate`,this.inertia=0,this.scrollZoom=!0,this.dragPan=!0,this.dragRotate=!0,this.doubleClickZoom=!0,this.touchZoom=!0,this.touchRotate=!1,this.keyboard=!0,this.transitionManager=new av({...e,getControllerState:e=>new this.ControllerState(e),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=e.eventManager,this.onViewStateChange=e.onViewStateChange||(()=>{}),this.onStateChange=e.onStateChange||(()=>{}),this.makeViewport=e.makeViewport,this.pickPosition=e.pickPosition}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.props&&this.setProps(this.props)}finalize(){for(let e in this._events)this._events[e]&&this.eventManager?.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){this._controllerState=void 0;let t=this._eventStartBlocked;switch(e.type){case`panstart`:return!t&&this._onPanStart(e);case`panmove`:return this._onPan(e);case`panend`:return this._onPanEnd(e);case`pinchstart`:return!t&&this._onPinchStart(e);case`pinchmove`:return this._onPinch(e);case`pinchend`:return this._onPinchEnd(e);case`multipanstart`:return!t&&this._onMultiPanStart(e);case`multipanmove`:return this._onMultiPan(e);case`multipanend`:return this._onMultiPanEnd(e);case`dblclick`:return this._onDoubleClick(e);case`wheel`:return this._onWheel(e);case`keydown`:return this._onKeyDown(e);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(e){let{x:t,y:n}=this.props,{offsetCenter:r}=e;return[r.x-t,r.y-n]}isPointInBounds(e,t){let{width:n,height:r}=this.props;if(t&&t.handled)return!1;let i=e[0]>=0&&e[0]<=n&&e[1]>=0&&e[1]<=r;return i&&t&&t.stopPropagation(),i}isFunctionKeyPressed(e){let{srcEvent:t}=e;return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(e){let t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){e.dragMode&&(this.dragMode=e.dragMode);let t=this.props;this.props=e,`transitionInterpolator`in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let{inertia:n}=e;this.inertia=Number.isFinite(n)?n:n===!0?yv:0;let{scrollZoom:r=!0,dragPan:i=!0,dragRotate:a=!0,doubleClickZoom:o=!0,touchZoom:s=!0,touchRotate:c=!1,keyboard:l=!0}=e,u=!!this.onViewStateChange;if(this.toggleEvents(xv.WHEEL,u&&r),this.toggleEvents(xv.PAN,u),this.toggleEvents(xv.PINCH,u&&(s||c)),this.toggleEvents(xv.MULTI_PAN,u&&c),this.toggleEvents(xv.DOUBLE_CLICK,u&&o),this.toggleEvents(xv.KEYBOARD,u&&l),this.scrollZoom=r,this.dragPan=i,this.dragRotate=a,this.doubleClickZoom=o,this.touchZoom=s,this.touchRotate=c,this.keyboard=l,(!t||t.height!==e.height||t.width!==e.width||t.maxBounds!==e.maxBounds)&&e.maxBounds){let t=new this.ControllerState({...e,makeViewport:this.makeViewport}),n=t.getViewportProps();Object.keys(n).some(t=>!B_(n[t],e[t],1))&&this.updateViewport(t)}}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(e=>{this._events[e]!==t&&(this._events[e]=t,t?this.eventManager.on(e,this.handleEvent):this.eventManager.off(e,this.handleEvent))})}updateViewport(e,t=null,n={}){let r={...e.getViewportProps(),...t},i=this.controllerState!==e;if(this.state=e.getState(),this._setInteractionState(n),i){let e=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:e,viewId:this.props.id})}}_onTransition(e){this.onViewStateChange({...e,interactionState:this._interactionState,viewId:this.props.id})}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange(this._interactionState)}_onPanStart(e){let t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let n=this.isFunctionKeyPressed(e)||e.rightButton||!1;(this.invertPan||this.dragMode===`pan`)&&(n=!n);let r=this.controllerState[n?`panStart`:`rotateStart`]({pos:t});return this._panMove=n,this.updateViewport(r,vv,{isDragging:!0}),!0}_onPan(e){return this.isDragging()?this._panMove?this._onPanMove(e):this._onPanRotate(e):!1}_onPanEnd(e){return this.isDragging()?this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e):!1}_onPanMove(e){if(!this.dragPan)return!1;let t=this.getCenter(e),n=this.controllerState.pan({pos:t});return this.updateViewport(n,vv,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){let{inertia:t}=this;if(this.dragPan&&t&&e.velocity){let n=this.getCenter(e),r=[n[0]+e.velocityX*t/2,n[1]+e.velocityY*t/2],i=this.controllerState.pan({pos:r}).panEnd();this.updateViewport(i,{...this._getTransitionProps(),transitionDuration:t,transitionEasing:bv},{isDragging:!1,isPanning:!0})}else{let e=this.controllerState.panEnd();this.updateViewport(e,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;let t=this.getCenter(e),n=this.controllerState.rotate({pos:t});return this.updateViewport(n,vv,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){let{inertia:t}=this;if(this.dragRotate&&t&&e.velocity){let n=this.getCenter(e),r=[n[0]+e.velocityX*t/2,n[1]+e.velocityY*t/2],i=this.controllerState.rotate({pos:r}).rotateEnd();this.updateViewport(i,{...this._getTransitionProps(),transitionDuration:t,transitionEasing:bv},{isDragging:!1,isRotating:!0})}else{let e=this.controllerState.rotateEnd();this.updateViewport(e,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;let t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;e.srcEvent.preventDefault();let{speed:n=.01,smooth:r=!1}=this.scrollZoom===!0?{}:this.scrollZoom,{delta:i}=e,a=2/(1+Math.exp(-Math.abs(i*n)));i<0&&a!==0&&(a=1/a);let o=r?{...this._getTransitionProps({around:t}),transitionDuration:250}:vv,s=this.controllerState.zoom({pos:t,scale:a});return this.updateViewport(s,o,{isZooming:!0,isPanning:!0}),r||this._setInteractionState({isZooming:!1,isPanning:!1}),!0}_onMultiPanStart(e){let t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let n=this.controllerState.rotateStart({pos:t});return this.updateViewport(n,vv,{isDragging:!0}),!0}_onMultiPan(e){if(!this.touchRotate||!this.isDragging())return!1;let t=this.getCenter(e);t[0]-=e.deltaX;let n=this.controllerState.rotate({pos:t});return this.updateViewport(n,vv,{isDragging:!0,isRotating:!0}),!0}_onMultiPanEnd(e){if(!this.isDragging())return!1;let{inertia:t}=this;if(this.touchRotate&&t&&e.velocityY){let n=this.getCenter(e),r=[n[0],n[1]+=e.velocityY*t/2],i=this.controllerState.rotate({pos:r});this.updateViewport(i,{...this._getTransitionProps(),transitionDuration:t,transitionEasing:bv},{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{let e=this.controllerState.rotateEnd();this.updateViewport(e,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){let t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return Sv._startPinchRotation=e.rotation,Sv._lastPinchEvent=e,this.updateViewport(n,vv,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let t=this.controllerState;if(this.touchZoom){let{scale:n}=e,r=this.getCenter(e);t=t.zoom({pos:r,scale:n})}if(this.touchRotate){let{rotation:n}=e;t=t.rotate({deltaAngleX:Sv._startPinchRotation-n})}return this.updateViewport(t,vv,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),Sv._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;let{inertia:t}=this,{_lastPinchEvent:n}=Sv;if(this.touchZoom&&t&&n&&e.scale!==n.scale){let r=this.getCenter(e),i=this.controllerState.rotateEnd(),a=Math.log2(e.scale),o=2**(a+(a-Math.log2(n.scale))/(e.deltaTime-n.deltaTime)*t/2);i=i.zoom({pos:r,scale:o}).zoomEnd(),this.updateViewport(i,{...this._getTransitionProps({around:r}),transitionDuration:t,transitionEasing:bv},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{let e=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(e,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return Sv._startPinchRotation=null,Sv._lastPinchEvent=null,!0}_onDoubleClick(e){if(!this.doubleClickZoom)return!1;let t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let n=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(r,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;let t=this.isFunctionKeyPressed(e),{zoomSpeed:n,moveSpeed:r,rotateSpeedX:i,rotateSpeedY:a}=this.keyboard===!0?{}:this.keyboard,{controllerState:o}=this,s,c={};switch(e.srcEvent.code){case`Minus`:s=t?o.zoomOut(n).zoomOut(n):o.zoomOut(n),c.isZooming=!0;break;case`Equal`:s=t?o.zoomIn(n).zoomIn(n):o.zoomIn(n),c.isZooming=!0;break;case`ArrowLeft`:t?(s=o.rotateLeft(i),c.isRotating=!0):(s=o.moveLeft(r),c.isPanning=!0);break;case`ArrowRight`:t?(s=o.rotateRight(i),c.isRotating=!0):(s=o.moveRight(r),c.isPanning=!0);break;case`ArrowUp`:t?(s=o.rotateUp(a),c.isRotating=!0):(s=o.moveUp(r),c.isPanning=!0);break;case`ArrowDown`:t?(s=o.rotateDown(a),c.isRotating=!0):(s=o.moveDown(r),c.isPanning=!0);break;default:return!1}return this.updateViewport(s,this._getTransitionProps(),c),!0}_getTransitionProps(e){let{transition:t}=this;return!t||!t.transitionInterpolator?vv:e?{...t,transitionInterpolator:new _v({...e,...t.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:t}},wv=class{constructor(e,t,n){this.makeViewport=n,this._viewportProps=this.applyConstraints(e),this._state=t}getViewportProps(){return this._viewportProps}getState(){return this._state}},Tv=5,Ev=1.2,Dv=512,Ov=[[-1/0,-90],[1/0,90]];function kv([e,t]){if(Math.abs(t)>90&&(t=Math.sign(t)*90),Number.isFinite(e)){let[n,r]=rm([e,t]);return[n,kc(r,0,Dv)]}let[,n]=rm([0,t]);return[e,kc(n,0,Dv)]}var Av=class extends wv{constructor(e){let{width:t,height:n,latitude:r,longitude:i,zoom:a,bearing:o=0,pitch:s=0,altitude:c=1.5,position:l=[0,0,0],maxZoom:u=20,minZoom:d=0,maxPitch:f=60,minPitch:p=0,startPanLngLat:m,startZoomLngLat:h,startRotatePos:g,startRotateLngLat:_,startBearing:v,startPitch:y,startZoom:b,normalize:x=!0}=e;ov(Number.isFinite(i)),ov(Number.isFinite(r)),ov(Number.isFinite(a));let S=e.maxBounds||(x?Ov:null);super({width:t,height:n,latitude:r,longitude:i,zoom:a,bearing:o,pitch:s,altitude:c,maxZoom:u,minZoom:d,maxPitch:f,minPitch:p,normalize:x,position:l,maxBounds:S},{startPanLngLat:m,startZoomLngLat:h,startRotatePos:g,startRotateLngLat:_,startBearing:v,startPitch:y,startZoom:b},e.makeViewport),this.getAltitude=e.getAltitude}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){let n=this.getState().startPanLngLat||this._unproject(t);if(!n)return this;let r=this.makeViewport(this.getViewportProps()).panByPosition(n,e);return this._getUpdatedState(r)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){let t=this.getAltitude?.(e);return this._getUpdatedState({startRotatePos:e,startRotateLngLat:t===void 0?void 0:this._unproject3D(e,t),startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:n=0}){let{startRotatePos:r,startRotateLngLat:i,startBearing:a,startPitch:o}=this.getState();if(!r||a===void 0||o===void 0)return this;let s;if(s=e?this._getNewRotation(e,r,o,a):{bearing:a+t,pitch:o+n},i){let e=this.makeViewport({...this.getViewportProps(),...s}),t=`panByPosition3D`in e?`panByPosition3D`:`panByPosition`;return this._getUpdatedState({...s,...e[t](i,r)})}return this._getUpdatedState(s)}rotateEnd(){return this._getUpdatedState({startRotatePos:null,startRotateLngLat:null,startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom({pos:e,startPos:t,scale:n}){let{startZoom:r,startZoomLngLat:i}=this.getState();if(i||=(r=this.getViewportProps().zoom,this._unproject(t)||this._unproject(e)),!i)return this;let a=this._constrainZoom(r+Math.log2(n)),o=this.makeViewport({...this.getViewportProps(),zoom:a});return this._getUpdatedState({zoom:a,...o.panByPosition(i,e)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-e})}shortestPathFrom(e){let t=e.getViewportProps(),n={...this.getViewportProps()},{bearing:r,longitude:i}=n;return Math.abs(r-t.bearing)>180&&(n.bearing=r<0?r+360:r-360),Math.abs(i-t.longitude)>180&&(n.longitude=i<0?i+360:i-360),n}applyConstraints(e){let{maxPitch:t,minPitch:n,pitch:r,longitude:i,bearing:a,normalize:o,maxBounds:s}=e;if(o&&((i<-180||i>180)&&(e.longitude=ih(i+180,360)-180),(a<-180||a>180)&&(e.bearing=ih(a+180,360)-180)),e.pitch=kc(r,n,t),e.zoom=this._constrainZoom(e.zoom,e),s){let t=kv(s[0]),n=kv(s[1]),r=2**e.zoom,i=e.width/2/r,a=e.height/2/r,[o,c]=im([t[0]+i,t[1]+a]),[l,u]=im([n[0]-i,n[1]-a]);e.longitude=kc(e.longitude,o,l),e.latitude=kc(e.latitude,c,u)}return e}_constrainZoom(e,t){t||=this.getViewportProps();let{maxZoom:n,maxBounds:r}=t,i=r!==null&&t.width>0&&t.height>0,{minZoom:a}=t;if(i){let e=kv(r[0]),i=kv(r[1]),o=i[0]-e[0],s=i[1]-e[1];Number.isFinite(o)&&o>0&&(a=Math.max(a,Math.log2(t.width/o))),Number.isFinite(s)&&s>0&&(a=Math.max(a,Math.log2(t.height/s))),a>n&&(a=n)}return kc(e,a,n)}_zoomFromCenter(e){let{width:t,height:n}=this.getViewportProps();return this.zoom({pos:[t/2,n/2],scale:e})}_panFromCenter(e){let{width:t,height:n}=this.getViewportProps();return this.pan({startPos:[t/2,n/2],pos:[t/2+e[0],n/2+e[1]]})}_getUpdatedState(e){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...e})}_unproject(e){let t=this.makeViewport(this.getViewportProps());return e&&t.unproject(e)}_unproject3D(e,t){return this.makeViewport(this.getViewportProps()).unproject(e,{targetZ:t})}_getNewRotation(e,t,n,r){let i=e[0]-t[0],a=e[1]-t[1],o=e[1],s=t[1],{width:c,height:l}=this.getViewportProps(),u=i/c,d=0;a>0?Math.abs(l-s)>Tv&&(d=a/(s-l)*Ev):a<0&&s>Tv&&(d=1-o/s),d=kc(d,-1,1);let{minPitch:f,maxPitch:p}=this.getViewportProps(),m=r+180*u,h=n;return d>0?h=n+d*(p-n):d<0&&(h=n-d*(f-n)),{pitch:h,bearing:m}}},jv=class extends Cv{constructor(){super(...arguments),this.ControllerState=Av,this.transition={transitionDuration:300,transitionInterpolator:new _v({transitionProps:{compare:[`longitude`,`latitude`,`zoom`,`bearing`,`pitch`,`position`],required:[`longitude`,`latitude`,`zoom`]}})},this.dragMode=`pan`,this.rotationPivot=`center`,this._getAltitude=e=>{if(this.rotationPivot===`2d`)return 0;if(this.rotationPivot===`3d`&&this.pickPosition){let{x:t,y:n}=this.props,r=this.pickPosition(t+e[0],n+e[1]);if(r&&r.coordinate&&r.coordinate.length>=3)return r.coordinate[2]}}}setProps(e){`rotationPivot`in e&&(this.rotationPivot=e.rotationPivot||`center`),e.getAltitude=this._getAltitude,e.position=e.position||[0,0,0],e.maxBounds=e.maxBounds||(e.normalize===!1?null:Ov),super.setProps(e)}updateViewport(e,t=null,n={}){let r=e.getState();n.isDragging&&r.startRotateLngLat?n={...n,rotationPivotPosition:r.startRotateLngLat}:n.isDragging===!1&&(n={...n,rotationPivotPosition:void 0}),super.updateViewport(e,t,n)}},Mv=class extends $_{constructor(e={}){super(e)}getViewportType(){return yh}get ControllerType(){return jv}};Mv.displayName=`MapView`;var Nv=new th;function Pv(e,t){return(e.order??1/0)-(t.order??1/0)}var Fv=class{constructor(e){this._resolvedEffects=[],this._defaultEffects=[],this.effects=[],this._context=e,this._needsRedraw=`Initial render`,this._setEffects([])}addDefaultEffect(e){let t=this._defaultEffects;if(!t.find(t=>t.id===e.id)){let n=t.findIndex(t=>Pv(t,e)>0);n<0?t.push(e):t.splice(n,0,e),e.setup(this._context),this._setEffects(this.effects)}}setProps(e){`effects`in e&&(B_(e.effects,this.effects,1)||this._setEffects(e.effects))}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._resolvedEffects}_setEffects(e){let t={};for(let e of this.effects)t[e.id]=e;let n=[];for(let r of e){let e=t[r.id],i=r;e&&e!==r?e.setProps?(e.setProps(r.props),i=e):e.cleanup(this._context):e||r.setup(this._context),n.push(i),delete t[r.id]}for(let e in t)t[e].cleanup(this._context);this.effects=n,this._resolvedEffects=n.concat(this._defaultEffects),e.some(e=>e instanceof th)||this._resolvedEffects.push(Nv),this._needsRedraw=`effects changed`}finalize(){for(let e of this._resolvedEffects)e.cleanup(this._context);this.effects.length=0,this._resolvedEffects.length=0,this._defaultEffects.length=0}},Iv=class extends qm{shouldDrawLayer(e){let{operation:t}=e.props;return t.includes(`draw`)||t.includes(`terrain`)}render(e){return this._render(e)}},Lv=`deckRenderer.renderLayers`,Rv=class{constructor(e,t={}){this.device=e,this.stats=t.stats,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Iv(e),this.pickLayersPass=new S_(e),this.renderCount=0,this._needsRedraw=`Initial render`,this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw=`layerFilter changed`),this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw=`drawPickingColors changed`)}renderLayers(e){if(!e.viewports.length)return;let t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,n={layerFilter:this.layerFilter,isPicking:this.drawPickingColors,...e};n.effects&&this._preRender(n.effects,n);let r=this.lastPostProcessEffect?this.renderBuffers[0]:n.target;this.lastPostProcessEffect&&(n.clearColor=[0,0,0,0],n.clearCanvas=!0);let i=t.render({...n,target:r}),a=`stats`in i?i.stats:i;n.effects&&(this.lastPostProcessEffect&&(n.clearCanvas=e.clearCanvas===void 0||e.clearCanvas),this._postRender(n.effects,n)),this.renderCount++,ho(Lv,this,a,e),this._updateStats(a)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){let{renderBuffers:e}=this;for(let t of e)t.delete();e.length=0}_updateStats(e){if(!this.stats)return;let t=0;for(let{visibleCount:n}of e)t+=n;this.stats.get(`Layers rendered`).addCount(t)}_preRender(e,t){this.lastPostProcessEffect=null,t.preRenderStats=t.preRenderStats||{};for(let n of e)t.preRenderStats[n.id]=n.preRender(t),n.postRender&&(this.lastPostProcessEffect=n.id);this.lastPostProcessEffect&&this._resizeRenderBuffers()}_resizeRenderBuffers(){let{renderBuffers:e}=this,t=this.device.canvasContext.getDrawingBufferSize(),[n,r]=t;e.length===0&&[0,1].map(t=>{let i=this.device.createTexture({sampler:{minFilter:`linear`,magFilter:`linear`},width:n,height:r});e.push(this.device.createFramebuffer({id:`deck-renderbuffer-${t}`,colorAttachments:[i]}))});for(let n of e)n.resize(t)}_postRender(e,t){let{renderBuffers:n}=this,r={...t,inputBuffer:n[0],swapBuffer:n[1]};for(let i of e)if(i.postRender){r.target=i.id===this.lastPostProcessEffect?t.target:void 0;let e=i.postRender(r);r.inputBuffer=e,r.swapBuffer=e===n[0]?n[1]:n[0]}}},zv={pickedColor:null,pickedObjectIndex:-1};function Bv({pickedColors:e,decodePickingColor:t,deviceX:n,deviceY:r,deviceRadius:i,deviceRect:a}){let{x:o,y:s,width:c,height:l}=a,u=i*i,d=-1,f=0;for(let t=0;tu)f+=4*c;else for(let t=0;t=0){let e=t+o-n,r=e*e+a;r<=u&&(u=r,d=f)}f+=4}}if(d>=0){let n=e.slice(d,d+4),r=t(n);if(r){let e=Math.floor(d/4/c),t=d/4-e*c;return{...r,pickedColor:n,pickedX:o+t,pickedY:s+e}}fo.error(`Picked non-existent layer. Is picking buffer corrupt?`)()}return zv}function Vv({pickedColors:e,decodePickingColor:t}){let n=new Map;if(e){for(let r=0;r=0){let i=e.slice(r,r+4),a=i.join(`,`);if(!n.has(a)){let e=t(i);e?n.set(a,{...e,color:i}):fo.error(`Picked non-existent layer. Is picking buffer corrupt?`)()}}}return Array.from(n.values())}function Hv({pickInfo:e,viewports:t,pixelRatio:n,x:r,y:i,z:a}){let o=t[0];t.length>1&&(o=Gv(e?.pickedViewports||t,{x:r,y:i}));let s;if(o){let e=[r-o.x,i-o.y];a!==void 0&&(e[2]=a),s=o.unproject(e)}return{color:null,layer:null,viewport:o,index:-1,picked:!1,x:r,y:i,pixel:[r,i],coordinate:s,devicePixel:e&&`pickedX`in e?[e.pickedX,e.pickedY]:void 0,pixelRatio:n}}function Uv(e){let{pickInfo:t,lastPickedInfo:n,mode:r,layers:i}=e,{pickedColor:a,pickedLayer:o,pickedObjectIndex:s}=t,c=o?[o]:[];if(r===`hover`){let e=n.index,t=n.layerId,r=o?o.props.id:null;if(r!==t||s!==e){if(r!==t){let e=i.find(e=>e.props.id===t);e&&c.unshift(e)}n.layerId=r,n.index=s,n.info=null}}let l=Hv(e),u=new Map;return u.set(null,l),c.forEach(e=>{let t={...l};e===o&&(t.color=a,t.index=s,t.picked=!0),t=Wv({layer:e,info:t,mode:r});let i=t.layer;e===o&&r===`hover`&&(n.info=t),u.set(i.id,t),r===`hover`&&i.updateAutoHighlight(t)}),u}function Wv({layer:e,info:t,mode:n}){for(;e&&t;){let r=t.layer||null;t.sourceLayer=r,t.layer=e,t=e.getPickingInfo({info:t,mode:n,sourceLayer:r}),e=e.parent}return t}function Gv(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.containsPixel(t))return r}return e[0]}var Kv=class{constructor(e,t={}){this._pickable=!0,this.device=e,this.stats=t.stats,this.pickLayersPass=new S_(e),this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){`layerFilter`in e&&(this.layerFilter=e.layerFilter),`_pickable`in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.destroy(),this.depthFBO&&this.depthFBO.destroy()}pickObjectAsync(e){return this._pickClosestObjectAsync(e)}pickObjectsAsync(e){return this._pickVisibleObjectsAsync(e)}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:n,viewports:r},i=this.lastPickedInfo.info){let a=i&&i.layer&&i.layer.id,o=i&&i.viewport&&i.viewport.id,s=a?n.find(e=>e.id===a):null,c=o&&r.find(e=>e.id===o)||r[0],l={x:e,y:t,viewport:c,coordinate:c&&c.unproject([e-c.x,t-c.y]),layer:s};return{...i,...l}}_resizeBuffer(e=this.device.getDefaultCanvasContext()){if(!this.pickingFBO){let e=this.device.createTexture({format:`rgba8unorm`,width:1,height:1,usage:Se.RENDER_ATTACHMENT|Se.COPY_SRC});if(this.pickingFBO=this.device.createFramebuffer({colorAttachments:[e],depthStencilAttachment:`depth16unorm`}),this.device.isTextureFormatRenderable(`rgba32float`)){let e=this.device.createTexture({format:`rgba32float`,width:1,height:1,usage:Se.RENDER_ATTACHMENT|Se.COPY_SRC}),t=this.device.createFramebuffer({colorAttachments:[e],depthStencilAttachment:`depth16unorm`});this.depthFBO=t}}let[t,n]=e.getDrawingBufferSize();this.pickingFBO?.resize({width:t,height:n}),this.depthFBO?.resize({width:t,height:n})}_getPickable(e){if(this._pickable===!1)return null;let t=e.filter(e=>this.pickLayersPass.shouldDrawLayer(e)&&!e.isComposite);return t.length?t:null}async _pickClosestObjectAsync({layers:e,views:t,viewports:n,x:r,y:i,radius:a=0,depth:o=1,mode:s=`query`,unproject3D:c,canvasContext:l=this.device.getDefaultCanvasContext(),onViewportActive:u,effects:d}){let f=l.cssToDeviceRatio(),p=this._getPickable(e);if(!p||n.length===0)return{result:[],emptyInfo:Hv({viewports:n,x:r,y:i,pixelRatio:f})};this._resizeBuffer(l);let m=l.cssToDevicePixels([r,i],!0),h=[m.x+Math.floor(m.width/2),m.y+Math.floor(m.height/2)],g=Math.round(a*f),{width:_,height:v}=this.pickingFBO,y=this._getPickingRect({deviceX:h[0],deviceY:h[1],deviceRadius:g,deviceWidth:_,deviceHeight:v}),b={x:r-a,y:i-a,width:a*2+1,height:a*2+1},x,S=[],C=new Set;for(let e=0;e0){let{pickedColors:e}=await this._drawAndSampleAsync({layers:m,views:t,viewports:n,onViewportActive:u,deviceRect:{x:a.pickedX??h[0],y:a.pickedY??h[1],width:1,height:1},cullRect:b,effects:d,pass:`picking:${s}:z`},!0);e[3]&&(l=e[0])}a.pickedLayer&&e+10){let{pickedColors:e}=this._drawAndSample({layers:m,views:t,viewports:n,onViewportActive:u,deviceRect:{x:a.pickedX??h[0],y:a.pickedY??h[1],width:1,height:1},cullRect:b,effects:d,pass:`picking:${s}:z`},!0);e[3]&&(l=e[0])}a.pickedLayer&&e+1=c);e++){let t=x[e],n={color:t.pickedColor,layer:null,index:t.pickedObjectIndex,picked:!0,x:r,y:i,pixelRatio:p};n=Wv({layer:t.pickedLayer,info:n,mode:s});let a=n.layer.id;S.has(a)||S.set(a,new Set);let o=S.get(a),c=n.object??n.index;o.has(c)||(o.add(c),C.push(n))}return C}_pickVisibleObjects({layers:e,views:t,viewports:n,x:r,y:i,width:a=1,height:o=1,mode:s=`query`,maxObjects:c=null,canvasContext:l=this.device.getDefaultCanvasContext(),onViewportActive:u,effects:d}){let f=this._getPickable(e);if(!f||n.length===0)return[];this._resizeBuffer(l);let p=l.cssToDeviceRatio(),m=l.cssToDevicePixels([r,i],!0),h=m.x,g=m.y+m.height,_=l.cssToDevicePixels([r+a,i+o],!0),v=_.x+_.width,y=_.y,b={x:h,y,width:v-h,height:g-y},x=Vv(this._drawAndSample({layers:f,views:t,viewports:n,onViewportActive:u,deviceRect:b,cullRect:{x:r,y:i,width:a,height:o},effects:d,pass:`picking:${s}`})),S=new Map,C=[],w=Number.isFinite(c);for(let e=0;e=c);e++){let t=x[e],n={color:t.pickedColor,layer:null,index:t.pickedObjectIndex,picked:!0,x:r,y:i,pixelRatio:p};n=Wv({layer:t.pickedLayer,info:n,mode:s});let a=n.layer.id;S.has(a)||S.set(a,new Set);let o=S.get(a),c=n.object??n.index;o.has(c)||(o.add(c),C.push(n))}return C}async _drawAndSampleAsync({layers:e,views:t,viewports:n,onViewportActive:r,deviceRect:i,cullRect:a,effects:o,pass:s},c=!1){let l=c?this.depthFBO:this.pickingFBO,u={layers:e,layerFilter:this.layerFilter,views:t,viewports:n,onViewportActive:r,pickingFBO:l,deviceRect:i,cullRect:a,effects:o,pass:s,pickZ:c,preRenderStats:{},isPicking:!0};for(let e of o)e.useInPicking&&(u.preRenderStats[e.id]=e.preRender(u));let{decodePickingColor:d,stats:f}=this.pickLayersPass.render(u);this._updateStats(f);let{x:p,y:m,width:h,height:g}=i,_=l.colorAttachments[0]?.texture;if(!_)throw Error(`Picking framebuffer color attachment is missing`);let v=await this._readTextureDataAsync(_,{x:p,y:m,width:h,height:g},c?Float32Array:Uint8Array);if(!c){let e=!1;for(let t=3;t0&&fo.warn(`Async pick readback returned only zero alpha values`,{deviceRect:i,bytes:Array.from(v.subarray(0,Math.min(v.length,16)))})()}return{pickedColors:v,decodePickingColor:d}}async _readTextureDataAsync(e,t,n){let{width:r,height:i}=t,a=e.computeMemoryLayout(t),o=this.device.createBuffer({byteLength:a.byteLength,usage:U.COPY_DST|U.MAP_READ});try{e.readBuffer(t,o);let s=await o.readAsync(0,a.byteLength),c=n.BYTES_PER_ELEMENT;if(a.bytesPerRow%c!==0)throw Error(`Texture readback row stride ${a.bytesPerRow} is not aligned to ${c}-byte elements.`);let l=new n(s.buffer,s.byteOffset,a.byteLength/c),u=r*4,d=a.bytesPerRow/c;if(de.props.operation.includes(`terrain`))}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:n,deviceWidth:r,deviceHeight:i}){let a=Math.max(0,e-n),o=Math.max(0,t-n),s=Math.min(r,e+n+1)-a,c=Math.min(i,t+n+1)-o;return s<=0||c<=0?null:{x:a,y:o,width:s,height:c}}},qv={"top-left":{top:0,left:0},"top-right":{top:0,right:0},"bottom-left":{bottom:0,left:0},"bottom-right":{bottom:0,right:0},fill:{top:0,left:0,bottom:0,right:0}},Jv=`top-left`,Yv=`root`,Xv=class{constructor({deck:e,parentElement:t}){this.defaultWidgets=[],this.widgets=[],this.resolvedWidgets=[],this.containers={},this.lastViewports={},this.deck=e,t?.classList.add(`deck-widget-container`),this.parentElement=t}getWidgets(){return this.resolvedWidgets}setProps(e){if(e.widgets&&!B_(e.widgets,this.widgets,1)){let t=e.widgets.filter(Boolean);this._setWidgets(t)}}finalize(){for(let e of this.getWidgets())this._removeWidget(e);this.defaultWidgets.length=0,this.resolvedWidgets.length=0;for(let e in this.containers)this.containers[e].remove()}addDefault(e){this.defaultWidgets.find(t=>t.id===e.id)||(this._addWidget(e),this.defaultWidgets.push(e),this._setWidgets(this.widgets))}onRedraw({viewports:e,layers:t}){let n=e.reduce((e,t)=>(e[t.id]=t,e),{});for(let r of this.getWidgets()){let{viewId:i}=r;if(i){let e=n[i];e&&(r.onViewportChange&&r.onViewportChange(e),r.onRedraw?.({viewports:[e],layers:t}))}else{if(r.onViewportChange)for(let t of e)r.onViewportChange(t);r.onRedraw?.({viewports:e,layers:t})}}this.lastViewports=n,this._updateContainers()}onHover(e,t){for(let n of this.getWidgets()){let{viewId:r}=n;(!r||r===e.viewport?.id)&&n.onHover?.(e,t)}}onEvent(e,t){let n=yp[t.type];if(n)for(let r of this.getWidgets()){let{viewId:i}=r;(!i||i===e.viewport?.id)&&r[n]?.(e,t)}}_setWidgets(e){let t={};for(let e of this.resolvedWidgets)t[e.id]=e;this.resolvedWidgets.length=0;for(let e of this.defaultWidgets)t[e.id]=null,this.resolvedWidgets.push(e);for(let n of e){let e=t[n.id];e?e.viewId!==n.viewId||e.placement!==n.placement?(this._removeWidget(e),this._addWidget(n)):n!==e&&(e.setProps(n.props),n=e):this._addWidget(n),t[n.id]=null,this.resolvedWidgets.push(n)}for(let e in t){let n=t[e];n&&this._removeWidget(n)}this.widgets=e}_addWidget(e){let{viewId:t=null,placement:n=Jv}=e,r=e.props._container??t;e.widgetManager=this,e.deck=this.deck,e.rootElement=e._onAdd({deck:this.deck,viewId:t}),e.rootElement&&this._getContainer(r,n).append(e.rootElement),e.updateHTML()}_removeWidget(e){e.onRemove?.(),e.rootElement&&e.rootElement.remove(),e.rootElement=void 0,e.deck=void 0,e.widgetManager=void 0}_getContainer(e,t){if(e&&typeof e!=`string`)return e;let n=e||Yv,r=this.containers[n];r||(r=document.createElement(`div`),r.style.pointerEvents=`none`,r.style.position=`absolute`,r.style.overflow=`hidden`,this.parentElement?.append(r),this.containers[n]=r);let i=r.querySelector(`.${t}`);return i||(i=globalThis.document.createElement(`div`),i.className=t,i.style.position=`absolute`,i.style.zIndex=`2`,Object.assign(i.style,qv[t]),r.append(i)),i}_updateContainers(){let e=this.deck.width,t=this.deck.height;for(let n in this.containers){let r=this.lastViewports[n]||null,i=n===Yv||r,a=this.containers[n];i?(a.style.display=`block`,a.style.left=`${r?r.x:0}px`,a.style.top=`${r?r.y:0}px`,a.style.width=`${r?r.width:e}px`,a.style.height=`${r?r.height:t}px`):a.style.display=`none`}}};function Zv(e,t){t&&Object.entries(t).map(([t,n])=>{t.startsWith(`--`)?e.style.setProperty(t,n):e.style[t]=n})}function Qv(e,t){t&&Object.keys(t).map(t=>{t.startsWith(`--`)?e.style.removeProperty(t):e.style[t]=``})}var $v=class{constructor(e){this.viewId=null,this.props={...this.constructor.defaultProps,...e},this.id=this.props.id}setProps(e){let t=this.props,n=this.rootElement;n&&t.className!==e.className&&(t.className&&n.classList.remove(t.className),e.className&&n.classList.add(e.className)),n&&!B_(t.style,e.style,1)&&(Qv(n,t.style),Zv(n,e.style)),Object.assign(this.props,e),this.updateHTML()}updateHTML(){this.rootElement&&this.onRenderHTML(this.rootElement)}get viewIds(){return this.viewId?[this.viewId]:this.deck?.getViews().map(e=>e.id)??[]}getViewState(e){return this.deck?.viewManager?.getViewState(e)||{}}setViewState(e,t){this.deck?._onViewStateChange({viewId:e,viewState:t,interactionState:{}})}onCreateRootElement(){let e=[`deck-widget`,this.className,this.props.className],t=document.createElement(`div`);return e.filter(e=>typeof e==`string`&&e.length>0).forEach(e=>t.classList.add(e)),Zv(t,this.props.style),t}_onAdd(e){return this.onAdd(e)??this.onCreateRootElement()}onAdd(e){}onRemove(){}onViewportChange(e){}onRedraw(e){}onHover(e,t){}onClick(e,t){}onDrag(e,t){}onDragStart(e,t){}onDragEnd(e,t){}};$v.defaultProps={id:`widget`,style:{},_container:null,className:``};var ey={zIndex:`1`,position:`absolute`,pointerEvents:`none`,color:`#a0a7b4`,backgroundColor:`#29323c`,padding:`10px`,top:`0`,left:`0`,display:`none`},ty=class extends $v{constructor(e={}){super(e),this.id=`default-tooltip`,this.placement=`fill`,this.className=`deck-tooltip`,this.isVisible=!1,this.setProps(e)}onCreateRootElement(){let e=document.createElement(`div`);return e.className=this.className,Object.assign(e.style,ey),e}onRenderHTML(e){}onViewportChange(e){this.isVisible&&e.id===this.lastViewport?.id&&!e.equals(this.lastViewport)&&this.setTooltip(null),this.lastViewport=e}onHover(e){let{deck:t}=this,n=t&&t.props.getTooltip;if(!n)return;let r=n(e);this.setTooltip(r,e.x,e.y)}setTooltip(e,t,n){let r=this.rootElement;if(r){if(typeof e==`string`)r.innerText=e;else if(e)e.text&&(r.innerText=e.text),e.html&&(r.innerHTML=e.html),e.className&&(r.className=e.className);else{this.isVisible=!1,r.style.display=`none`;return}this.isVisible=!0,r.style.display=`block`,r.style.transform=`translate(${t}px, ${n}px)`,e&&typeof e==`object`&&`style`in e&&Object.assign(r.style,e.style)}}};ty.defaultProps={...$v.defaultProps};var ny={WEBGL_depth_texture:{UNSIGNED_INT_24_8_WEBGL:34042},OES_element_index_uint:{},OES_texture_float:{},OES_texture_half_float:{HALF_FLOAT_OES:5131},EXT_color_buffer_float:{},OES_standard_derivatives:{FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723},EXT_frag_depth:{},EXT_blend_minmax:{MIN_EXT:32775,MAX_EXT:32776},EXT_shader_texture_lod:{}},ry=e=>({drawBuffersWEBGL(t){return e.drawBuffers(t)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),iy=e=>({VERTEX_ARRAY_BINDING_OES:34229,createVertexArrayOES(){return e.createVertexArray()},deleteVertexArrayOES(t){return e.deleteVertexArray(t)},isVertexArrayOES(t){return e.isVertexArray(t)},bindVertexArrayOES(t){return e.bindVertexArray(t)}}),ay=e=>({VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,drawArraysInstancedANGLE(...t){return e.drawArraysInstanced(...t)},drawElementsInstancedANGLE(...t){return e.drawElementsInstanced(...t)},vertexAttribDivisorANGLE(...t){return e.vertexAttribDivisor(...t)}});function oy(e=!0){let t=HTMLCanvasElement.prototype;if(!e&&t.originalGetContext){t.getContext=t.originalGetContext,t.originalGetContext=void 0;return}t.originalGetContext=t.getContext,t.getContext=function(e,t){if(e===`webgl`||e===`experimental-webgl`){let e=this.originalGetContext(`webgl2`,t);return e instanceof HTMLElement&&sy(e),e}return this.originalGetContext(e,t)}}function sy(e){e.getExtension(`EXT_color_buffer_float`);let t={...ny,WEBGL_disjoint_timer_query:e.getExtension(`EXT_disjoint_timer_query_webgl2`),WEBGL_draw_buffers:ry(e),OES_vertex_array_object:iy(e),ANGLE_instanced_arrays:ay(e)},n=e.getExtension;e.getExtension=function(r){return n.call(e,r)||(r in t?t[r]:null)};let r=e.getSupportedExtensions;e.getSupportedExtensions=function(){return(r.apply(e)||[])?.concat(Object.keys(t))}}var cy=1,ly=class extends He{type=`webgl`;constructor(){super(),Fe.defaultProps={...Fe.defaultProps,...we}}enforceWebGL2(e){oy(e)}isSupported(){return typeof WebGL2RenderingContext<`u`}isDeviceHandle(e){return typeof WebGL2RenderingContext<`u`&&e instanceof WebGL2RenderingContext?!0:(typeof WebGLRenderingContext<`u`&&e instanceof WebGLRenderingContext&&z.warn(`WebGL1 is not supported`,e)(),!1)}async attach(e,t={}){let{WebGLDevice:n}=await b(async()=>{let{WebGLDevice:e}=await import(`./webgl-device.7mKl-kgB.js`).then(e=>e.n);return{WebGLDevice:e}},__vite__mapDeps([0,1]),import.meta.url);if(e instanceof n)return e;let r=n.getDeviceFromContext(e);if(r)return r;if(!uy(e))throw Error(`Invalid WebGL2RenderingContext`);let i=t.createCanvasContext===!0?{}:t.createCanvasContext;return new n({...t,_handle:e,createCanvasContext:{canvas:e.canvas,autoResize:!1,...i}})}async create(e={}){let{WebGLDevice:t}=await b(async()=>{let{WebGLDevice:e}=await import(`./webgl-device.7mKl-kgB.js`).then(e=>e.n);return{WebGLDevice:e}},__vite__mapDeps([0,1]),import.meta.url),n=[];(e.debugWebGL||e.debug)&&n.push(je()),e.debugSpectorJS&&n.push(ye(e));let r=await Promise.allSettled(n);for(let e of r)e.status===`rejected`&&z.error(`Failed to initialize debug libraries ${e.reason}`)();try{let n=new t(e);z.groupCollapsed(cy,`WebGLDevice ${n.id} created`)();let r=`\ +${n._reused?`Reusing`:`Created`} device with WebGL2 ${n.props.debug?`debug `:``}context: \ +${n.info.vendor}, ${n.info.renderer} for canvas: ${n.canvasContext.id}`;return z.probe(cy,r)(),z.table(cy,n.info)(),n}finally{z.groupEnd(cy)(),z.info(cy,`%cWebGL call tracing: luma.log.set('debug-webgl') `,`color: white; background: blue; padding: 2px 6px; border-radius: 3px;`)()}}};function uy(e){return typeof WebGL2RenderingContext<`u`&&e instanceof WebGL2RenderingContext||!!(e&&typeof e.createVertexArray==`function`)}var dy=new ly;function fy(){}var py={id:``,width:`100%`,height:`100%`,style:null,viewState:null,initialViewState:null,pickingRadius:0,pickAsync:`auto`,layerFilter:null,parameters:{},parent:null,device:null,deviceProps:{},gl:null,canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:`none`,eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,widgets:[],onDeviceInitialized:fy,onWebGLInitialized:fy,onResize:fy,onViewStateChange:fy,onInteractionStateChange:fy,onBeforeRender:fy,onAfterRender:fy,onLoad:fy,onError:e=>fo.error(e.message,e.cause)(),onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:({isDragging:e})=>e?`grabbing`:`grab`,getTooltip:null,debug:!1,drawPickingColors:!1},my=class{constructor(e){this.width=0,this.height=0,this.userData={},this.device=null,this.canvas=null,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this.eventManager=null,this.widgetManager=null,this.tooltip=null,this.animationLoop=null,this._canvasContext=null,this._deviceResizeHandler=null,this.cursorState={isHovering:!1,isDragging:!1},this.stats=new Te({id:`deck.gl`}),this.metrics={fps:0,setPropsTime:0,layersCount:0,drawLayersCount:0,updateLayersCount:0,updateAttributesCount:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,pickLayersCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this._hoverPickSequence=0,this._pointerDownPickSequence=0,this._needsRedraw=`Initial render`,this._pickRequest={mode:`hover`,x:-1,y:-1,radius:0,event:null,unproject3D:!1},this._lastPointerDownInfo=null,this._lastPointerDownInfoPromise=null,this._onPointerMove=e=>{let{_pickRequest:t}=this;if(e.type===`pointerleave`)t.x=-1,t.y=-1,t.radius=0;else if(e.leftButton||e.rightButton)return;else{let n=e.offsetCenter;if(!n)return;t.x=n.x,t.y=n.y,t.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e},this._onEvent=e=>{let t=yp[e.type],n=e.offsetCenter;if(!t||!n||!this.layerManager)return;let r=this.layerManager.getLayers(),i=this._getInternalPickingMode();if(i){if(i===`sync`){let t=e.type===`click`&&this._shouldUnproject3D(r)?this._getFirstPickedInfo(this._pickPointSync(this._getPointPickOptions(n.x,n.y,{unproject3D:!0},r))):this._getLastPointerDownPickingInfo(n.x,n.y,r);this._dispatchPickingEvent(t,e);return}(this._lastPointerDownInfoPromise||Promise.resolve(this._getLastPointerDownPickingInfo(n.x,n.y,r))).then(t=>{this._dispatchPickingEvent(t,e)}).catch(e=>this.props.onError?.(e))}},this._onPointerDown=e=>{let t=e.offsetCenter;if(!t)return;let n=this._getInternalPickingMode();if(!n)return;let r=this.layerManager?.getLayers()||[],i=++this._pointerDownPickSequence;if(n===`sync`){let e=this._pickPointSync({x:t.x,y:t.y,radius:this.props.pickingRadius}),n=this._getFirstPickedInfo(e);this._lastPointerDownInfo=n,this._lastPointerDownInfoPromise=Promise.resolve(n);return}let a=this._pickPointAsync(this._getPointPickOptions(t.x,t.y,{},r)).then(e=>this._getFirstPickedInfo(e)).then(e=>(i===this._pointerDownPickSequence&&(this._lastPointerDownInfo=e),e)).catch(e=>{this.props.onError?.(e);let n=this.deckPicker&&this.viewManager?this._getLastPointerDownPickingInfo(t.x,t.y,r):{};return i===this._pointerDownPickSequence&&(this._lastPointerDownInfo=n),n});this._lastPointerDownInfo=null,this._lastPointerDownInfoPromise=a};let t=e;this.props={...py,...e},e=this.props,e.viewState&&e.initialViewState&&fo.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),this.viewState=this.props.initialViewState,e.device&&(this.device=e.device,this._setDeviceCanvasContext(e.device));let n=this.device;!n&&e.gl&&(e.gl instanceof WebGLRenderingContext&&fo.error(`WebGL1 context not supported.`)(),n=dy.attach(e.gl,{_cacheShaders:!0,_cachePipelines:!0,...this.props.deviceProps})),n||=this._createDevice(e),this.animationLoop=this._createAnimationLoop(n,e),this.setProps(t),e._typedArrayManagerProps&&nh.setOptions(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this._restoreDeviceResizeHandler(),this.animationLoop?.stop(),this.animationLoop?.destroy(),this.animationLoop=null,this._hoverPickSequence++,this._pointerDownPickSequence++,this._lastPointerDownInfo=null,this._lastPointerDownInfoPromise=null,this.layerManager?.finalize(),this.layerManager=null,this.viewManager?.finalize(),this.viewManager=null,this.effectManager?.finalize(),this.effectManager=null,this.deckRenderer?.finalize(),this.deckRenderer=null,this.deckPicker?.finalize(),this.deckPicker=null,this.eventManager?.destroy(),this.eventManager=null,this.widgetManager?.finalize(),this.widgetManager=null,!this.props.canvas&&!this.props.device&&!this.props.gl&&this.canvas&&(this.canvas.parentElement?.removeChild(this.canvas),this.canvas=null),this._canvasContext=null}setProps(e){this.stats.get(`setProps Time`).timeStart(),`onLayerHover`in e&&fo.removed(`onLayerHover`,`onHover`)(),`onLayerClick`in e&&fo.removed(`onLayerClick`,`onClick`)(),e.initialViewState&&!B_(this.props.initialViewState,e.initialViewState,3)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._validateInternalPickingMode(),this._setCanvasSize(this.props);let t=Object.create(this.props);if(Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),e.device&&e.device.id!==this.device?.id){let t=e.device.getDefaultCanvasContext();this.animationLoop?.stop(),this.canvas!==t.canvas&&(this.canvas?.remove(),this.eventManager?.destroy(),this.canvas=null),this._setDeviceCanvasContext(e.device),fo.log(`recreating animation loop for new device! id=${e.device.id}`)(),this.animationLoop=this._createAnimationLoop(e.device,e),this.animationLoop.start()}this.animationLoop?.setProps(t),e.useDevicePixels!==void 0&&this._canvasContext?.setProps&&this._canvasContext.setProps({useDevicePixels:e.useDevicePixels}),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t),this.widgetManager.setProps(t)),this.stats.get(`setProps Time`).timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(!this.layerManager)return!1;if(this.props._animate)return`Deck._animate`;let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);let n=this.viewManager.needsRedraw(e),r=this.layerManager.needsRedraw(e),i=this.effectManager.needsRedraw(e),a=this.deckRenderer.needsRedraw(e);return t=t||n||r||i||a,t}redraw(e){if(!this.layerManager)return;let t=this.needsRedraw({clearRedrawFlags:!0});t=e||t,t&&(this.stats.get(`Redraw Count`).incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}get isInitialized(){return this.viewManager!==null}getViews(){return ov(this.viewManager),this.viewManager.views}getView(e){return ov(this.viewManager),this.viewManager.getView(e)}getViewports(e){return ov(this.viewManager),this.viewManager.getViewports(e)}getCanvas(){return this.canvas}async pickObjectAsync(e){let t=(await this._pickAsync(`pickObjectAsync`,`pickObject Time`,e)).result;return t.length?t[0]:null}async pickObjectsAsync(e){return await this._pickAsync(`pickObjectsAsync`,`pickObjects Time`,e)}pickObject(e){let t=this._pick(`pickObject`,`pickObject Time`,e).result;return t.length?t[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick(`pickObject`,`pickMultipleObjects Time`,e).result}pickObjects(e){return this._pick(`pickObjects`,`pickObjects Time`,e)}_pickPositionForController(e,t){return this._getInternalPickingMode()===`sync`?this.pickObject({x:e,y:t,radius:0,unproject3D:!0}):null}_addResources(e,t=!1){for(let n in e)this.layerManager.resourceManager.add({resourceId:n,data:e[n],forceUpdate:t})}_removeResources(e){for(let t of e)this.layerManager.resourceManager.remove(t)}_addDefaultEffect(e){this.effectManager.addDefaultEffect(e)}_addDefaultShaderModule(e){this.layerManager.addDefaultShaderModule(e)}_removeDefaultShaderModule(e){this.layerManager?.removeDefaultShaderModule(e)}_resolveInternalPickingMode(){let{pickAsync:e}=this.props,t=this.device?.type||this.props.deviceProps?.type;if(e===`auto`)return t===`webgpu`?`async`:`sync`;if(e===`sync`&&t===`webgpu`)throw Error('`pickAsync: "sync"` is not supported when Deck is using a WebGPU device.');return e}_getInternalPickingMode(){try{return this._resolveInternalPickingMode()}catch(e){return this.props.onError?.(e),null}}_validateInternalPickingMode(){this._getInternalPickingMode()}_getFirstPickedInfo({result:e,emptyInfo:t}){return e[0]||t}_shouldUnproject3D(e=this.layerManager?.getLayers()||[]){return e.some(e=>e.props.pickable===`3d`)}_getPointPickOptions(e,t,n={},r=this.layerManager?.getLayers()||[]){return{x:e,y:t,radius:this.props.pickingRadius,unproject3D:this._shouldUnproject3D(r),...n}}_pickPointSync(e){return this._pick(`pickObject`,`pickObject Time`,e)}_pickPointAsync(e){return this._pickAsync(`pickObjectAsync`,`pickObject Time`,e)}_getLastPointerDownPickingInfo(e,t,n=this.layerManager?.getLayers()||[]){return this.deckPicker.getLastPickedObject({x:e,y:t,layers:n,viewports:this.getViewports({x:e,y:t})},this._lastPointerDownInfo)}_applyHoverCallbacks({result:e,emptyInfo:t},n){if(!this.widgetManager)return;this.cursorState.isHovering=e.length>0;let r=t,i=!1;for(let t of e)r=t,i=t.layer?.onHover(t,n)||i;i||(this.props.onHover?.(r,n),this.widgetManager.onHover(r,n))}_dispatchPickingEvent(e,t){if(!this.layerManager||!this.widgetManager)return;let n=yp[t.type];if(!n)return;let{layer:r}=e,i=r&&(r[n]||r.props[n]),a=this.props[n],o=!1;i&&(o=i.call(r,e,t)),o||(a?.(e,t),this.widgetManager.onEvent(e,t))}_pickAsync(e,t,n){ov(this.deckPicker);let{stats:r}=this;r.get(`Pick Count`).incrementCount(),r.get(t).timeStart();let i=this.deckPicker[e]({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...n,canvasContext:this._canvasContext||void 0});return r.get(t).timeEnd(),i}_pick(e,t,n){ov(this.deckPicker);let{stats:r}=this;r.get(`Pick Count`).incrementCount(),r.get(t).timeStart();let i=this.deckPicker[e]({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...n,canvasContext:this._canvasContext||void 0});return r.get(t).timeEnd(),i}_createCanvas(e){let t=e.canvas;return typeof t==`string`&&(t=document.getElementById(t),ov(t)),t||(t=document.createElement(`canvas`),t.id=e.id||`deckgl-overlay`,e.width&&typeof e.width==`number`&&(t.width=e.width),e.height&&typeof e.height==`number`&&(t.height=e.height),(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}_setCanvasContext(e){this._canvasContext=e,`style`in e.canvas&&(this.canvas=e.canvas)}_setDeviceCanvasContext(e,t={}){let n=e.getDefaultCanvasContext();this._setCanvasContext(n),this._setDeviceResizeHandler(e,t)}_setDeviceResizeHandler(e,t={}){let n=!!t.syncDrawingBuffer;if(this._deviceResizeHandler?.device===e){this._deviceResizeHandler.syncDrawingBuffer=n;return}this._restoreDeviceResizeHandler();let r=e=>{e===this._canvasContext&&this._canvasContext&&this._onCanvasContextResize(this._canvasContext,{syncDrawingBuffer:this._deviceResizeHandler?.syncDrawingBuffer})};e.props.onResize=r,this._deviceResizeHandler={device:e,onResize:r,syncDrawingBuffer:n}}_restoreDeviceResizeHandler(){let e=this._deviceResizeHandler;e&&e.device.props?.onResize===e.onResize&&(e.device.props.onResize=fy),this._deviceResizeHandler=null}_setCanvasSize(e){if(!this.canvas)return;let{width:t,height:n}=e;if(t||t===0){let e=Number.isFinite(t)?`${t}px`:t;this.canvas.style.width=e}if(n||n===0){let t=Number.isFinite(n)?`${n}px`:n;this.canvas.style.position=e.style?.position||`absolute`,this.canvas.style.height=t}}_updateCanvasSize(e=this._canvasContext){let{canvas:t}=this,[n,r]=e?e.getCSSSize():[t?.clientWidth??t?.width??0,t?.clientHeight??t?.height??0];(n!==this.width||r!==this.height)&&(this.width=n,this.height=r,this.viewManager?.setProps({width:n,height:r}),this.layerManager?.activateViewport(this.getViewports()[0]),this.props.onResize({width:n,height:r},e||void 0))}_onCanvasContextResize(e,t={}){if(t.syncDrawingBuffer){let{width:t,height:n}=e.canvas;e.setDrawingBufferSize(t,n)}this._needsRedraw=`Canvas resized`,this._updateCanvasSize(e)}_createAnimationLoop(e,t){let{gl:n,onError:r}=t;return new Mh({device:e,autoResizeDrawingBuffer:!n,autoResizeViewport:!1,onInitialize:e=>this._setDevice(e.device),onRender:this._onRenderFrame.bind(this),onError:r})}_createDevice(e){let t=this.props.deviceProps?.createCanvasContext,n=typeof t==`object`?t:void 0,r={adapters:[],_cacheShaders:!0,_cachePipelines:!0,...e.deviceProps};r.adapters.includes(dy)||r.adapters.push(dy);let i={alphaMode:this.props.deviceProps?.type===`webgpu`?`premultiplied`:void 0};return Ve.createDevice({_reuseDevices:!0,type:`webgl`,...r,createCanvasContext:{...i,...n,canvas:this._createCanvas(e),useDevicePixels:this.props.useDevicePixels,autoResize:!0}})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let{views:e}=this.props,t=Array.isArray(e)?e:e?[e]:[new Mv({id:`default-view`})];return t.length&&this.props.controller&&(t[0].props.controller=this.props.controller),t}_onContextLost(){let{onError:e}=this.props;this.animationLoop&&e&&e(Error(`WebGL context is lost`))}_pickAndCallback(){let{_pickRequest:e}=this;if(e.event){let t=e.event,n=this.layerManager?.getLayers()||[],r=this._getPointPickOptions(e.x,e.y,{radius:e.radius,mode:e.mode},n),i=this._getInternalPickingMode(),a=++this._hoverPickSequence;if(e.event=null,!i)return;if(i===`sync`){this._applyHoverCallbacks(this._pickPointSync(r),t);return}this._pickPointAsync(r).then(({result:e,emptyInfo:n})=>{a===this._hoverPickSequence&&this._applyHoverCallbacks({result:e,emptyInfo:n},t)}).catch(e=>this.props.onError?.(e))}}_updateCursor(){let e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.cursorState))}_setDevice(e){if(this.device=e,this._validateInternalPickingMode(),!this.animationLoop)return;this._setDeviceCanvasContext(e,{syncDrawingBuffer:!!(this.props.gl&&this.props.device!==e)}),this.canvas&&!this.canvas.isConnected&&this.props.parent&&this.props.parent.insertBefore(this.canvas,this.props.parent.firstChild),this.device.type===`webgl`&&this.device.setParametersWebGL({blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onDeviceInitialized(this.device),this.device.type===`webgl`&&this.props.onWebGLInitialized(this.device.gl);let t=new Dh;t.play(),this.animationLoop.attachTimeline(t);let n=this.props.parent?.querySelector(`.deck-events-root`)||this.canvas;this.eventManager=new hp(n,{touchAction:this.props.touchAction,recognizers:Object.keys(bp).map(e=>{let[t,n,r,i]=bp[e],a=this.props.eventRecognizerOptions?.[e];return{recognizer:new t({...n,...a,event:e}),recognizeWith:r,requireFailure:i}}),events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(let e in yp)this.eventManager.on(e,this._onEvent);this.viewManager=new V_({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),pickPosition:this._pickPositionForController.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});let r=this.viewManager.getViewports()[0];this.layerManager=new z_(this.device,{deck:this,stats:this.stats,viewport:r,timeline:t}),this.effectManager=new Fv({deck:this,device:this.device}),this.deckRenderer=new Rv(this.device,{stats:this.stats}),this.deckPicker=new Kv(this.device,{stats:this.stats});let i=this.props.parent?.querySelector(`.deck-widgets-root`)||this.canvas?.parentElement;this.widgetManager=new Xv({deck:this,parentElement:i}),this.widgetManager.addDefault(new ty),this.setProps({}),this._updateCanvasSize(this._canvasContext),this.props.onLoad()}_drawLayers(e,t){let{device:n,gl:r}=this.layerManager.context;this.props.onBeforeRender({device:n,gl:r});let i={target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:`screen`,effects:this.effectManager.getEffects(),...t};this.deckRenderer?.renderLayers(i),i.pass===`screen`&&this.widgetManager.onRedraw({viewports:i.viewports,layers:i.layers}),this.props.onAfterRender({device:n,gl:r})}_onRenderFrame(){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),fo.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCursor(),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){let t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState={...this.viewState,[e.viewId]:t},this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.cursorState.isDragging=e.isDragging||!1,this.props.onInteractionStateChange(e)}_getFrameStats(){let{stats:e}=this;e.get(`frameRate`).timeEnd(),e.get(`frameRate`).timeStart();let t=this.animationLoop.stats;e.get(`GPU Time`).addTime(t.get(`GPU Time`).lastTiming),e.get(`CPU Time`).addTime(t.get(`CPU Time`).lastTiming)}_getMetrics(){let{metrics:e,stats:t}=this;e.fps=t.get(`frameRate`).getHz(),e.setPropsTime=t.get(`setProps Time`).time,e.updateAttributesTime=t.get(`Update Attributes`).time,e.framesRedrawn=t.get(`Redraw Count`).count,e.pickTime=t.get(`pickObject Time`).time+t.get(`pickMultipleObjects Time`).time+t.get(`pickObjects Time`).time,e.pickCount=t.get(`Pick Count`).count,e.layersCount=this.layerManager?.layers.length??0,e.drawLayersCount=t.get(`Layers rendered`).lastSampleCount,e.pickLayersCount=t.get(`Layers picked`).lastSampleCount,e.updateAttributesCount=t.get(`Layers updated`).count,e.updateAttributesCount=t.get(`Attributes updated`).count,e.gpuTime=t.get(`GPU Time`).time,e.cpuTime=t.get(`CPU Time`).time,e.gpuTimePerFrame=t.get(`GPU Time`).getAverageTime(),e.cpuTimePerFrame=t.get(`CPU Time`).getAverageTime();let n=Ve.stats.get(`GPU Time and Memory`);e.bufferMemory=n.get(`Buffer Memory`).count,e.textureMemory=n.get(`Texture Memory`).count,e.renderbufferMemory=n.get(`Renderbuffer Memory`).count,e.gpuMemory=n.get(`GPU Memory`).count}};my.defaultProps=py,my.VERSION=yo;function hy(e){switch(e){case`float64`:return Float64Array;case`uint8`:case`unorm8`:return Uint8ClampedArray;default:return H(e)}}var gy=R.getDataType.bind(R);function _y(e,t,n){if(t.size>4)return null;let r=n===`webgpu`&&t.type===`uint8`?`unorm8`:t.type;return{attribute:e,format:t.size>1?`${r}x${t.size}`:t.type,byteOffset:t.offset||0}}function vy(e){return e.stride||e.size*e.bytesPerElement}function yy(e,t){return e.type===t.type&&e.size===t.size&&vy(e)===vy(t)&&(e.offset||0)===(t.offset||0)}function by(e,t){t.offset&&fo.removed(`shaderAttribute.offset`,`vertexOffset, elementOffset`)();let n=vy(e),r=t.vertexOffset===void 0?e.vertexOffset||0:t.vertexOffset,i=t.elementOffset||0,a=r*n+i*e.bytesPerElement+(e.offset||0);return{...t,offset:a,stride:n}}function xy(e,t){let n=by(e,t);return{high:n,low:{...n,offset:n.offset+e.size*4}}}var Sy=class{constructor(e,t,n){this._buffer=null,this.device=e,this.id=t.id||``,this.size=t.size||1;let r=t.logicalType||t.type,i=r===`float64`,{defaultValue:a}=t;a=Number.isFinite(a)?[a]:a||Array(this.size).fill(0);let o;o=i?`float32`:!r&&t.isIndexed?`uint32`:r||`float32`;let s=hy(r||o);this.doublePrecision=i,i&&t.fp64===!1&&(s=Float32Array),this.value=null,this.settings={...t,defaultType:s,defaultValue:a,logicalType:r,type:o,normalized:o.includes(`norm`),size:this.size,bytesPerElement:s.BYTES_PER_ELEMENT},this.state={...n,externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1}}get isConstant(){return this.state.constant}get buffer(){return this._buffer}get byteOffset(){let e=this.getAccessor();return e.vertexOffset?e.vertexOffset*vy(e):0}get numInstances(){return this.state.numInstances}set numInstances(e){this.state.numInstances=e}delete(){this._buffer&&=(this._buffer.delete(),null),nh.release(this.state.allocatedValue)}getBuffer(){return this.state.constant?null:this.state.externalBuffer||this._buffer}getValue(e=this.id,t=null){let n={};if(this.state.constant){let r=this.value;if(t){let i=by(this.getAccessor(),t),a=i.offset/r.BYTES_PER_ELEMENT,o=i.size||this.size;n[e]=r.subarray(a,a+o)}else n[e]=r}else n[e]=this.getBuffer();return this.doublePrecision&&(this.value instanceof Float64Array?n[`${e}64Low`]=n[e]:n[`${e}64Low`]=new Float32Array(this.size)),n}_getBufferLayout(e=this.id,t=null){let n=this.getAccessor(),r=[],i={name:this.id,byteStride:vy(n)};if(this.doublePrecision){let i=xy(n,t||{});r.push(_y(e,{...n,...i.high},this.device.type),_y(`${e}64Low`,{...n,...i.low},this.device.type))}else if(t){let i=by(n,t);r.push(_y(e,{...n,...i},this.device.type))}else r.push(_y(e,n,this.device.type));return i.attributes=r.filter(Boolean),i}setAccessor(e){this.state.bufferAccessor=e}getAccessor(){return this.state.bufferAccessor}getBounds(){if(this.state.bounds)return this.state.bounds;let e=null;if(this.state.constant&&this.value){let t=Array.from(this.value);e=[t,t]}else{let{value:t,numInstances:n,size:r}=this,i=n*r;if(t&&i&&t.length>=i){let n=Array(r).fill(1/0),a=Array(r).fill(-1/0);for(let e=0;ea[i]&&(a[i]=r)}e=[n,a]}}return this.state.bounds=e,e}setData(e){let{state:t}=this,n;n=ArrayBuffer.isView(e)?{value:e}:e instanceof U?{buffer:e}:e;let r={...this.settings,...n};if(ArrayBuffer.isView(n.value)){if(!n.type)if(this.doublePrecision&&n.value instanceof Float64Array)r.type=`float32`;else{let e=gy(n.value);r.type=r.normalized?e.replace(`int`,`norm`):e}r.bytesPerElement=n.value.BYTES_PER_ELEMENT,r.stride=vy(r)}if(t.bounds=null,n.constant){let e=n.value;if(e=this._normalizeValue(e,[],0),this.settings.normalized&&(e=this.normalizeConstant(e)),!(!t.constant||!this._areValuesEqual(e,this.value)))return!1;t.externalBuffer=null,t.constant=!0,this.value=ArrayBuffer.isView(e)?e:new Float32Array(e)}else if(n.buffer)t.externalBuffer=n.buffer,t.constant=!1,this.value=n.value||null;else if(n.value){this._checkExternalBuffer(n);let e=n.value;t.externalBuffer=null,t.constant=!1,this.value=e;let{buffer:i}=this,a=vy(r),o=(r.vertexOffset||0)*a;if(this.doublePrecision&&e instanceof Float64Array&&(e=dh(e,r)),this.settings.isIndexed){let t=this.settings.defaultType;e.constructor!==t&&(e=new t(e))}let s=e.byteLength+o+a*2;(!i||i.byteLength(e+128)/255*2-1);case`snorm16`:return new Float32Array(e).map(e=>(e+32768)/65535*2-1);case`unorm8`:return new Float32Array(e).map(e=>e/255);case`unorm16`:return new Float32Array(e).map(e=>e/65535);default:return e}}_normalizeValue(e,t,n){let{defaultValue:r,size:i}=this.settings;if(Number.isFinite(e))return t[n]=e,t;if(!e){let e=i;for(;--e>=0;)t[n+e]=r[e];return t}switch(i){case 4:t[n+3]=Number.isFinite(e[3])?e[3]:r[3];case 3:t[n+2]=Number.isFinite(e[2])?e[2]:r[2];case 2:t[n+1]=Number.isFinite(e[1])?e[1]:r[1];case 1:t[n+0]=Number.isFinite(e[0])?e[0]:r[0];break;default:let a=i;for(;--a>=0;)t[n+a]=Number.isFinite(e[a])?e[a]:r[a]}return t}_areValuesEqual(e,t){if(!e||!t)return!1;let{size:n}=this;for(let r=0;r0&&(wy.length=e.length,r=wy):r=Cy,(t>0||Number.isFinite(n))&&(r=(Array.isArray(r)?r:Array.from(r)).slice(t,n),i.index=t-1),{iterable:r,objectInfo:i}}function Ey(e){return e&&e[Symbol.asyncIterator]}function Dy(e,t){let{size:n,stride:r,offset:i,startIndices:a,nested:o}=t,s=e.BYTES_PER_ELEMENT,c=r?r/s:n,l=i?i/s:0,u=Math.floor((e.length-l)/c);return(t,{index:r,target:i})=>{if(!a){let t=r*c+l;for(let r=0;r=t[1]))return e;let n=[],r=e.length,i=0;for(let a=0;at[1]?n.push(r):t=[Math.min(r[0],t[0]),Math.max(r[1],t[1])]}return n.splice(i,0,t),n}var jy={interpolation:{duration:0,easing:e=>e},spring:{stiffness:.05,damping:.5}};function My(e,t){if(!e)return null;Number.isFinite(e)&&(e={type:`interpolation`,duration:e});let n=e.type||`interpolation`;return{...jy[n],...t,...e,type:n}}var Ny=class extends Sy{constructor(e,t){super(e,t,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,layoutChanged:!1,updateRanges:ky}),this.constant=!1,this.settings.update=t.update||(t.accessor?this._autoUpdater:void 0),Object.seal(this.settings),Object.seal(this.state),this._validateAttributeUpdaters()}get startIndices(){return this.state.startIndices}set startIndices(e){this.state.startIndices=e}needsUpdate(){return this.state.needsUpdate}needsRedraw({clearChangedFlags:e=!1}={}){let t=this.state.needsRedraw;return this.state.needsRedraw=t&&!e,t}layoutChanged(){return this.state.layoutChanged}setAccessor(e){var t;(t=this.state).layoutChanged||(t.layoutChanged=!yy(e,this.getAccessor())),super.setAccessor(e)}getUpdateTriggers(){let{accessor:e}=this.settings;return[this.id].concat(typeof e!=`function`&&e||[])}supportsTransition(){return!!this.settings.transition}getTransitionSetting(e){if(!e||!this.supportsTransition())return null;let{accessor:t}=this.settings,n=this.settings.transition;return My(Array.isArray(t)?e[t.find(t=>e[t])]:e[t],n)}setNeedsUpdate(e=this.id,t){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){let{startRow:e=0,endRow:n=1/0}=t;this.state.updateRanges=Ay(this.state.updateRanges,[e,n])}else this.state.updateRanges=ky}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=Oy}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}allocate(e){let{state:t,settings:n}=this;return n.noAlloc?!1:n.update?(super.allocate(e,t.updateRanges!==ky),!0):!1}updateBuffer({numInstances:e,data:t,props:n,context:r}){if(!this.needsUpdate())return!1;let{state:{updateRanges:i},settings:{update:a,noAlloc:o}}=this,s=!0;if(a){for(let[o,s]of i)a.call(r,this,{data:t,startRow:o,endRow:s,props:n,numInstances:e});if(this.value)if(this.constant||!this.buffer||this.buffer.byteLengthl?c.set(n,m):(e._normalizeValue(n,g.target,0),P_({target:c,source:g.target,start:m,count:t}));m+=t*l}else e._normalizeValue(n,c,m),m+=l}}_validateAttributeUpdaters(){let{settings:e}=this;if(!(e.noAlloc||typeof e.update==`function`))throw Error(`Attribute ${this.id} missing update or accessor`)}_checkAttributeArray(){let{value:e}=this,t=Math.min(4,this.size);if(e&&e.length>=t){let n=!0;switch(t){case 4:n&&=Number.isFinite(e[3]);case 3:n&&=Number.isFinite(e[2]);case 2:n&&=Number.isFinite(e[1]);case 1:n&&=Number.isFinite(e[0]);break;default:n=!1}if(!n)throw Error(`Illegal attribute generated for ${this.id}`)}}};function Py(e){let{source:t,target:n,start:r=0,size:i,getData:a}=e,o=e.end||n.length,s=t.length,c=o-r;if(s>c){n.set(t.subarray(0,c),r);return}if(n.set(t,r),!a)return;let l=s;for(;lr(e+s,t)),l=Math.min(i.length,a.length);for(let r=1;re}){let s=n.doublePrecision&&n.value instanceof Float64Array?2:1,c=n.size*s,l=n.byteOffset,u=n.settings.bytesPerElement<4?l/n.settings.bytesPerElement*4:l,d=n.startIndices,f=a&&d,p=n.isConstant;if(!f&&t&&r>=i)return t;let m=n.value instanceof Float64Array?Float32Array:n.value.constructor,h=p?n.value:new m(n.getBuffer().readSyncWebGL(l,i*m.BYTES_PER_ELEMENT).buffer);if(n.settings.normalized&&!p){let e=o;o=(t,r)=>n.normalizeConstant(e(t,r))}let g=p?(e,t)=>o(h,t):(e,t)=>o(h.subarray(e+l,e+l+c),t),_=t?new Float32Array(t.readSyncWebGL(u,r*4).buffer):new Float32Array,v=new Float32Array(i);return Fy({source:_,target:v,sourceStartIndices:a,targetStartIndices:d,size:c,getData:g}),(!t||t.byteLength0||r.end()}delete(){super.delete(),this.transform.destroy(),this.texture.destroy(),this.framebuffer.destroy()}},Zy={name:`spring`,vs:`layout(std140) uniform springUniforms { + float damping; + float stiffness; +} spring; +`,uniformTypes:{damping:`f32`,stiffness:`f32`}},Qy=`#version 300 es +#define SHADER_NAME spring-transition-vertex-shader + +#define EPSILON 0.00001 + +in ATTRIBUTE_TYPE aPrev; +in ATTRIBUTE_TYPE aCur; +in ATTRIBUTE_TYPE aTo; +out ATTRIBUTE_TYPE vNext; +out float vIsTransitioningFlag; + +ATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) { + ATTRIBUTE_TYPE velocity = cur - prev; + ATTRIBUTE_TYPE delta = dest - cur; + ATTRIBUTE_TYPE force = delta * spring.stiffness; + ATTRIBUTE_TYPE resistance = velocity * spring.damping; + return force - resistance + velocity + cur; +} + +void main(void) { + bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON; + vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0; + + vNext = getNextValue(aCur, aPrev, aTo); + gl_Position = vec4(0, 0, 0, 1); + gl_PointSize = 100.0; +} +`,$y=`#version 300 es +#define SHADER_NAME spring-transition-is-transitioning-fragment-shader + +in float vIsTransitioningFlag; + +out vec4 fragColor; + +void main(void) { + if (vIsTransitioningFlag == 0.0) { + discard; + } + fragColor = vec4(1.0); +}`;function eb(e,t){let n=Ly(t.size),r=Ry(t.size);return new Gg(e,{vs:Qy,fs:$y,bufferLayout:[{name:`aPrev`,format:r},{name:`aCur`,format:r},{name:`aTo`,format:t.getBufferLayout().attributes[0].format}],varyings:[`vNext`],modules:[Zy],defines:{ATTRIBUTE_TYPE:n},parameters:{depthCompare:`always`,blendColorOperation:`max`,blendColorSrcFactor:`one`,blendColorDstFactor:`one`,blendAlphaOperation:`max`,blendAlphaSrcFactor:`one`,blendAlphaDstFactor:`one`}})}function tb(e){return e.createTexture({data:new Uint8Array(4),format:`rgba8unorm`,width:1,height:1})}function nb(e,t){return e.createFramebuffer({id:`spring-transition-is-transitioning-framebuffer`,width:1,height:1,colorAttachments:[t]})}var rb={interpolation:Wy,spring:Xy},ib=class{constructor(e,{id:t,timeline:n}){if(!e)throw Error(`AttributeTransitionManager is constructed without device`);this.id=t,this.device=e,this.timeline=n,this.transitions={},this.needsRedraw=!1,this.numInstances=1}finalize(){for(let e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:n}){this.numInstances=n||1;for(let n in e){let r=e[n],i=r.getTransitionSetting(t);i&&this._updateAttribute(n,r,i)}for(let n in this.transitions){let r=e[n];(!r||!r.getTransitionSetting(t))&&this._removeTransition(n)}}hasAttribute(e){let t=this.transitions[e];return t&&t.inProgress}getAttributes(){let e={};for(let t in this.transitions){let n=this.transitions[t];n.inProgress&&(e[t]=n.attributeInTransition)}return e}run(){if(this.numInstances===0)return!1;for(let e in this.transitions)this.transitions[e].update()&&(this.needsRedraw=!0);let e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].delete(),delete this.transitions[e]}_updateAttribute(e,t,n){let r=this.transitions[e],i=!r||r.type!==n.type;if(i){r&&this._removeTransition(e);let a=rb[n.type];a?this.transitions[e]=new a({attribute:t,timeline:this.timeline,device:this.device}):(fo.error(`unsupported transition type '${n.type}'`)(),i=!1)}(i||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(n,this.numInstances))}},ab=`attributeManager.invalidate`,ob=`attributeManager.updateStart`,sb=`attributeManager.updateEnd`,cb=`attribute.updateStart`,lb=`attribute.allocate`,ub=`attribute.updateEnd`,db=class{constructor(e,{id:t=`attribute-manager`,stats:n,timeline:r}={}){this.mergeBoundsMemoized=Sp(fh),this.id=t,this.device=e,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=n,this.attributeTransitionManager=new ib(e,{id:`${t}-transitions`,timeline:r}),Object.seal(this)}finalize(){for(let e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){let t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(e){this._add(e)}addInstanced(e){this._add(e,{stepMode:`instance`})}remove(e){for(let t of e)this.attributes[t]!==void 0&&(this.attributes[t].delete(),delete this.attributes[t])}invalidate(e,t){let n=this._invalidateTrigger(e,t);ho(ab,this,e,n)}invalidateAll(e){for(let t in this.attributes)this.attributes[t].setNeedsUpdate(t,e);ho(ab,this,`all`)}update({data:e,numInstances:t,startIndices:n=null,transitions:r,props:i={},buffers:a={},context:o={}}){let s=!1;ho(ob,this),this.stats&&this.stats.get(`Update Attributes`).timeStart();for(let r in this.attributes){let c=this.attributes[r],l=c.settings.accessor;c.startIndices=n,c.numInstances=t,i[r]&&fo.removed(`props.${r}`,`data.attributes.${r}`)(),c.setExternalBuffer(a[r])||c.setBinaryValue(typeof l==`string`?a[l]:void 0,e.startIndices)||typeof l==`string`&&!a[l]&&c.setConstantValue(o,i[l])||c.needsUpdate()&&(s=!0,this._updateAttribute({attribute:c,numInstances:t,data:e,props:i,context:o})),this.needsRedraw=this.needsRedraw||c.needsRedraw()}s&&ho(sb,this,t),this.stats&&(this.stats.get(`Update Attributes`).timeEnd(),s&&this.stats.get(`Attributes updated`).incrementCount()),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:t,transitions:r})}updateTransition(){let{attributeTransitionManager:e}=this,t=e.run();return this.needsRedraw=this.needsRedraw||t,t}getAttributes(){return{...this.attributes,...this.attributeTransitionManager.getAttributes()}}getBounds(e){let t=e.map(e=>this.attributes[e]?.getBounds());return this.mergeBoundsMemoized(t)}getChangedAttributes(e={clearChangedFlags:!1}){let{attributes:t,attributeTransitionManager:n}=this,r={...n.getAttributes()};for(let i in t){let a=t[i];a.needsRedraw(e)&&!n.hasAttribute(i)&&(r[i]=a)}return r}getBufferLayouts(e){return Object.values(this.getAttributes()).map(t=>t.getBufferLayout(e))}_add(e,t){for(let n in e){let r=e[n],i={...r,id:n,size:r.isIndexed&&1||r.size||1,...t};this.attributes[n]=new Ny(this.device,i)}this._mapUpdateTriggersToAttributes()}_mapUpdateTriggersToAttributes(){let e={};for(let t in this.attributes)this.attributes[t].getUpdateTriggers().forEach(n=>{e[n]||(e[n]=[]),e[n].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){let{attributes:n,updateTriggers:r}=this,i=r[e];return i&&i.forEach(e=>{let r=n[e];r&&r.setNeedsUpdate(r.id,t)}),i}_updateAttribute(e){let{attribute:t,numInstances:n}=e;if(ho(cb,t),t.constant){t.setConstantValue(e.context,t.value);return}t.allocate(n)&&ho(lb,t,n),t.updateBuffer(e)&&(this.needsRedraw=!0,ho(ub,t,n))}},fb=class extends ev{get value(){return this._value}_onUpdate(){let{time:e,settings:{fromValue:t,toValue:n,duration:r,easing:i}}=this,a=i(e/r);this._value=Ac(t,n,a)}},pb=1e-5;function mb(e,t,n,r,i){let a=t-e;return(n-t)*i+-a*r+a+t}function hb(e,t,n,r,i){if(Array.isArray(n)){let a=[];for(let o=0;o0}add(e,t,n,r){let{transitions:i}=this;if(i.has(e)){let n=i.get(e),{value:r=n.settings.fromValue}=n;t=r,this.remove(e)}if(r=My(r),!r)return;let a=_b[r.type];if(!a){fo.error(`unsupported transition type '${r.type}'`)();return}let o=new a(this.timeline);o.start({...r,fromValue:t,toValue:n}),i.set(e,o)}remove(e){let{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){let e={};for(let[t,n]of this.transitions)n.update(),e[t]=n.value,n.inProgress||this.remove(t);return e}clear(){for(let e of this.transitions.keys())this.remove(e)}};function yb(e){let t=e[D_];for(let n in t){let r=t[n],{validate:i}=r;if(i&&!i(e[n],r))throw Error(`Invalid prop ${n}: ${e[n]}`)}}function bb(e,t){let n=Sb({newProps:e,oldProps:t,propTypes:e[D_],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),r=wb(e,t),i=!1;return r||(i=Tb(e,t)),{dataChanged:r,propsChanged:n,updateTriggersChanged:i,extensionsChanged:Eb(e,t),transitionsChanged:xb(e,t)}}function xb(e,t){if(!e.transitions)return!1;let n={},r=e[D_],i=!1;for(let a in e.transitions){let o=r[a],s=o&&o.type;(s===`number`||s===`color`||s===`array`)&&Cb(e[a],t[a],o)&&(n[a]=!0,i=!0)}return i?n:!1}function Sb({newProps:e,oldProps:t,ignoreProps:n={},propTypes:r={},triggerName:i=`props`}){if(t===e)return!1;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return`${i} changed shallowly`;for(let a of Object.keys(e))if(!(a in n)){if(!(a in t))return`${i}.${a} added`;let n=Cb(e[a],t[a],r[a]);if(n)return`${i}.${a} ${n}`}for(let a of Object.keys(t))if(!(a in n)){if(!(a in e))return`${i}.${a} dropped`;if(!Object.hasOwnProperty.call(e,a)){let n=Cb(e[a],t[a],r[a]);if(n)return`${i}.${a} ${n}`}}return!1}function Cb(e,t,n){let r=n&&n.equal;return r&&!r(e,t,n)||!r&&(r=e&&t&&e.equals,r&&!r.call(e,t))?`changed deeply`:!r&&t!==e?`changed shallowly`:null}function wb(e,t){if(t===null)return`oldProps is null, initial diff`;let n=!1,{dataComparator:r,_dataDiff:i}=e;return r?r(e.data,t.data)||(n=`Data comparator detected a change`):e.data!==t.data&&(n=`A new data container was supplied`),n&&i&&(n=i(e.data,t.data)||n),n}function Tb(e,t){if(t===null||`all`in e.updateTriggers&&Db(e,t,`all`))return{all:!0};let n={},r=!1;for(let i in e.updateTriggers)i!==`all`&&Db(e,t,i)&&(n[i]=!0,r=!0);return r?n:!1}function Eb(e,t){if(t===null)return!0;let n=t.extensions,{extensions:r}=e;if(r===n)return!1;if(!n||!r||r.length!==n.length)return!0;for(let e=0;ee.name===`project64`))){let e=n.modules.findIndex(e=>e.name===`project32`);e>=0&&n.modules.splice(e,1)}if(`inject`in t)if(!e.inject)n.inject=t.inject;else{let r={...e.inject};for(let e in t.inject)r[e]=(r[e]||``)+t.inject[e];n.inject=r}return n}var Pb={minFilter:`linear`,mipmapFilter:`linear`,magFilter:`linear`,addressModeU:`clamp-to-edge`,addressModeV:`clamp-to-edge`},Fb={};function Ib(e,t,n,r){if(n instanceof Se)return n;n.constructor&&n.constructor.name!==`Object`&&(n={data:n});let i=null;n.compressed&&(i={minFilter:`linear`,mipmapFilter:n.data.length>1?`nearest`:`linear`});let{width:a,height:o}=n.data,s=t.createTexture({...n,sampler:{...Pb,...i,...r},mipLevels:t.getMipLevelCount(a,o)});return t.type===`webgl`?s.generateMipmapsWebGL():t.type===`webgpu`&&t.generateMipmapsWebGPU(s),Fb[s.id]=e,s}function Lb(e,t){!t||!(t instanceof Se)||Fb[t.id]===e&&(t.delete(),delete Fb[t.id])}var Rb={boolean:{validate(e,t){return!0},equal(e,t,n){return!!e==!!t}},number:{validate(e,t){return Number.isFinite(e)&&(!(`max`in t)||e<=t.max)&&(!(`min`in t)||e>=t.min)}},color:{validate(e,t){return t.optional&&!e||Hb(e)&&(e.length===3||e.length===4)},equal(e,t,n){return B_(e,t,1)}},accessor:{validate(e,t){let n=Ub(e);return n===`function`||n===Ub(t.value)},equal(e,t,n){return typeof t==`function`||B_(e,t,1)}},array:{validate(e,t){return t.optional&&!e||Hb(e)},equal(e,t,n){let{compare:r}=n;return r?B_(e,t,Number.isInteger(r)?r:+!!r):e===t}},object:{equal(e,t,n){if(n.ignore)return!0;let{compare:r}=n;return r?B_(e,t,Number.isInteger(r)?r:+!!r):e===t}},function:{validate(e,t){return t.optional&&!e||typeof e==`function`},equal(e,t,n){return!n.compare&&n.ignore!==!1||e===t}},data:{transform:(e,t,n)=>{if(!e)return e;let{dataTransform:r}=n.props;return r?r(e):typeof e.shape==`string`&&e.shape.endsWith(`-table`)&&Array.isArray(e.data)?e.data:e}},image:{transform:(e,t,n)=>{let r=n.context;return!r||!r.device?null:Ib(n.id,r.device,e,{...t.parameters,...n.props.textureParameters})},release:(e,t,n)=>{Lb(n.id,e)}}};function zb(e){let t={},n={},r={};for(let[i,a]of Object.entries(e)){let e=a?.deprecatedFor;if(e)r[i]=Array.isArray(e)?e:[e];else{let e=Bb(i,a);t[i]=e,n[i]=e.value}}return{propTypes:t,defaultProps:n,deprecatedProps:r}}function Bb(e,t){switch(Ub(t)){case`object`:return Vb(e,t);case`array`:return Vb(e,{type:`array`,value:t,compare:!1});case`boolean`:return Vb(e,{type:`boolean`,value:t});case`number`:return Vb(e,{type:`number`,value:t});case`function`:return Vb(e,{type:`function`,value:t,compare:!0});default:return{name:e,type:`unknown`,value:t}}}function Vb(e,t){return`type`in t?{name:e,...Rb[t.type],...t}:`value`in t?{name:e,type:Ub(t.value),...t}:{name:e,type:`object`,value:t}}function Hb(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function Ub(e){return Hb(e)?`array`:e===null?`null`:typeof e}function Wb(e,t){let n;for(let e=t.length-1;e>=0;e--){let r=t[e];`extensions`in r&&(n=r.extensions)}let r=Kb(e.constructor,n),i=Object.create(r);i[E_]=e,i[A_]={},i[j_]={};for(let e=0;e{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(let e in this.asyncProps){let t=this.asyncProps[e];t&&t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}getOldProps(){return this.oldAsyncProps||this.oldProps||rx}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){let t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){let t=this.asyncProps[e];return!!(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(let e in this.asyncProps)if(this.isAsyncPropLoading(e))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){this.component=e[E_]||this.component;let t=e[j_]||{},n=e[A_]||e,r=e[k_]||{};for(let e in t){let n=t[e];this._createAsyncPropData(e,r[e]),this._updateAsyncProp(e,n),t[e]=this.getAsyncProp(e)}for(let e in n){let t=n[e];this._createAsyncPropData(e,r[e]),this._updateAsyncProp(e,t)}}_fetch(e,t){return null}_onResolve(e,t){}_onError(e,t){}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if(typeof t==`string`&&(t=this._fetch(e,t)),t instanceof Promise){this._watchPromise(e,t);return}if(Ey(t)){this._resolveAsyncIterable(e,t);return}this._setPropValue(e,t)}}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(let e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}_didAsyncInputValueChange(e,t){let n=this.asyncProps[e];return t===n.resolvedValue||t===n.lastValue?!1:(n.lastValue=t,!0)}_setPropValue(e,t){this._freezeAsyncOldProps();let n=this.asyncProps[e];n&&(t=this._postProcessValue(n,t),n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount)}_setAsyncPropValue(e,t,n){let r=this.asyncProps[e];r&&n>=r.resolvedLoadCount&&t!==void 0&&(this._freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){let n=this.asyncProps[e];if(n){n.pendingLoadCount++;let r=n.pendingLoadCount;t.then(t=>{this.component&&(t=this._postProcessValue(n,t),this._setAsyncPropValue(e,t,r),this._onResolve(e,t))}).catch(t=>{this._onError(e,t)})}}async _resolveAsyncIterable(e,t){if(e!==`data`){this._setPropValue(e,t);return}let n=this.asyncProps[e];if(!n)return;n.pendingLoadCount++;let r=n.pendingLoadCount,i=[],a=0;for await(let n of t){if(!this.component)return;let{dataTransform:t}=this.component.props;i=t?t(n,i):i.concat(n),Object.defineProperty(i,"__diff",{enumerable:!1,value:[{startRow:a,endRow:i.length}]}),a=i.length,this._setAsyncPropValue(e,i,r)}this._onResolve(e,i)}_postProcessValue(e,t){let n=e.type;return n&&this.component&&(n.release&&n.release(e.resolvedValue,n,this.component),n.transform)?n.transform(t,n,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){let n=this.component&&this.component.props[D_];this.asyncProps[e]={type:n&&n[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}},ax=class extends ix{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}_fetch(e,t){let n=this.layer,r=n?.props.fetch;return r?r(t,{propName:e,layer:n}):super._fetch(e,t)}_onResolve(e,t){let n=this.layer;if(n){let r=n.props.onDataLoad;e===`data`&&r&&r(t,{propName:e,layer:n})}}_onError(e,t){let n=this.layer;n&&n.raiseError(t,`loading ${e} of ${this.layer}`)}},ox=`layer.changeFlag`,sx=`layer.initialize`,cx=`layer.update`,lee=`layer.finalize`,uee=`layer.matched`,lx=2**24-1,dee=Object.freeze([]),fee=Sp(({oldViewport:e,viewport:t})=>e.equals(t)),ux=new Uint8ClampedArray,pee={data:{type:`data`,value:dee,async:!0},dataComparator:{type:`function`,value:null,optional:!0},_dataDiff:{type:`function`,value:e=>e&&e.__diff,optional:!0},dataTransform:{type:`function`,value:null,optional:!0},onDataLoad:{type:`function`,value:null,optional:!0},onError:{type:`function`,value:null,optional:!0},fetch:{type:`function`,value:(e,{propName:t,layer:n,loaders:r,loadOptions:i,signal:a})=>{let{resourceManager:o}=n.context;i||=n.getLoadOptions(),r||=n.props.loaders,a&&(i={...i,core:{...i?.core,fetch:{...i?.core?.fetch,signal:a}}});let s=o.contains(e);return!s&&!i&&(o.add({resourceId:e,data:ga(e,r),persistent:!1}),s=!0),s?o.subscribe({resourceId:e,onChange:e=>n.internalState?.reloadAsyncProp(t,e),consumerId:n.id,requestId:t}):ga(e,r,i)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:`number`,min:0,max:1,value:1},operation:`draw`,onHover:{type:`function`,value:null,optional:!0},onClick:{type:`function`,value:null,optional:!0},onDragStart:{type:`function`,value:null,optional:!0},onDrag:{type:`function`,value:null,optional:!0},onDragEnd:{type:`function`,value:null,optional:!0},coordinateSystem:`default`,coordinateOrigin:{type:`array`,value:[0,0,0],compare:!0},modelMatrix:{type:`array`,value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:`XYZ`,colorFormat:`RGBA`,parameters:{type:`object`,value:{},optional:!0,compare:2},loadOptions:{type:`object`,value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:`array`,value:[],optional:!0,ignore:!0},getPolygonOffset:{type:`function`,value:({layerIndex:e})=>[0,-e*100]},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:`accessor`,value:[0,0,128,128]}},dx=class extends nx{constructor(){super(...arguments),this.internalState=null,this.lifecycle=T_.NO_STATE,this.parent=null}static get componentName(){return Object.prototype.hasOwnProperty.call(this,`layerName`)?this.layerName:``}get root(){let e=this;for(;e.parent;)e=e.parent;return e}toString(){return`${this.constructor.layerName||this.constructor.name}({id: '${this.props.id}'})`}project(e){ov(this.internalState);let t=this.internalState.viewport||this.context.viewport,[n,r,i]=pm(Ch(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),t.pixelProjectionMatrix);return e.length===2?[n,r]:[n,r,i]}unproject(e){return ov(this.internalState),(this.internalState.viewport||this.context.viewport).unproject(e)}projectPosition(e,t){return ov(this.internalState),wh(e,{viewport:this.internalState.viewport||this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...t})}get isComposite(){return!1}get isDrawable(){return!0}setState(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return this.internalState?!this.internalState.isAsyncPropLoading():!1}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){let e=this.state;return e&&(e.models||e.model&&[e.model])||[]}setShaderModuleProps(...e){for(let t of this.getModels())t.shaderInputs.setProps(...e)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){let{coordinateSystem:e}=this.props;return e==="default"||e===`lnglat`||e===`cartesian`}onHover(e,t){return this.props.onHover&&this.props.onHover(e,t)||!1}onClick(e,t){return this.props.onClick&&this.props.onClick(e,t)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(e,t=[]){return t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}decodePickingColor(e){ov(e instanceof Uint8Array);let[t,n,r]=e;return t+n*256+r*65536-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&this.state.numInstances!==void 0?this.state.numInstances:Ab(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){return this.getAttributeManager()?.getBounds([`positions`,`instancePositions`])}getShaders(e){e=Nb(e,{disableWarnings:!0,modules:this.context.defaultShaderModules});for(let t of this.props.extensions)e=Nb(e,t.getShaders.call(this,t));return e}shouldUpdateState(e){return e.changeFlags.propsOrDataChanged}updateState(e){let t=this.getAttributeManager(),{dataChanged:n}=e.changeFlags;if(n&&t)if(Array.isArray(n))for(let e of n)t.invalidateAll(e);else t.invalidateAll();if(t){let{props:n}=e,r=this.internalState.hasPickingBuffer,i=Number.isInteger(n.highlightedObjectIndex)||!!n.pickable||n.extensions.some(e=>e.getNeedsPickingBuffer.call(this,e));if(r!==i){this.internalState.hasPickingBuffer=i;let{pickingColors:e,instancePickingColors:n}=t.attributes,r=e||n;r&&(i&&r.constant&&(r.constant=!1,t.invalidate(r.id)),!r.value&&!i&&(r.constant=!0,r.value=[0,0,0]))}}}finalizeState(e){for(let e of this.getModels())e.destroy();let t=this.getAttributeManager();t&&t.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(e){for(let t of this.getModels())t.draw(e.renderPass)}getPickingInfo({info:e,mode:t,sourceLayer:n}){let{index:r}=e;return r>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[r]),e}raiseError(e,t){t&&(e=Error(`${t}: ${e.message}`,{cause:e})),this.props.onError?.(e)||this.context?.onError?.(e,this)}getNeedsRedraw(e={clearRedrawFlags:!1}){return this._getNeedsRedraw(e)}needsUpdate(){return this.internalState?this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()):!1}hasUniformTransition(){return this.internalState?.uniformTransitions.active||!1}activateViewport(e){if(!this.internalState)return;let t=this.internalState.viewport;this.internalState.viewport=e,(!t||!fee({oldViewport:t,viewport:e}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(e=`all`){let t=this.getAttributeManager();t&&(e===`all`?t.invalidateAll():t.invalidate(e))}updateAttributes(e){let t=!1;for(let n in e)e[n].layoutChanged()&&(t=!0);for(let n of this.getModels())this._setModelAttributes(n,e,t)}_updateAttributes(){let e=this.getAttributeManager();if(!e)return;let t=this.props,n=this.getNumInstances(),r=this.getStartIndices();e.update({data:t.data,numInstances:n,startIndices:r,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this});let i=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(i)}_updateAttributeTransition(){let e=this.getAttributeManager();e&&e.updateTransition()}_updateUniformTransition(){let{uniformTransitions:e}=this.internalState;if(e.active){let t=e.update(),n=Object.create(this.props);for(let e in t)Object.defineProperty(n,e,{value:t[e]});return n}return this.props}calculateInstancePickingColors(e,{numInstances:t}){if(e.constant)return;let n=Math.floor(ux.length/4);this.internalState.usesPickingColorCache=!0;let r=t>0&&ux[0]===0;if(nlx&&fo.warn(`Layer has too many data objects. Picking might not be able to distinguish all objects.`)(),ux=nh.allocate(ux,t,{size:4,copy:!0,maxCount:Math.max(t,lx)});let e=Math.floor(ux.length/4),i=[0,0,0],a=r?0:n;for(let t=a;t(fo.deprecated(`layer.state.attributeManager`,`layer.getAttributeManager()`)(),e)}),this.internalState.uniformTransitions=new vb(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(let e of this.props.extensions)e.initializeState.call(this,this.context,e);this.setChangeFlags({dataChanged:`init`,propsChanged:`init`,viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(e){ho(uee,this,this===e);let{state:t,internalState:n}=e;this!==e&&(this.internalState=n,this.state=t,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}_update(){let e=this.needsUpdate();if(ho(cx,this,e),!e)return;this.context.stats.get(`Layer updates`).incrementCount();let t=this.props,n=this.context,r=this.internalState,i=n.viewport,a=this._updateUniformTransition();r.propsInTransition=a,n.viewport=r.viewport||i,this.props=a;try{let e=this._getUpdateParams(),t=this.getModels();if(n.device)this.updateState(e);else try{this.updateState(e)}catch{}for(let t of this.props.extensions)t.updateState.call(this,e,t);this.setNeedsRedraw(),this._updateAttributes();let r=this.getModels()[0]!==t[0];this._postUpdate(e,r)}finally{n.viewport=i,this.props=t,this._clearChangeFlags(),r.needsUpdate=!1,r.resetOldProps()}}_finalize(){ho(lee,this),this.finalizeState(this.context);for(let e of this.props.extensions)e.finalizeState.call(this,this.context,e)}_drawLayer({renderPass:e,shaderModuleProps:t=null,uniforms:n={},parameters:r={}}){this._updateAttributeTransition();let i=this.props,a=this.context;this.props=this.internalState.propsInTransition||i;try{t&&this.setShaderModuleProps(t);let{getPolygonOffset:i}=this.props,o=i&&i(n)||[0,0];a.device instanceof Ne&&a.device.setParametersWebGL({polygonOffset:o});let s=a.device instanceof Ne?null:mee(r);if(hee(this.getModels(),e,r,s),a.device instanceof Ne)a.device.withParametersWebGL(r,()=>{let i={renderPass:e,shaderModuleProps:t,uniforms:n,parameters:r,context:a};for(let e of this.props.extensions)e.draw.call(this,i,e);this.draw(i)});else{s?.renderPassParameters&&e.setParameters(s.renderPassParameters);let i={renderPass:e,shaderModuleProps:t,uniforms:n,parameters:r,context:a};for(let e of this.props.extensions)e.draw.call(this,i,e);this.draw(i)}}finally{this.props=i}}getChangeFlags(){return this.internalState?.changeFlags}setChangeFlags(e){if(!this.internalState)return;let{changeFlags:t}=this.internalState;for(let n in e)if(e[n]){let r=!1;switch(n){case`dataChanged`:let i=e[n],a=t[n];i&&Array.isArray(a)&&(t.dataChanged=Array.isArray(i)?a.concat(i):i,r=!0);default:t[n]||(t[n]=e[n],r=!0)}r&&ho(ox,this,n,e)}let n=!!(t.dataChanged||t.updateTriggersChanged||t.propsChanged||t.extensionsChanged);t.propsOrDataChanged=n,t.somethingChanged=n||t.viewportChanged||t.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(e,t){let n=bb(e,t);if(n.updateTriggersChanged)for(let e in n.updateTriggersChanged)n.updateTriggersChanged[e]&&this.invalidateAttribute(e);if(n.transitionsChanged)for(let r in n.transitionsChanged)this.internalState.uniformTransitions.add(r,t[r],e[r],e.transitions?.[r]);return this.setChangeFlags(n)}validateProps(){yb(this.props)}updateAutoHighlight(e){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(e)}_updateAutoHighlight(e){let t={highlightedObjectColor:e.picked?e.color:null},{highlightColor:n}=this.props;e.picked&&typeof n==`function`&&(t.highlightColor=n(e)),this.setShaderModuleProps({picking:t}),this.setNeedsRedraw()}_getAttributeManager(){let e=this.context;return new db(e.device,{id:this.props.id,stats:e.stats,timeline:e.timeline})}_postUpdate(e,t){let{props:n,oldProps:r}=e,i=this.state.model;i?.isInstanced&&i.setInstanceCount(this.getNumInstances());let{autoHighlight:a,highlightedObjectIndex:o,highlightColor:s}=n;if(t||r.autoHighlight!==a||r.highlightedObjectIndex!==o||r.highlightColor!==s){let e={};Array.isArray(s)&&(e.highlightColor=s),(t||r.autoHighlight!==a||o!==r.highlightedObjectIndex)&&(e.highlightedObjectColor=Number.isFinite(o)&&o>=0?this.encodePickingColor(o):null),this.setShaderModuleProps({picking:e})}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(e){if(!this.internalState)return!1;let t=!1;t||=this.internalState.needsRedraw&&this.id;let n=this.getAttributeManager(),r=n?n.getNeedsRedraw(e):!1;if(t||=r,t)for(let e of this.props.extensions)e.onNeedsRedraw.call(this,e);return this.internalState.needsRedraw=this.internalState.needsRedraw&&!e.clearRedrawFlags,t}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}};dx.defaultProps=pee,dx.layerName=`Layer`;function mee(e){let{blendConstant:t,...n}=e;return t?{pipelineParameters:n,renderPassParameters:{blendConstant:t}}:{pipelineParameters:n}}function hee(e,t,n,r){for(let i of e)i.device.type===`webgpu`?(gee(i,t),i.setParameters({...i.parameters,...r?.pipelineParameters})):i.setParameters(n)}function gee(e,t){let n=t.props.framebuffer||(t.framebuffer??null);if(!n)return;let r=n.colorAttachments.map(e=>e?.texture?.format??null),i=n.depthStencilAttachment?.texture?.format,a=e;(!_ee(a.props.colorAttachmentFormats,r)||a.props.depthStencilAttachmentFormat!==i)&&(a.props.colorAttachmentFormats=r,a.props.depthStencilAttachmentFormat=i,a._setPipelineNeedsUpdate(`attachment formats`))}function _ee(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;ne.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(e){}setState(e){super.setState(e),this.setNeedsUpdate()}getPickingInfo({info:e}){let{object:t}=e;return t&&t.__source&&t.__source.parent&&t.__source.parent.id===this.id?(e.object=t.__source.object,e.index=t.__source.index,e):e}filterSubLayer(e){return!0}shouldRenderSubLayer(e,t){return t&&t.length}getSubLayerClass(e,t){let{_subLayerProps:n}=this.props;return n&&n[e]&&n[e].type||t}getSubLayerRow(e,t,n){return e.__source={parent:this,object:t,index:n},e}getSubLayerAccessor(e){if(typeof e==`function`){let t={index:-1,data:this.props.data,target:[]};return(n,r)=>n&&n.__source?(t.index=n.__source.index,e(n.__source.object,t)):e(n,r)}return e}getSubLayerProps(e={}){let{opacity:t,pickable:n,visible:r,parameters:i,getPolygonOffset:a,highlightedObjectIndex:o,autoHighlight:s,highlightColor:c,coordinateSystem:l,coordinateOrigin:u,wrapLongitude:d,positionFormat:f,modelMatrix:p,extensions:m,fetch:h,operation:g,_subLayerProps:_}=this.props,v={id:``,updateTriggers:{},opacity:t,pickable:n,visible:r,parameters:i,getPolygonOffset:a,highlightedObjectIndex:o,autoHighlight:s,highlightColor:c,coordinateSystem:l,coordinateOrigin:u,wrapLongitude:d,positionFormat:f,modelMatrix:p,extensions:m,fetch:h,operation:g},y=_&&e.id&&_[e.id],b=y&&y.updateTriggers,x=e.id||`sublayer`;if(y){let t=this.props[D_],n=e.type?e.type._propTypes:{};for(let e in y){let r=n[e]||t[e];r&&r.type===`accessor`&&(y[e]=this.getSubLayerAccessor(y[e]))}}Object.assign(v,e,y),v.id=`${this.props.id}-${x}`,v.updateTriggers={all:this.props.updateTriggers?.all,...e.updateTriggers,...b};for(let e of m){let t=e.getSubLayerProps.call(this,e);t&&Object.assign(v,t,{updateTriggers:Object.assign(v.updateTriggers,t.updateTriggers)})}return v}_updateAutoHighlight(e){for(let t of this.getSubLayers())t.updateAutoHighlight(e)}_getAttributeManager(){return null}_postUpdate(e,t){let n=this.internalState.subLayers,r=!n||this.needsUpdate();r&&(n=M_(this.renderLayers(),Boolean),this.internalState.subLayers=n),ho(vee,this,r,n);for(let e of n)e.parent=this}};fx.layerName=`CompositeLayer`;var px=class{static get componentName(){return Object.prototype.hasOwnProperty.call(this,`extensionName`)?this.extensionName:``}constructor(e){e&&(this.opts=e)}equals(e){return this===e||this.constructor===e.constructor&&B_(this.opts,e.opts,1)}getShaders(e){return null}getSubLayerProps(e){let{defaultProps:t}=e.constructor,n={updateTriggers:{}};for(let e in t)if(e in this.props){let r=t[e],i=this.props[e];n[e]=i,r&&r.type===`accessor`&&(n.updateTriggers[e]=this.props.updateTriggers[e],typeof i==`function`&&(n[e]=this.getSubLayerAccessor(i)))}return n}initializeState(e,t){}updateState(e,t){}onNeedsRedraw(e){}getNeedsPickingBuffer(e){return!1}draw(e,t){}finalizeState(e,t){}};px.defaultProps={},px.extensionName=`LayerExtension`;var mx=class{constructor(e){this.indexStarts=[0],this.vertexStarts=[0],this.vertexCount=0,this.instanceCount=0;let{attributes:t={}}=e;this.typedArrayManager=nh,this.attributes={},this._attributeDefs=t,this.opts=e,this.updateGeometry(e)}updateGeometry(e){Object.assign(this.opts,e);let{data:t,buffers:n={},getGeometry:r,geometryBuffer:i,positionFormat:a,dataChanged:o,normalize:s=!0}=this.opts;if(this.data=t,this.getGeometry=r,this.positionSize=i&&i.size||(a===`XY`?2:3),this.buffers=n,this.normalize=s,i&&(ov(t.startIndices),this.getGeometry=this.getGeometryFromBuffer(i),s||(n.vertexPositions=i)),this.geometryBuffer=n.vertexPositions,Array.isArray(o))for(let e of o)this._rebuildGeometry(e);else this._rebuildGeometry()}updatePartialGeometry({startRow:e,endRow:t}){this._rebuildGeometry({startRow:e,endRow:t})}getGeometryFromBuffer(e){let t=e.value||e;return ArrayBuffer.isView(t)?Dy(t,{size:this.positionSize,offset:e.offset,stride:e.stride,startIndices:this.data.startIndices}):null}_allocate(e,t){let{attributes:n,buffers:r,_attributeDefs:i,typedArrayManager:a}=this;for(let o in i)if(o in r)a.release(n[o]),n[o]=null;else{let r=i[o];r.copy=t,n[o]=a.allocate(n[o],e,r)}}_forEachGeometry(e,t,n){let{data:r,getGeometry:i}=this,{iterable:a,objectInfo:o}=Ty(r,t,n);for(let t of a)o.index++,e(i?i(t,o):null,o.index)}_rebuildGeometry(e){if(!this.data)return;let{indexStarts:t,vertexStarts:n,instanceCount:r}=this,{data:i,geometryBuffer:a}=this,{startRow:o=0,endRow:s=1/0}=e||{},c={};if(e||(t=[0],n=[0]),this.normalize||!a)this._forEachGeometry((e,t)=>{let r=e&&this.normalizeGeometry(e);c[t]=r,n[t+1]=n[t]+(r?this.getGeometrySize(r):0)},o,s),r=n[n.length-1];else if(n=i.startIndices,r=n[i.length]||0,ArrayBuffer.isView(a))r||=a.length/this.positionSize;else if(a instanceof U){let e=this.positionSize*4;r||=a.byteLength/e}else if(a.buffer){let e=a.stride||this.positionSize*4;r||=a.buffer.byteLength/e}else if(a.value){let e=a.value,t=a.stride/e.BYTES_PER_ELEMENT||this.positionSize;r||=e.length/t}this._allocate(r,!!e),this.indexStarts=t,this.vertexStarts=n,this.instanceCount=r;let l={};this._forEachGeometry((e,i)=>{let a=c[i]||e;l.vertexStart=n[i],l.indexStart=t[i];let o=igx(e,t));if(_x(e)){if(xee(e))return t.style=bee,(0,X.cloneElement)(e,t);if(See(e))return(0,X.cloneElement)(e,t)}return e}function _x(e){return X.isValidElement(e)}function xee(e){return e.props?.mapStyle}function See(e){let t=e.type;return t&&t.deckGLViewProps}function vx(e){if(typeof e==`function`)return(0,X.createElement)($_,{},e);if(Array.isArray(e))return e.map(vx);if(_x(e)){if(e.type===X.Fragment)return vx(e.props.children);if(hx(e.type,$_))return e}return e}function Cee({children:e,layers:t=[],views:n}){let r=[],i=[],a={};return X.Children.forEach(vx(e),e=>{if(_x(e)){let t=e.type;if(hx(t,dx)){let n=wee(t,e.props);i.push(n)}else r.push(e);if(hx(t,$_)&&t!==$_&&e.props.id){let n=new t(e.props);a[n.id]=n}}else e&&r.push(e)}),Object.keys(a).length>0&&(Array.isArray(n)?n.forEach(e=>{a[e.id]=e}):n&&(a[n.id]=n),n=Object.values(a)),t=i.length>0?[i,t]:t,{layers:t,children:r,views:n}}function wee(e,t){let n={},r=e.defaultProps||{};for(let e in t)r[e]!==t[e]&&(n[e]=t[e]);return new e(n)}var Tee=(0,X.createContext)();function Eee({children:e,deck:t,ContextProvider:n=Tee.Provider}){let{viewManager:r}=t||{};if(!r||!r.views.length)return[];let i={},a=r.views[0].id;for(let t of e){let e=a,n=t;_x(t)&&hx(t.type,$_)&&(e=t.props.id||a,n=t.props.children);let o=r.getViewport(e),s=r.getViewState(e);if(o){s.padding=o.padding;let{x:t,y:r,width:a,height:c}=o;n=gx(n,{x:t,y:r,width:a,height:c,viewport:o,viewState:s}),i[e]||(i[e]={viewport:o,children:[]}),i[e].children.push(n)}}return Object.keys(i).map(e=>{let{viewport:r,children:a}=i[e],{x:o,y:s,width:c,height:l}=r,u={position:`absolute`,left:o,top:s,width:c,height:l},d=`view-${e}`,f=(0,X.createElement)(`div`,{key:d,id:d,style:u},...a),p={deck:t,viewport:r,container:t.canvas.offsetParent,eventManager:t.eventManager,onViewStateChange:n=>{n.viewId=e,t._onViewStateChange(n)},widgets:[]};return(0,X.createElement)(n,{key:`view-${e}-context`,value:p},f)})}var Dee={mixBlendMode:null};function Oee({width:e,height:t,style:n}){let r={position:`absolute`,zIndex:0,left:0,top:0,width:e,height:t},i={left:0,top:0};if(n)for(let e in n)e in Dee?i[e]=n[e]:r[e]=n[e];return{containerStyle:r,canvasStyle:i}}function kee(e){return{get deck(){return e.deck},pickObjectAsync:t=>e.deck.pickObjectAsync(t),pickObjectsAsync:t=>e.deck.pickObjectsAsync(t),pickObject:t=>e.deck.pickObject(t),pickMultipleObjects:t=>e.deck.pickMultipleObjects(t),pickObjects:t=>e.deck.pickObjects(t)}}function yx(e){e.redrawReason&&=(e.deck._drawLayers(e.redrawReason),null)}function bx(e,t,n){let r=new t({...n,_customRender:n.deviceProps?.adapters?.[0]?.type===`webgpu`?void 0:t=>{e.redrawReason=t;let n=r.getViewports();e.lastRenderedViewports===n?yx(e):e.forceUpdate()}});return r}function xx(e,t){let[n,r]=(0,X.useState)(0),i=(0,X.useRef)({control:null,version:n,forceUpdate:()=>r(e=>e+1)}).current,a=(0,X.useRef)(null),o=(0,X.useRef)(null),s=(0,X.useMemo)(()=>Cee(e),[e.layers,e.views,e.children]),c=!0,l=t=>c&&e.viewState?(i.viewStateUpdateRequested=t,null):(i.viewStateUpdateRequested=null,e.onViewStateChange?.(t)),u=t=>{c?i.interactionStateUpdateRequested=t:(i.interactionStateUpdateRequested=null,e.onInteractionStateChange?.(t))},d=(0,X.useMemo)(()=>{let t={widgets:[],...e,style:null,width:`100%`,height:`100%`,parent:a.current,canvas:o.current,layers:s.layers,onViewStateChange:l,onInteractionStateChange:u};return s.views&&(t.views=s.views),delete t._customRender,i.deck&&(i.deck.setProps(t),i.deck.isInitialized&&(i.lastRenderedViewports=i.deck.getViewports())),t},[e]);(0,X.useEffect)(()=>{let t=e.Deck||my;return i.deck=bx(i,t,{...d,parent:a.current,canvas:o.current}),()=>i.deck?.finalize()},[]),yee(()=>{yx(i);let{viewStateUpdateRequested:e,interactionStateUpdateRequested:t}=i;e&&l(e),t&&u(t),i.deck?.isInitialized&&i.deck.redraw(`Initial render`)}),(0,X.useImperativeHandle)(t,()=>kee(i),[]);let f=i.deck&&i.deck.isInitialized?i.deck.getViewports():void 0,{ContextProvider:p,width:m=`100%`,height:h=`100%`,id:g,style:_}=e,{containerStyle:v,canvasStyle:y}=(0,X.useMemo)(()=>Oee({width:m,height:h,style:_}),[m,h,_]);if(!i.viewStateUpdateRequested&&i.lastRenderedViewports===f||i.version!==n){i.lastRenderedViewports=f,i.version=n;let e=Eee({children:s.children,deck:i.deck,ContextProvider:p}),t=(0,X.createElement)(`canvas`,{key:`canvas`,id:g||`deckgl-overlay`,ref:o,style:y}),r=(0,X.createElement)(`div`,{key:`deck-events-root`,className:`deck-events-root`,style:{width:m,height:h}},[t,e]),c=(0,X.createElement)(`div`,{key:`deck-widgets-root`,className:`deck-widgets-root`});i.control=(0,X.createElement)(`div`,{id:`${g||`deckgl`}-wrapper`,ref:a,style:v},[r,c])}return c=!1,i.control}var Sx=X.forwardRef(xx),Cx=``,wx={RECORD_SEP:``,UNIT_SEP:``,BYTE_ORDER_MARK:Cx,BAD_DELIMITERS:[`\r`,` +`,`"`,Cx],WORKERS_SUPPORTED:!1,NODE_STREAM_INPUT:1,LocalChunkSize:1024*1024*10,RemoteChunkSize:1024*1024*5,DefaultDelimiter:`,`};function Aee(e,t={},n=Ex){return new n(t).stream(e)}var Tx=class{_handle;_config;_finished=!1;_completed=!1;_input=null;_baseIndex=0;_partialLine=``;_rowCount=0;_start=0;isFirstChunk=!0;_completeResults={data:[],errors:[],meta:{}};constructor(e){let t={...e};t.dynamicTypingFunction&&(t.dynamicTyping={}),t.chunkSize=parseInt(t.chunkSize),!e.step&&!e.chunk&&(t.chunkSize=null),this._handle=new kx(t),this._handle.streamer=this,this._config=t}parseChunk(e,t){if(this.isFirstChunk&&Px(this._config.beforeFirstChunk)){let t=this._config.beforeFirstChunk(e);t!==void 0&&(e=t)}this.isFirstChunk=!1;let n=this._partialLine+e;this._partialLine=``;let r=this._handle.parse(n,this._baseIndex,!this._finished);if(this._handle.paused()||this._handle.aborted())return;let i=r.meta.cursor;this._finished||(this._partialLine=n.substring(i-this._baseIndex),this._baseIndex=i),r&&r.data&&(this._rowCount+=r.data.length);let a=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(Px(this._config.chunk)&&!t){if(this._config.chunk(r,this._handle),this._handle.paused()||this._handle.aborted())return;r=void 0,this._completeResults=void 0}return!this._config.step&&!this._config.chunk&&(this._completeResults.data=this._completeResults.data.concat(r.data),this._completeResults.errors=this._completeResults.errors.concat(r.errors),this._completeResults.meta=r.meta),!this._completed&&a&&Px(this._config.complete)&&(!r||!r.meta.aborted)&&(this._config.complete(this._completeResults,this._input),this._completed=!0),r}_sendError(e){Px(this._config.error)&&this._config.error(e)}},Ex=class extends Tx{remaining;constructor(e={}){super(e)}stream(e){return this.remaining=e,this._nextChunk()}_nextChunk(){if(this._finished)return;let e=this._config.chunkSize,t=e?this.remaining.substr(0,e):this.remaining;return this.remaining=e?this.remaining.substr(e):``,this._finished=!this.remaining,this.parseChunk(t)}},Dx=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,Ox=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,kx=class{_config;_stepCounter=0;_rowCounter=0;_input;_parser;_paused=!1;_aborted=!1;_delimiterError=!1;_fields=[];_results={data:[],errors:[],meta:{}};constructor(e){if(Px(e.step)){let t=e.step;e.step=n=>{if(this._results=n,this.needsHeaderRow())this.processResults();else{if(this.processResults(),!this._results.data||this._results.data.length===0)return;this._stepCounter+=n.data.length,e.preview&&this._stepCounter>e.preview?this._parser.abort():t(this._results,this)}}}this._config=e}parse(e,t,n){let r=this._config.quoteChar||`"`;if(this._config.newline||(this._config.newline=Ax(e,r)),this._delimiterError=!1,this._config.delimiter)Px(this._config.delimiter)&&(this._config.delimiter=this._config.delimiter(e),this._results.meta.delimiter=this._config.delimiter);else{let t=this.guessDelimiter(e,this._config.newline,this._config.skipEmptyLines,this._config.comments,this._config.delimitersToGuess);t.successful?this._config.delimiter=t.bestDelimiter:(this._delimiterError=!0,this._config.delimiter=wx.DefaultDelimiter),this._results.meta.delimiter=this._config.delimiter}let i=Nx(this._config);return this._config.preview&&this._config.header&&i.preview++,this._input=e,this._parser=new Mx(i),this._results=this._parser.parse(this._input,t,n),this.processResults(),this._paused?{meta:{paused:!0}}:this._results||{meta:{paused:!1}}}paused(){return this._paused}pause(){this._paused=!0,this._parser.abort(),this._input=this._input.substr(this._parser.getCharIndex())}resume(){this._paused=!1,this.streamer.parseChunk(this._input,!0)}aborted(){return this._aborted}abort(){this._aborted=!0,this._parser.abort(),this._results.meta.aborted=!0,Px(this._config.complete)&&this._config.complete(this._results),this._input=``}testEmptyLine(e){return this._config.skipEmptyLines===`greedy`?e.join(``).trim()===``:e.length===1&&e[0].length===0}processResults(){if(this._results&&this._delimiterError&&(this.addError(`Delimiter`,`UndetectableDelimiter`,`Unable to auto-detect delimiting character; defaulted to '${wx.DefaultDelimiter}'`),this._delimiterError=!1),this._config.skipEmptyLines)for(let e=0;e{Px(this._config.transformHeader)&&(e=this._config.transformHeader(e)),this._fields.push(e)};if(Array.isArray(this._results.data[0])){for(let t=0;this.needsHeaderRow()&&t=this._fields.length?`__parsed_extra`:this._fields[r]),this._config.transform&&(i=this._config.transform(i,t)),i=this.parseDynamic(t,i),t===`__parsed_extra`?(n[t]=n[t]||[],n[t].push(i)):n[t]=i}return this._config.header&&(r>this._fields.length?this.addError(`FieldMismatch`,`TooManyFields`,`Too many fields: expected ${this._fields.length} fields but parsed ${r}`,this._rowCounter+t):r1&&(d+=Math.abs(t-s),s=t)}p.data.length>0&&(u/=p.data.length-f),(o===void 0||d>o)&&u>1.99&&(o=d,a=l)}return this._config.delimiter=a,{successful:!!a,bestDelimiter:a}}addError(e,t,n,r){this._results.errors.push({type:e,code:t,message:n,row:r})}};function Ax(e,t){e=e.substr(0,1024*1024);let n=RegExp(`${jx(t)}([^]*?)${jx(t)}`,`gm`);e=e.replace(n,``);let r=e.split(`\r`),i=e.split(` +`),a=i.length>1&&i[0].length=r.length/2?`\r +`:`\r`}function jx(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Mx(e={}){let t=e.delimiter,n=e.newline,r=e.comments,i=e.step,a=e.preview,o=e.fastMode,s;s=e.quoteChar===void 0?`"`:e.quoteChar;let c=s;if(e.escapeChar!==void 0&&(c=e.escapeChar),(typeof t!=`string`||wx.BAD_DELIMITERS.indexOf(t)>-1)&&(t=`,`),r===t)throw Error(`Comment character same as delimiter`);r===!0?r=`#`:(typeof r!=`string`||wx.BAD_DELIMITERS.indexOf(r)>-1)&&(r=!1),n!==` +`&&n!==`\r`&&n!==`\r +`&&(n=` +`);let l=0,u=!1;this.parse=function(e,d,f){if(typeof e!=`string`)throw Error(`Input must be a string`);let p=e.length,m=t.length,h=n.length,g=r.length,_=Px(i);l=0;let v=[],y=[],b=[],x=0;if(!e)return A();if(o||o!==!1&&e.indexOf(s)===-1){let i=e.split(n);for(let e=0;e=a)return v=v.slice(0,a),A(!0)}}return A()}let S=e.indexOf(t,l),C=e.indexOf(n,l),w=new RegExp(jx(c)+jx(s),`g`),T;for(;;){if(e[l]===s){for(T=l,l++;;){if(T=e.indexOf(s,T+1),T===-1)return f||y.push({type:`Quotes`,code:`MissingQuotes`,message:`Quoted field unterminated`,row:v.length,index:l}),O();if(T===p-1)return O(e.substring(l,T).replace(w,s));if(s===c&&e[T+1]===c){T++;continue}if(s!==c&&T!==0&&e[T-1]===c)continue;let r=D(C===-1?S:Math.min(S,C));if(e[T+1+r]===t){if(b.push(e.substring(l,T).replace(w,s)),l=T+1+r+m,S=e.indexOf(t,l),C=e.indexOf(n,l),_&&(j(),u))return A();if(a&&v.length>=a)return A(!0);break}let i=D(C);if(e.substr(T+1+i,h)===n){if(b.push(e.substring(l,T).replace(w,s)),k(T+1+i+h),S=e.indexOf(t,l),_&&(j(),u))return A();if(a&&v.length>=a)return A(!0);break}y.push({type:`Quotes`,code:`InvalidQuotes`,message:`Trailing quote on quoted field is malformed`,row:v.length,index:l}),T++}if(_&&(j(),u))return A();if(a&&v.length>=a)return A(!0);continue}if(r&&b.length===0&&e.substr(l,g)===r){if(C===-1)return A();l=C+h,C=e.indexOf(n,l),S=e.indexOf(t,l);continue}if(S!==-1&&(S=a)return A(!0);continue}break}return O();function E(e){v.push(e),x=l}function D(t){let n=0;if(t!==-1){let r=e.substring(T+1,t);r&&r.trim()===``&&(n=r.length)}return n}function O(t){return f?A():(t===void 0&&(t=e.substr(l)),b.push(t),l=p,E(b),_&&j(),A())}function k(t){l=t,E(b),b=[],C=e.indexOf(n,l)}function A(e,r){return{data:r?v[0]:v,errors:y,meta:{delimiter:t,linebreak:n,aborted:u,truncated:!!e,cursor:x+(d||0)}}}function j(){i(A(void 0,!0)),v=[],y=[]}},this.abort=function(){u=!0},this.getCharIndex=function(){return l}}function Nx(e){if(typeof e!=`object`||!e)return e;let t=Array.isArray(e)?[]:{};for(let n in e)t[n]=Nx(e[n]);return t}function Px(e){return typeof e==`function`}function Fx(e,t={}){let n=!1,r=!0,i=`,`,a=`\r +`,o=`"`,s=o+o,c=!1,l=null;d();let u=new RegExp(Ix(o),`g`);if(typeof e==`string`&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return f(null,e,c);if(typeof e[0]==`object`)return f(l||Object.keys(e[0]),e,c)}else if(typeof e==`object`)return typeof e.data==`string`&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||=e.meta&&e.meta.fields,e.fields||=Array.isArray(e.data[0])?e.fields:Object.keys(e.data[0]),!Array.isArray(e.data[0])&&typeof e.data[0]!=`object`&&(e.data=[e.data])),f(e.fields||[],e.data||[],c);throw Error(`Unable to serialize unrecognized input`);function d(){if(typeof t==`object`){if(typeof t.delimiter==`string`&&!wx.BAD_DELIMITERS.filter(function(e){return t.delimiter?.indexOf(e)!==-1}).length&&(i=t.delimiter),(typeof t.quotes==`boolean`||Array.isArray(t.quotes))&&(n=t.quotes),(typeof t.skipEmptyLines==`boolean`||t.skipEmptyLines===`greedy`)&&(c=t.skipEmptyLines),typeof t.newline==`string`&&(a=t.newline),typeof t.quoteChar==`string`&&(o=t.quoteChar),typeof t.header==`boolean`&&(r=t.header),Array.isArray(t.columns)){if(t.columns.length===0)throw Error(`Option columns is empty`);l=t.columns}t.escapeChar!==void 0&&(s=t.escapeChar+o)}}function f(e,t,n){let o=``;typeof e==`string`&&(e=JSON.parse(e)),typeof t==`string`&&(t=JSON.parse(t));let s=Array.isArray(e)&&e.length>0,c=!Array.isArray(t[0]);if(s&&r){for(let t=0;t0&&(o+=i),o+=p(e[t],t);t.length>0&&(o+=a)}for(let r=0;r0&&!d&&(o+=i);let a=s&&c?e[n]:n;o+=p(t[r][a],n)}r0&&!d)&&(o+=a)}}return o}function p(e,t){return e==null?``:e.constructor===Date?JSON.stringify(e).slice(1,25):(e=e.toString().replace(u,s),typeof n==`boolean`&&n||Array.isArray(n)&&n[t]||m(e,wx.BAD_DELIMITERS)||e.indexOf(i)>-1||e.charAt(0)===` `||e.charAt(e.length-1)===` `?o+e+o:e)}function m(e,t){for(let n=0;n-1)return!0;return!1}}function Ix(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var Lx={...wx,parse:Aee,unparse:Fx,ChunkStreamer:Tx,Parser:Mx,ParserHandle:kx},{ChunkStreamer:Rx}=Lx,zx=class extends Rx{textDecoder=new TextDecoder(this._config.encoding);constructor(e={}){super(e)}async stream(e){this._input=e;try{for await(let t of e)this.parseChunk(this.getStringChunk(t));this._finished=!0,this.parseChunk(``)}catch(e){this._sendError(e)}}_nextChunk(){}getStringChunk(e){return typeof e==`string`?e:this.textDecoder.decode(e,{stream:!0})}},Bx={id:`csv`,module:`csv`,name:`CSV`,extensions:[`csv`,`tsv`,`dsv`],mimeTypes:[`text/csv`,`text/tab-separated-values`,`text/dsv`],category:`table`},Vx=`4.4.3`,Hx=`object-row-table`,Ux={...Bx,dataType:null,batchType:null,version:Vx,parse:async(e,t)=>Wx(new TextDecoder().decode(e),t),parseText:(e,t)=>Wx(e,t),parseInBatches:Gx,options:{csv:{shape:Hx,optimizeMemoryUsage:!1,header:`auto`,columnPrefix:`column`,quoteChar:`"`,escapeChar:`"`,dynamicTyping:!0,comments:!1,skipEmptyLines:!0,delimitersToGuess:[`,`,` `,`|`,`;`]}}};async function Wx(e,t){let n={...Ux.options.csv,...t?.csv},r=qx(e),i=n.header===`auto`?Kx(r):!!n.header,a={...n,header:i,download:!1,transformHeader:i?Jx():void 0,error:e=>{throw Error(e)}},o=Lx.parse(e,a),s=o.data,c=o.meta.fields||Yx(n.columnPrefix,r.length),l=n.shape||Hx,u;switch(l){case`object-row-table`:u={shape:`object-row-table`,data:s.map(e=>Array.isArray(e)?qi(e,c):e)};break;case`array-row-table`:u={shape:`array-row-table`,data:s.map(e=>Array.isArray(e)?e:Ji(e,c))};break;default:throw Error(l)}return u.schema=Vi(u),u}function Gx(e,t){t={...t},t?.core?.batchSize===`auto`&&(t.core.batchSize=4e3);let n={...Ux.options.csv,...t?.csv},r=new ha,i=!0,a=null,o=null,s=null,c={...n,header:!1,download:!1,chunkSize:1024*1024*5,skipEmptyLines:!1,step(e){let c=e.data;if(n.skipEmptyLines&&c.flat().join(``).trim()===``)return;let l=e.meta.cursor;if(i&&!a&&(n.header===`auto`?Kx(c):n.header)){a=c.map(Jx());return}i&&(i=!1,a||=Yx(n.columnPrefix,c.length),s=Xx(c,a)),n.optimizeMemoryUsage&&(c=JSON.parse(JSON.stringify(c)));let u=t?.shape||n.shape||Hx;o||=new ua(s,{shape:u,...t?.core||{}});try{o.addRow(c);let e=o&&o.getFullBatch({bytesUsed:l});e&&r.enqueue(e)}catch(e){r.enqueue(e)}},complete(e){try{let t=e.meta.cursor,n=o&&o.getFinalBatch({bytesUsed:t});n&&r.enqueue(n)}catch(e){r.enqueue(e)}r.close()}};return Lx.parse(Ln(e),c,zx),r}function Kx(e){return e&&e.every(e=>typeof e==`string`)}function qx(e){return Lx.parse(e,{dynamicTyping:!0,preview:1}).data[0]}function Jx(){let e=new Set;return t=>{let n=t,r=1;for(;e.has(n);)n=`${t}.${r}`,r++;return e.add(n),n}}function Yx(e,t=0){let n=[];for(let r=0;r=0&&o<=t.byteLength),{ArrayType:n,length:a,byteLength:o,componentByteSize:$x[e.componentType],numberOfComponentsInElement:Qx[e.type]}}function lS(e){let{images:t,bufferViews:n}=e;t||=[],n||=[];let r=t.map(e=>e.bufferView);n=n.filter(e=>!r.includes(e));let i=n.reduce((e,t)=>e+t.byteLength,0),a=t.reduce((e,t)=>{let{width:n,height:r}=t.image;return e+n*r},0);return i+Math.ceil(4*a*eS)}function uS(e,t,n){let r=e.bufferViews[n];Zx(r);let i=t[r.buffer];Zx(i);let a=(r.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,a,r.byteLength)}function dS(e,t,n){let r=typeof n==`number`?e.accessors?.[n]:n;if(!r)throw Error(`No gltf accessor ${JSON.stringify(n)}`);let i=e.bufferViews?.[r.bufferView||0];if(!i)throw Error(`No gltf buffer view for accessor ${i}`);let{arrayBuffer:a,byteOffset:o}=t[i.buffer],s=(o||0)+(r.byteOffset||0)+(i.byteOffset||0),{ArrayType:c,length:l,componentByteSize:u,numberOfComponentsInElement:d}=cS(r,i),f=u*d,p=i.byteStride||f;if(i.byteStride===void 0||i.byteStride===f)return new c(a,s,l);let m=new c(l);for(let e=0;et===e),n=this.getRequiredExtensions().find(t=>t===e);return typeof t==`string`||typeof n==`string`}getExtension(e){let t=this.getUsedExtensions().find(t=>t===e),n=this.json.extensions||{};return t?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(t=>t===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject(`scenes`,e)}getNode(e){return this.getObject(`nodes`,e)}getSkin(e){return this.getObject(`skins`,e)}getMesh(e){return this.getObject(`meshes`,e)}getMaterial(e){return this.getObject(`materials`,e)}getAccessor(e){return this.getObject(`accessors`,e)}getTexture(e){return this.getObject(`textures`,e)}getSampler(e){return this.getObject(`samplers`,e)}getImage(e){return this.getObject(`images`,e)}getBufferView(e){return this.getObject(`bufferViews`,e)}getBuffer(e){return this.getObject(`buffers`,e)}getObject(e,t){if(typeof t==`object`)return t;let n=this.json[e]&&this.json[e][t];if(!n)throw Error(`glTF file error: Could not find ${e}[${t}]`);return n}getTypedArrayForBufferView(e){e=this.getBufferView(e);let t=e.buffer,n=this.gltf.buffers[t];Zx(n);let r=(e.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,r,e.byteLength)}getTypedArrayForAccessor(e){let t=this.getAccessor(e);return dS(this.gltf.json,this.gltf.buffers,t)}getTypedArrayForImageData(e){e=this.getAccessor(e);let t=this.getBufferView(e.bufferView),n=this.getBuffer(t.buffer).data,r=t.byteOffset||0;return new Uint8Array(n,r,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,n){return e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}setObjectExtension(e,t,n){let r=e.extensions||{};r[t]=n}removeObjectExtension(e,t){let n=e?.extensions||{};if(n[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let e=this.json.extensionsRemoved;e.includes(t)||e.push(t)}delete n[t]}addExtension(e,t={}){return Zx(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Zx(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){let{meshIndex:t,matrix:n}=e;this.json.nodes=this.json.nodes||[];let r={mesh:t};return n&&(r.matrix=n),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(e){let{attributes:t,indices:n,material:r,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(n){let e=this._addIndices(n);a.primitives[0].indices=e}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}addImage(e,t){let n=Ja(e),r=t||n?.mimeType,i={bufferView:this.addBufferView(e),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(e,t=0,n=this.byteLength){let r=e.byteLength;Zx(Number.isFinite(r)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let i={buffer:t,byteOffset:n,byteLength:r};return this.byteLength+=Pn(r,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){let n={bufferView:e,type:oS(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){let n=this.addBufferView(e),r={min:t.min,max:t.max};(!r.min||!r.max)&&(r=this._getAccessorMinMax(e,t.size));let i={size:t.size,componentType:sS(e),count:Math.round(e.length/t.size),min:r.min,max:r.max};return this.addAccessor(n,Object.assign(i,t))}addTexture(e){let{imageIndex:t}=e,n={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){let e=this.byteLength,t=new ArrayBuffer(e),n=new Uint8Array(t),r=0;for(let e of this.sourceBuffers||[])r=Fn(e,n,r);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=e:this.json.buffers=[{byteLength:e}],this.gltf.binary=t,this.sourceBuffers=[t],this.gltf.buffers=[{arrayBuffer:t,byteOffset:0,byteLength:t.byteLength}]}_removeStringFromArray(e,t){let n=!0;for(;n;){let r=e.indexOf(t);r>-1?e.splice(r,1):n=!1}}_addAttributes(e={}){let t={};for(let n in e){let r=e[n],i=this._getGltfAttributeName(n);t[i]=this.addBinaryBuffer(r.value,r)}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case`position`:case`positions`:case`vertices`:return`POSITION`;case`normal`:case`normals`:return`NORMAL`;case`color`:case`colors`:return`COLOR_0`;case`texcoord`:case`texcoords`:return`TEXCOORD_0`;default:return e}}_getAccessorMinMax(e,t){let n={min:null,max:null};if(e.lengtht===e);t===-1&&(t=r.push(e)-1),a.push(t)}let o=new Uint32Array(a),s=e.gltf.buffers.push({arrayBuffer:o.buffer,byteOffset:o.byteOffset,byteLength:o.byteLength})-1,c=e.addBufferView(o,s,0),l=e.addAccessor(c,{size:1,componentType:sS(o),count:o.length});i.attributes[t]=l}function CS(e,t,n,r,i=[0]){let a={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=n[r],s=n[r+1],c=1;t&&(t.indexOf(`image/jpeg`)!==-1||t.indexOf(`image/png`)!==-1)&&(c=4);let l=wS(o,s,e,c),u=0;for(let t of i){let n=typeof t==`number`?Object.values(a)[t]:a[t],r=l+n.offset,i=Oa(e);if(i.data.length<=r)throw Error(`${i.data.length} <= ${r}`);let o=i.data[r];u|=o<r)break;let c=t/i,l=s/i;a.push(e.slice(c,c+l))}return a}function ES(e,t,n){let r=[];for(let i=0;iIS,decode:()=>jS,encode:()=>MS,name:()=>AS}),kS=`EXT_mesh_features`,AS=kS;async function jS(e,t){NS(new pS(e),t)}function MS(e,t){let n=new pS(e);return FS(n,t),n.createBinaryChunk(),n.gltf}function NS(e,t){let n=e.gltf.json;if(n.meshes)for(let r of n.meshes)for(let n of r.primitives)PS(e,n,t)}function PS(e,t,n){if(!n?.gltf?.loadBuffers)return;let r=t.extensions?.[kS]?.featureIds;if(r)for(let i of r){let r;if(i.attribute!==void 0){let n=`_FEATURE_ID_${i.attribute}`,a=t.attributes[n];r=e.getTypedArrayForAccessor(a)}else r=i.texture!==void 0&&n?.gltf?.loadImages?xS(e,i.texture,t):[];i.data=r}}function FS(e,t){let n=e.gltf.json.meshes;if(n)for(let t of n)for(let n of t.primitives)LS(e,n)}function IS(e,t,n,r){t.extensions||={};let i=t.extensions[kS];i||(i={featureIds:[]},t.extensions[kS]=i);let{featureIds:a}=i,o={featureCount:n.length,propertyTable:r,data:n};a.push(o),e.addObjectExtension(t,kS,i)}function LS(e,t){let n=t.extensions?.[kS];if(!n)return;let r=n.featureIds;r.forEach((n,i)=>{if(n.data){let{accessorKey:a,index:o}=RS(t.attributes),s=new Uint32Array(n.data);r[i]={featureCount:s.length,propertyTable:n.propertyTable,attribute:o},e.gltf.buffers.push({arrayBuffer:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength});let c=e.addBufferView(s),l=e.addAccessor(c,{size:1,componentType:sS(s),count:s.length});t.attributes[a]=l}})}function RS(e){let t=`_FEATURE_ID_`,n=Object.keys(e).filter(e=>e.indexOf(t)===0),r=-1;for(let e of n){let t=Number(e.substring(12));t>r&&(r=t)}return r++,{accessorKey:`${t}${r}`,index:r}}var zS=n({createExtStructuralMetadata:()=>lC,decode:()=>HS,encode:()=>US,name:()=>VS}),BS=`EXT_structural_metadata`,VS=BS;async function HS(e,t){WS(new pS(e),t)}function US(e,t){let n=new pS(e);return sC(n,t),n.createBinaryChunk(),n.gltf}function WS(e,t){if(!t.gltf?.loadBuffers)return;let n=e.getExtension(BS);n&&(t.gltf?.loadImages&&GS(e,n),KS(e,n))}function GS(e,t){let n=t.propertyTextures,r=e.gltf.json;if(n&&r.meshes)for(let i of r.meshes)for(let r of i.primitives)JS(e,n,r,t)}function KS(e,t){let n=t.schema;if(!n)return;let r=n.classes,i=t.propertyTables;if(r&&i)for(let t in r){let r=qS(i,t);r&&XS(e,n,r)}}function qS(e,t){for(let n of e)if(n.class===t)return n;return null}function JS(e,t,n,r){if(!t)return;let i=n.extensions?.[BS]?.propertyTextures;if(i)for(let a of i){let i=t[a];YS(e,i,n,r)}}function YS(e,t,n,r){if(!t.properties)return;r.dataAttributeNames||=[];let i=t.class;for(let a in t.properties){let o=`${i}_${a}`,s=t.properties?.[a];if(!s)continue;s.data||=[];let c=s.data,l=xS(e,s,n);l!==null&&(SS(e,o,l,c,n),s.data=c,r.dataAttributeNames.push(o))}}function XS(e,t,n){let r=t.classes?.[n.class];if(!r)throw Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${n.class}`);let i=n.count;for(let a in r.properties){let o=r.properties[a],s=n.properties?.[a];s&&(s.data=ZS(e,t,o,i,s))}}function ZS(e,t,n,r,i){let a=[],o=i.values,s=e.getTypedArrayForBufferView(o),c=QS(e,n,i,r),l=$S(e,i,r);switch(n.type){case`SCALAR`:case`VEC2`:case`VEC3`:case`VEC4`:case`MAT2`:case`MAT3`:case`MAT4`:a=eC(n,r,s,c);break;case`BOOLEAN`:throw Error(`Not implemented - classProperty.type=${n.type}`);case`STRING`:a=DS(r,s,c,l);break;case`ENUM`:a=tC(t,n,r,s,c);break;default:throw Error(`Unknown classProperty type ${n.type}`)}return a}function QS(e,t,n,r){return t.array&&t.count===void 0&&n.arrayOffsets!==void 0?yS(e,n.arrayOffsets,n.arrayOffsetType||`UINT32`,r):null}function $S(e,t,n){return t.stringOffsets===void 0?null:yS(e,t.stringOffsets,t.stringOffsetType||`UINT32`,n)}function eC(e,t,n,r){let i=e.array,a=e.count,o=vS(e.type,e.componentType),s=n.byteLength/o,c;return c=e.componentType?bS(n,e.type,e.componentType,s):n,i?r?TS(c,t,r,n.length,o):a?ES(c,t,a):[]:c}function tC(e,t,n,r,i){let a=t.enumType;if(!a)throw Error(`Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM`);let o=e.enums?.[a];if(!o)throw Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${a}`);let s=o.valueType||`UINT16`,c=vS(t.type,s),l=r.byteLength/c,u=bS(r,t.type,s,l);if(u||=r,t.array){if(i)return nC({valuesData:u,numberOfElements:n,arrayOffsets:i,valuesDataBytesLength:r.length,elementSize:c,enumEntry:o});let e=t.count;return e?rC(u,n,e,o):[]}return iC(u,0,n,o)}function nC(e){let{valuesData:t,numberOfElements:n,arrayOffsets:r,valuesDataBytesLength:i,elementSize:a,enumEntry:o}=e,s=[];for(let e=0;ei)break;let l=iC(t,n/a,c/a,o);s.push(l)}return s}function rC(e,t,n,r){let i=[];for(let a=0;abC,name:()=>yC}),vC=`EXT_feature_metadata`,yC=vC;async function bC(e,t){xC(new pS(e),t)}function xC(e,t){if(!t.gltf?.loadBuffers)return;let n=e.getExtension(vC);n&&(t.gltf?.loadImages&&SC(e,n),CC(e,n))}function SC(e,t){let n=t.schema;if(!n)return;let r=n.classes,{featureTextures:i}=t;if(r&&i)for(let t in r){let n=r[t],a=TC(i,t);a&&DC(e,a,n)}}function CC(e,t){let n=t.schema;if(!n)return;let r=n.classes,i=t.featureTables;if(r&&i)for(let t in r){let r=wC(i,t);r&&EC(e,n,r)}}function wC(e,t){for(let n in e){let r=e[n];if(r.class===t)return r}return null}function TC(e,t){for(let n in e){let r=e[n];if(r.class===t)return r}return null}function EC(e,t,n){if(!n.class)return;let r=t.classes?.[n.class];if(!r)throw Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${n.class}`);let i=n.count;for(let a in r.properties){let o=r.properties[a],s=n.properties?.[a];s&&(s.data=OC(e,t,o,i,s))}}function DC(e,t,n){let r=t.class;for(let i in n.properties){let n=t?.properties?.[i];n&&(n.data=NC(e,n,r))}}function OC(e,t,n,r,i){let a=[],o=i.bufferView,s=e.getTypedArrayForBufferView(o),c=kC(e,n,i,r),l=AC(e,n,i,r);return n.type===`STRING`||n.componentType===`STRING`?a=DS(r,s,c,l):jC(n)&&(a=MC(n,r,s,c)),a}function kC(e,t,n,r){return t.type===`ARRAY`&&t.componentCount===void 0&&n.arrayOffsetBufferView!==void 0?yS(e,n.arrayOffsetBufferView,n.offsetType||`UINT32`,r):null}function AC(e,t,n,r){return n.stringOffsetBufferView===void 0?null:yS(e,n.stringOffsetBufferView,n.offsetType||`UINT32`,r)}function jC(e){let t=[`UINT8`,`INT16`,`UINT16`,`INT32`,`UINT32`,`INT64`,`UINT64`,`FLOAT32`,`FLOAT64`];return t.includes(e.type)||e.componentType!==void 0&&t.includes(e.componentType)}function MC(e,t,n,r){let i=e.type===`ARRAY`,a=e.componentCount,o=`SCALAR`,s=e.componentType||e.type,c=vS(o,s),l=bS(n,o,s,n.byteLength/c);return i?r?TS(l,t,r,n.length,c):a?ES(l,t,a):[]:l}function NC(e,t,n){let r=e.gltf.json;if(!r.meshes)return[];let i=[];for(let a of r.meshes)for(let r of a.primitives)PC(e,n,t,i,r);return i}function PC(e,t,n,r,i){let a=xS(e,{channels:n.channels,...n.texture},i);a&&SS(e,t,a,r,i)}var FC=`4.4.3`,IC=`4.4.3`,LC={TRANSCODER:`basis_transcoder.js`,TRANSCODER_WASM:`basis_transcoder.wasm`,ENCODER:`basis_encoder.js`,ENCODER_WASM:`basis_encoder.wasm`},RC;async function zC(e){return Ht(e.modules),Ut(`basis`)||(RC||=BC(e),await RC)}async function BC(e){let t=null,n=null;return[t,n]=await Promise.all([await vn(LC.TRANSCODER,`textures`,e),await vn(LC.TRANSCODER_WASM,`textures`,e)]),t||=globalThis.BASIS,await VC(t,n)}function VC(e,t){let n={};return t&&(n.wasmBinary=t),new Promise(t=>{e(n).then(e=>{let{BasisFile:n,initializeBasis:r}=e;r(),t({BasisFile:n})})})}var HC;async function UC(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(HC||=jee(e),await HC)}async function jee(e){let t=null,n=null;return[t,n]=await Promise.all([await vn(LC.ENCODER,`textures`,e),await vn(LC.ENCODER_WASM,`textures`,e)]),t||=globalThis.BASIS,await WC(t,n)}function WC(e,t){let n={};return t&&(n.wasmBinary=t),new Promise(t=>{e(n).then(e=>{let{BasisFile:n,KTX2File:r,initializeBasis:i,BasisEncoder:a}=e;i(),t({BasisFile:n,KTX2File:r,BasisEncoder:a})})})}var GC=32854,KC=32856,qC=36194,JC=33776,YC=33779,XC=37493,ZC=35840,QC=35842,$C=36196,ew=35986,tw=34798,nw=37808,rw=36283,iw=36285,aw=36492,ow=[``,`WEBKIT_`,`MOZ_`],sw={WEBGL_compressed_texture_s3tc:[`bc1-rgb-unorm-webgl`,`bc1-rgba-unorm`,`bc2-rgba-unorm`,`bc3-rgba-unorm`],WEBGL_compressed_texture_s3tc_srgb:[`bc1-rgb-unorm-srgb-webgl`,`bc1-rgba-unorm-srgb`,`bc2-rgba-unorm-srgb`,`bc3-rgba-unorm-srgb`],EXT_texture_compression_rgtc:[`bc4-r-unorm`,`bc4-r-snorm`,`bc5-rg-unorm`,`bc5-rg-snorm`],EXT_texture_compression_bptc:[`bc6h-rgb-ufloat`,`bc6h-rgb-float`,`bc7-rgba-unorm`,`bc7-rgba-unorm-srgb`],WEBGL_compressed_texture_etc1:[`etc1-rgb-unorm-webgl`],WEBGL_compressed_texture_etc:[`etc2-rgb8unorm`,`etc2-rgb8unorm-srgb`,`etc2-rgb8a1unorm`,`etc2-rgb8a1unorm-srgb`,`etc2-rgba8unorm`,`etc2-rgba8unorm-srgb`,`eac-r11unorm`,`eac-r11snorm`,`eac-rg11unorm`,`eac-rg11snorm`],WEBGL_compressed_texture_pvrtc:[`pvrtc-rgb4unorm-webgl`,`pvrtc-rgba4unorm-webgl`,`pvrtc-rgb2unorm-webgl`,`pvrtc-rgba2unorm-webgl`],WEBGL_compressed_texture_atc:[`atc-rgb-unorm-webgl`,`atc-rgba-unorm-webgl`,`atc-rgbai-unorm-webgl`],WEBGL_compressed_texture_astc:`astc-4x4-unorm.astc-4x4-unorm-srgb.astc-5x4-unorm.astc-5x4-unorm-srgb.astc-5x5-unorm.astc-5x5-unorm-srgb.astc-6x5-unorm.astc-6x5-unorm-srgb.astc-6x6-unorm.astc-6x6-unorm-srgb.astc-8x5-unorm.astc-8x5-unorm-srgb.astc-8x6-unorm.astc-8x6-unorm-srgb.astc-8x8-unorm.astc-8x8-unorm-srgb.astc-10x5-unorm.astc-10x5-unorm-srgb.astc-10x6-unorm.astc-10x6-unorm-srgb.astc-10x8-unorm.astc-10x8-unorm-srgb.astc-10x10-unorm.astc-10x10-unorm-srgb.astc-12x10-unorm.astc-12x10-unorm-srgb.astc-12x12-unorm.astc-12x12-unorm-srgb`.split(`.`)},cw=null;function lw(e){if(!cw){e=e||uw()||void 0,cw=new Set;for(let t of ow)for(let n in sw)if(e&&e.getExtension(`${t}${n}`))for(let e of sw[n])cw.add(e)}return cw}function uw(){try{return document.createElement(`canvas`).getContext(`webgl`)}catch{return null}}var dw=[171,75,84,88,32,50,48,187,13,10,26,10];function fw(e){let t=new Uint8Array(e);return!(t.byteLength{n=e}),await t;try{return await e()}finally{n()}}async function gw(e,t={}){let n=_n(t);return await hw(async()=>{if(!t.basis?.containerFormat||t.basis.containerFormat===`auto`){if(fw(e))return yw((await UC(n)).KTX2File,e,t);let{BasisFile:r}=await zC(n);return _w(r,e,t)}switch(t.basis.module){case`encoder`:let r=await UC(n);switch(t.basis.containerFormat){case`ktx2`:return yw(r.KTX2File,e,t);default:return _w(r.BasisFile,e,t)}default:let{BasisFile:i}=await zC(n);return _w(i,e,t)}})}function _w(e,t,n){let r=new e(new Uint8Array(t));try{if(!r.startTranscoding())throw Error(`Failed to start basis transcoding`);let e=r.getNumImages(),t=[];for(let i=0;ie.has(t))}var ww={dataType:null,batchType:null,name:`Basis`,id:`basis`,module:`textures`,version:IC,worker:!0,extensions:[`basis`,`ktx2`],mimeTypes:[`application/octet-stream`,`image/ktx2`],tests:[`sB`],binary:!0,options:{basis:{format:`auto`,containerFormat:`auto`,module:`transcoder`}},parse:gw},Tw=!0,Ew=1735152710,Dw=12,Ow=8,kw=1313821514,Aw=5130562,jw=0,Mw=0,Nw=1;function Pw(e,t=0){return`\ +${String.fromCharCode(e.getUint8(t+0))}\ +${String.fromCharCode(e.getUint8(t+1))}\ +${String.fromCharCode(e.getUint8(t+2))}\ +${String.fromCharCode(e.getUint8(t+3))}`}function Fw(e,t=0,n={}){let r=new DataView(e),{magic:i=Ew}=n,a=r.getUint32(t,!1);return a===i||a===Ew}function Iw(e,t,n=0,r={}){let i=new DataView(t),a=Pw(i,n+0),o=i.getUint32(n+4,Tw),s=i.getUint32(n+8,Tw);switch(Object.assign(e,{header:{byteOffset:n,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),n+=Dw,e.version){case 1:return Lw(e,i,n);case 2:return Rw(e,i,n,r={});default:throw Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function Lw(e,t,n){bt(e.header.byteLength>20);let r=t.getUint32(n+0,Tw),i=t.getUint32(n+4,Tw);return n+=Ow,bt(i===jw),Bw(e,t,n,r),n+=r,n+=Vw(e,t,n,e.header.byteLength),n}function Rw(e,t,n,r){return bt(e.header.byteLength>20),zw(e,t,n,r),n+e.header.byteLength}function zw(e,t,n,r){for(;n+8<=e.header.byteLength;){let i=t.getUint32(n+0,Tw),a=t.getUint32(n+4,Tw);switch(n+=Ow,a){case kw:Bw(e,t,n,i);break;case Aw:Vw(e,t,n,i);break;case Mw:r.strict||Bw(e,t,n,i);break;case Nw:r.strict||Vw(e,t,n,i);break;default:break}n+=Pn(i,4)}return n}function Bw(e,t,n,r){let i=new Uint8Array(t.buffer,n,r),a=new TextDecoder(`utf8`).decode(i);return e.json=JSON.parse(a),Pn(r,4)}function Vw(e,t,n,r){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:n,byteLength:r,arrayBuffer:t.buffer}),Pn(r,4)}function Hw(e,t,n){if(e.startsWith(`data:`)||e.startsWith(`http:`)||e.startsWith(`https:`))return e;let r=n?.baseUrl||Uw(t?.core?.baseUrl);if(!r)throw Error(`'baseUrl' must be provided to resolve relative url ${e}`);return r.endsWith(`/`)?`${r}${e}`:`${r}/${e}`}function Uw(e){if(!e)return;if(e.endsWith(`/`))return e;let t=e.lastIndexOf(`/`);return t>=0?e.slice(0,t+1):``}var Ww=`B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB`,Gw=`B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB`,Kw=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),qw=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Jw={0:``,1:`meshopt_decodeFilterOct`,2:`meshopt_decodeFilterQuat`,3:`meshopt_decodeFilterExp`,NONE:``,OCTAHEDRAL:`meshopt_decodeFilterOct`,QUATERNION:`meshopt_decodeFilterQuat`,EXPONENTIAL:`meshopt_decodeFilterExp`},Yw={0:`meshopt_decodeVertexBuffer`,1:`meshopt_decodeIndexBuffer`,2:`meshopt_decodeIndexSequence`,ATTRIBUTES:`meshopt_decodeVertexBuffer`,TRIANGLES:`meshopt_decodeIndexBuffer`,INDICES:`meshopt_decodeIndexSequence`};async function Xw(e,t,n,r,i,a=`NONE`){let o=await Mee();Fee(o,o.exports[Yw[i]],e,t,n,r,o.exports[Jw[a||`NONE`]])}var Zw;async function Mee(){return Zw||=Nee(),Zw}async function Nee(){let e=Ww;WebAssembly.validate(Kw)&&(e=Gw,console.log(`Warning: meshopt_decoder is using experimental SIMD support`));let t=await WebAssembly.instantiate(Pee(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function Pee(e){let t=new Uint8Array(e.length);for(let n=0;n96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}let n=0;for(let r=0;rRee,name:()=>Lee}),Qw=`EXT_meshopt_compression`,Lee=Qw;async function Ree(e,t){let n=new pS(e);if(!t?.gltf?.decompressMeshes||!t.gltf?.loadBuffers)return;let r=[];for(let t of e.json.bufferViews||[])r.push(zee(n,t));await Promise.all(r),n.removeExtension(Qw)}async function zee(e,t){let n=e.getObjectExtension(t,Qw);if(n){let{byteOffset:r=0,byteLength:i=0,byteStride:a,count:o,mode:s,filter:c=`NONE`,buffer:l}=n,u=e.gltf.buffers[l],d=new Uint8Array(u.arrayBuffer,u.byteOffset+r,i);await Xw(new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength),o,a,d,s,c),e.removeObjectExtension(t,Qw)}}var Bee=n({name:()=>Vee,preprocess:()=>Hee}),$w=`EXT_texture_webp`,Vee=$w;function Hee(e,t){let n=new pS(e);if(!so(`image/webp`)){if(n.getRequiredExtensions().includes($w))throw Error(`gltf: Required extension ${$w} not supported by browser`);return}let{json:r}=n;for(let e of r.textures||[]){let t=n.getObjectExtension(e,$w);t&&(e.source=t.source),n.removeObjectExtension(e,$w)}n.removeExtension($w)}var Uee=n({name:()=>tT,preprocess:()=>nT}),eT=`KHR_texture_basisu`,tT=eT;function nT(e,t){let n=new pS(e),{json:r}=n;for(let e of r.textures||[]){let t=n.getObjectExtension(e,eT);t&&(e.source=t.source,n.removeObjectExtension(e,eT))}n.removeExtension(eT)}var rT=`1.5.6`,iT=`1.4.1`,aT=`https://www.gstatic.com/draco/versioned/decoders/${rT}`,oT={DECODER:`draco_wasm_wrapper.js`,DECODER_WASM:`draco_decoder.wasm`,FALLBACK_DECODER:`draco_decoder.js`,ENCODER:`draco_encoder.js`},sT={[oT.DECODER]:`${aT}/${oT.DECODER}`,[oT.DECODER_WASM]:`${aT}/${oT.DECODER_WASM}`,[oT.FALLBACK_DECODER]:`${aT}/${oT.FALLBACK_DECODER}`,[oT.ENCODER]:`https://raw.githubusercontent.com/google/draco/${iT}/javascript/${oT.ENCODER}`},cT;async function lT(e={},t){let n=e.modules||{};return n.draco3d?cT||=n.draco3d.createDecoderModule({}).then(e=>({draco:e})):cT||=dT(e,t),await cT}function uT(e,t){if(e&&typeof e==`object`){if(e.default)return e.default;if(e[t])return e[t]}return e}async function dT(e,t){let n,r;switch(t){case`js`:n=await vn(sT[oT.FALLBACK_DECODER],`draco`,e,oT.FALLBACK_DECODER);break;default:try{[n,r]=await Promise.all([await vn(sT[oT.DECODER],`draco`,e,oT.DECODER),await vn(sT[oT.DECODER_WASM],`draco`,e,oT.DECODER_WASM)])}catch{n=null,r=null}}return n=uT(n,`DracoDecoderModule`),n||=globalThis.DracoDecoderModule,!n&&!Yt&&([n,r]=await Promise.all([await vn(sT[oT.DECODER],`draco`,{...e,useLocalLibraries:!0},oT.DECODER),await vn(sT[oT.DECODER_WASM],`draco`,{...e,useLocalLibraries:!0},oT.DECODER_WASM)]),n=uT(n,`DracoDecoderModule`),n||=globalThis.DracoDecoderModule),await fT(n,r)}function fT(e,t){if(typeof e!=`function`)throw Error(`DracoDecoderModule could not be loaded`);let n={};return t&&(n.wasmBinary=t),new Promise(t=>{e({...n,onModuleLoaded:e=>t({draco:e})})})}var pT=`4.4.3`;function mT(e,t,n){let r=_T(t.metadata),i=[],a=hT(t.attributes);for(let t in e){let n=e[t],r=gT(t,n,a[t]);i.push(r)}if(n){let e=gT(`indices`,n);i.push(e)}return{fields:i,metadata:r}}function hT(e){let t={};for(let n in e){let r=e[n];t[r.name||`undefined`]=r}return t}function gT(e,t,n){return fa(e,t,n?_T(n.metadata):void 0)}function _T(e){Object.entries(e);let t={};for(let n in e)t[`${n}.string`]=JSON.stringify(e[n]);return t}var vT={POSITION:`POSITION`,NORMAL:`NORMAL`,COLOR:`COLOR_0`,TEX_COORD:`TEXCOORD_0`},yT={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},bT=4,xT=class{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);let r=this.decoder.GetEncodedGeometryType(n),i=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let e;switch(r){case this.draco.TRIANGULAR_MESH:e=this.decoder.DecodeBufferToMesh(n,i);break;case this.draco.POINT_CLOUD:e=this.decoder.DecodeBufferToPointCloud(n,i);break;default:throw Error(`DRACO: Unknown geometry type.`)}if(!e.ok()||!i.ptr){let t=`DRACO decompression failed: ${e.error_msg()}`;throw Error(t)}let a=this._getDracoLoaderData(i,r,t),o=this._getMeshData(i,a,t),s=da(o.attributes),c=mT(o.attributes,a,o.indices);return{loader:`draco`,loaderData:a,header:{vertexCount:i.num_points(),boundingBox:s},...o,schema:c}}finally{this.draco.destroy(n),i&&this.draco.destroy(i)}}_getDracoLoaderData(e,t,n){let r=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,n);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:i}}_getDracoAttributes(e,t){let n={};for(let r=0;rthis.decoder[e]).includes(r)){let t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits(),range:t.range(),min_values:new Float32Array([1,2,3]).map(e=>t.min_value(e))}}finally{this.draco.destroy(t)}}return null}_getOctahedronTransform(e,t){let{octahedronAttributes:n=[]}=t,r=e.attribute_type();if(n.map(e=>this.decoder[e]).includes(r)){let t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits()}}finally{this.draco.destroy(t)}}return null}};function ST(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function CT(e){let t=e.size(),n=new Int32Array(t);for(let r=0;rFT,encode:()=>IT,name:()=>NT,preprocess:()=>PT}),MT=`KHR_draco_mesh_compression`,NT=MT;function PT(e,t,n){let r=new pS(e);for(let e of BT(r))r.getObjectExtension(e,MT)}async function FT(e,t,n){if(!t?.gltf?.decompressMeshes)return;let r=new pS(e),i=[];for(let e of BT(r))r.getObjectExtension(e,MT)&&i.push(LT(r,e,t,n));await Promise.all(i),r.removeExtension(MT)}function IT(e,t={}){let n=new pS(e);for(let e of n.json.meshes||[])RT(e,t),n.addRequiredExtension(MT)}async function LT(e,t,n,r){let i=e.getObjectExtension(t,MT);if(!i)return;let a=e.getTypedArrayForBufferView(i.bufferView),o=Nn(a.buffer,a.byteOffset),s={...n};delete s[`3d-tiles`];let c=await yt(o,TT,s,r),l=DT(c.attributes);for(let[n,r]of Object.entries(l))if(n in t.attributes){let i=t.attributes[n],a=e.getAccessor(i);a?.min&&a?.max&&(r.min=a.min,r.max=a.max)}t.attributes=l,c.indices&&(t.indices=OT(c.indices)),e.removeObjectExtension(t,MT),zT(t)}function RT(e,t,n=4,r,i){if(!r.DracoWriter)throw Error(`options.gltf.DracoWriter not provided`);let a=r.DracoWriter.encodeSync({attributes:e}),o=i?.parseSync?.({attributes:e}),s=r._addFauxAttributes(o.attributes),c=r.addBufferView(a);return{primitives:[{attributes:s,mode:n,extensions:{[MT]:{bufferView:c,attributes:s}}}]}}function zT(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw Error(`glTF: Empty primitive detected: Draco decompression failure?`)}function*BT(e){for(let t of e.json.meshes||[])for(let e of t.primitives)yield e}var VT=n({decode:()=>qT,name:()=>UT}),HT=`KHR_texture_transform`,UT=HT,WT=new Y,GT=new Bl,KT=new Bl;async function qT(e,t){if(!new pS(e).hasExtension(HT)||!t.gltf?.loadBuffers)return;let n=e.json.materials||[];for(let t=0;te===r&&t===i)===-1){let a=eE(n);return r!==i&&(e.texCoord=i),t.push([r,i]),{originalTexCoord:r,texCoord:i,matrix:a}}return null}function ZT(e,t,n){let{originalTexCoord:r,texCoord:i,matrix:a}=n,o=t.attributes[`TEXCOORD_${r}`];if(Number.isFinite(o)){let n=e.json.accessors?.[o];if(n&&n.bufferView!==void 0){let o=e.json.bufferViews?.[n.bufferView];if(o){let{arrayBuffer:s,byteOffset:c}=e.buffers[o.buffer],l=(c||0)+(n.byteOffset||0)+(o.byteOffset||0),{ArrayType:u,length:d}=cS(n,o),f=$x[n.componentType],p=Qx[n.type],m=o.byteStride||f*p,h=new Float32Array(d);for(let e=0;et.bufferView===r?e+1:e,0)>1;t.buffers.push({arrayBuffer:$n(n.buffer),byteOffset:0,byteLength:n.buffer.byteLength});let a=t.buffers.length-1;if(t.json.bufferViews=t.json.bufferViews||[],i){t.json.bufferViews.push({buffer:a,byteLength:n.buffer.byteLength,byteOffset:0}),e.bufferView=t.json.bufferViews.length-1;return}let o=t.json.bufferViews[r];o&&(o.buffer=a,o.byteOffset=0,o.byteLength=n.buffer.byteLength,o.byteStride!==void 0&&delete o.byteStride)}function $T(e,t,n,r,i){r.buffers.push({arrayBuffer:$n(i.buffer),byteOffset:0,byteLength:i.buffer.byteLength}),r.json.bufferViews=r.json.bufferViews||[];let a=r.json.bufferViews;a.push({buffer:r.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});let o=r.json.accessors;o&&(o.push({bufferView:a?.length-1,byteOffset:0,componentType:5126,count:t.count,type:`VEC2`}),n.attributes[`TEXCOORD_${e}`]=o.length-1)}function eE(e){let{offset:t=[0,0],rotation:n=0,scale:r=[1,1]}=e,i=new Bl().set(1,0,0,0,1,0,t[0],t[1],1),a=GT.set(Math.cos(n),Math.sin(n),0,-Math.sin(n),Math.cos(n),0,0,0,1),o=KT.set(r[0],0,0,0,r[1],0,0,0,1);return i.multiplyRight(a).multiplyRight(o)}var tE=n({decode:()=>iE,encode:()=>aE,name:()=>rE}),nE=`KHR_lights_punctual`,rE=nE;async function iE(e){let t=new pS(e),{json:n}=t,r=t.getExtension(nE);r&&(t.json.lights=r.lights,t.removeExtension(nE));for(let e of n.nodes||[]){let n=t.getObjectExtension(e,nE);n&&(e.light=n.light),t.removeObjectExtension(e,nE)}}async function aE(e){let t=new pS(e),{json:n}=t;if(n.lights){let e=t.addExtension(nE);Zx(!e.lights),e.lights=n.lights,delete n.lights}if(t.json.lights){for(let e of t.json.lights){let n=e.node;t.addObjectExtension(n,nE,e)}delete t.json.lights}}var oE=n({decode:()=>lE,encode:()=>uE,name:()=>cE}),sE=`KHR_materials_unlit`,cE=sE;async function lE(e){let t=new pS(e),{json:n}=t;for(let e of n.materials||[])e.extensions&&e.extensions.KHR_materials_unlit&&(e.unlit=!0),t.removeObjectExtension(e,sE);t.removeExtension(sE)}function uE(e){let t=new pS(e),{json:n}=t;if(t.materials)for(let e of n.materials||[])e.unlit&&(delete e.unlit,t.addObjectExtension(e,sE,{}),t.addExtension(sE))}var dE=n({decode:()=>mE,encode:()=>hE,name:()=>pE}),fE=`KHR_techniques_webgl`,pE=fE;async function mE(e){let t=new pS(e),{json:n}=t,r=t.getExtension(fE);if(r){let e=gE(r,t);for(let r of n.materials||[]){let n=t.getObjectExtension(r,fE);n&&(r.technique=Object.assign({},n,e[n.technique]),r.technique.values=_E(r.technique,t)),t.removeObjectExtension(r,fE)}t.removeExtension(fE)}}async function hE(e,t){}function gE(e,t){let{programs:n=[],shaders:r=[],techniques:i=[]}=e,a=new TextDecoder;return r.forEach(e=>{if(Number.isFinite(e.bufferView))e.code=a.decode(t.getTypedArrayForBufferView(e.bufferView));else throw Error(`KHR_techniques_webgl: no shader code`)}),n.forEach(e=>{e.fragmentShader=r[e.fragmentShader],e.vertexShader=r[e.vertexShader]}),i.forEach(e=>{e.program=n[e.program]}),i}function _E(e,t){let n=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(t=>{e.uniforms[t].value&&!(t in n)&&(n[t]=e.uniforms[t].value)}),Object.keys(n).forEach(e=>{typeof n[e]==`object`&&n[e].index!==void 0&&(n[e].texture=t.getTexture(n[e].index))}),n}var vE=[zS,OS,Iee,Bee,Uee,jT,tE,oE,dE,VT,_C];function yE(e,t={},n){let r=vE.filter(e=>xE(e.name,t));for(let i of r)i.preprocess?.(e,t,n)}async function bE(e,t={},n){let r=vE.filter(e=>xE(e.name,t));for(let i of r)await i.decode?.(e,t,n)}function xE(e,t){let n=t?.gltf?.excludeExtensions||{};return!(e in n&&!n[e])}var SE=`KHR_binary_glTF`;function CE(e){let t=new pS(e),{json:n}=t;for(let e of n.images||[]){let n=t.getObjectExtension(e,SE);n&&Object.assign(e,n),t.removeObjectExtension(e,SE)}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,t.removeExtension(SE)}var wE={accessors:`accessor`,animations:`animation`,buffers:`buffer`,bufferViews:`bufferView`,images:`image`,materials:`material`,meshes:`mesh`,nodes:`node`,samplers:`sampler`,scenes:`scene`,skins:`skin`,textures:`texture`},TE={accessor:`accessors`,animations:`animation`,buffer:`buffers`,bufferView:`bufferViews`,image:`images`,material:`materials`,mesh:`meshes`,node:`nodes`,sampler:`samplers`,scene:`scenes`,skin:`skins`,texture:`textures`},EE=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(e,t){this.json=e.json;let n=e.json;switch(n.asset&&n.asset.version){case`2.0`:return;case void 0:case`1.0`:break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!t.normalize)throw Error(`glTF v1 is not supported.`);console.warn(`Converting glTF v1 to glTF v2 format. This is experimental and may fail.`),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),CE(e),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(e){e.asset=e.asset||{},e.asset.version=`2.0`,e.asset.generator=e.asset.generator||`Normalized to glTF 2.0 by loaders.gl`}_convertTopLevelObjectsToArrays(e){for(let t in wE)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){let n=e[t];if(!(!n||Array.isArray(n))){e[t]=[];for(let r in n){let i=n[r];i.id=i.id||r;let a=e[t].length;e[t].push(i),this.idToIndexMap[t][r]=a}}}_convertObjectIdsToArrayIndices(e){for(let t in wE)this._convertIdsToIndices(e,t);`scene`in e&&(e.scene=this._convertIdToIndex(e.scene,`scene`));for(let t of e.textures)this._convertTextureIds(t);for(let t of e.meshes)this._convertMeshIds(t);for(let t of e.nodes)this._convertNodeIds(t);for(let t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&=this._convertIdToIndex(e.source,`image`)}_convertMeshIds(e){for(let t of e.primitives){let{attributes:e,indices:n,material:r}=t;for(let t in e)e[t]=this._convertIdToIndex(e[t],`accessor`);n&&(t.indices=this._convertIdToIndex(n,`accessor`)),r&&(t.material=this._convertIdToIndex(r,`material`))}}_convertNodeIds(e){e.children&&=e.children.map(e=>this._convertIdToIndex(e,`node`)),e.meshes&&=e.meshes.map(e=>this._convertIdToIndex(e,`mesh`))}_convertSceneIds(e){e.nodes&&=e.nodes.map(e=>this._convertIdToIndex(e,`node`))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(let n of e[t])for(let e in n){let t=n[e];n[e]=this._convertIdToIndex(t,e)}}_convertIdToIndex(e,t){let n=TE[t];if(n in this.idToIndexMap){let r=this.idToIndexMap[n][e];if(!Number.isFinite(r))throw Error(`gltf v1: failed to resolve ${t} with id ${e}`);return r}return e}_updateObjects(e){for(let e of this.json.buffers)delete e.type}_updateMaterial(e){for(let t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let n=t.values?.tex||t.values?.texture2d_0||t.values?.diffuseTex,r=e.textures.findIndex(e=>e.id===n);r!==-1&&(t.pbrMetallicRoughness.baseColorTexture={index:r})}}};function DE(e,t={}){return new EE().normalize(e,t)}async function OE(e,t,n=0,r,i){return kE(e,t,n,r),DE(e,{normalize:r?.gltf?.normalize}),yE(e,r,i),r?.gltf?.loadBuffers&&e.json.buffers&&await AE(e,r,i),r?.gltf?.loadImages&&await jE(e,r,i),await bE(e,r,i),e}function kE(e,t,n,r){if(r.core?.baseUrl&&(e.baseUri=r.core?.baseUrl),t instanceof ArrayBuffer&&!Fw(t,n,r.glb)&&(t=new TextDecoder().decode(t)),typeof t==`string`)e.json=kn(t);else if(t instanceof ArrayBuffer){let i={};n=Iw(i,t,n,r.glb),Zx(i.type===`glTF`,`Invalid GLB magic string ${i.type}`),e._glb=i,e.json=i.json}else Zx(!1,`GLTF: must be ArrayBuffer or string`);let i=e.json.buffers||[];if(e.buffers=Array(i.length).fill(null),e._glb&&e._glb.header.hasBinChunk){let{binChunks:t}=e._glb;e.buffers[0]={arrayBuffer:t[0].arrayBuffer,byteOffset:t[0].byteOffset,byteLength:t[0].byteLength}}let a=e.json.images||[];e.images=Array(a.length).fill({})}async function AE(e,t,n){let r=e.json.buffers||[];for(let i=0;ithis._resolveBufferView(e,t))),e.images&&(n.images=e.images.map((e,t)=>this._resolveImage(e,t))),e.samplers&&(n.samplers=e.samplers.map((e,t)=>this._resolveSampler(e,t))),e.textures&&(n.textures=e.textures.map((e,t)=>this._resolveTexture(e,t))),e.accessors&&(n.accessors=e.accessors.map((e,t)=>this._resolveAccessor(e,t))),e.materials&&(n.materials=e.materials.map((e,t)=>this._resolveMaterial(e,t))),e.meshes&&(n.meshes=e.meshes.map((e,t)=>this._resolveMesh(e,t))),e.nodes&&(n.nodes=e.nodes.map((e,t)=>this._resolveNode(e,t)),n.nodes=n.nodes.map((e,t)=>this._resolveNodeChildren(e))),e.skins&&(n.skins=e.skins.map((e,t)=>this._resolveSkin(e,t))),e.scenes&&(n.scenes=e.scenes.map((e,t)=>this._resolveScene(e,t))),typeof this.json.scene==`number`&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(e){return this._get(this.json.scenes,e)}getNode(e){return this._get(this.json.nodes,e)}getSkin(e){return this._get(this.json.skins,e)}getMesh(e){return this._get(this.json.meshes,e)}getMaterial(e){return this._get(this.json.materials,e)}getAccessor(e){return this._get(this.json.accessors,e)}getCamera(e){return this._get(this.json.cameras,e)}getTexture(e){return this._get(this.json.textures,e)}getSampler(e){return this._get(this.json.samplers,e)}getImage(e){return this._get(this.json.images,e)}getBufferView(e){return this._get(this.json.bufferViews,e)}getBuffer(e){return this._get(this.json.buffers,e)}_get(e,t){if(typeof t==`object`)return t;let n=e&&e[t];return n||console.warn(`glTF file error: Could not find ${e}[${t}]`),n}_resolveScene(e,t){return{...e,id:e.id||`scene-${t}`,nodes:(e.nodes||[]).map(e=>this.getNode(e))}}_resolveNode(e,t){let n={...e,id:e?.id||`node-${t}`};return e.mesh!==void 0&&(n.mesh=this.getMesh(e.mesh)),e.camera!==void 0&&(n.camera=this.getCamera(e.camera)),e.skin!==void 0&&(n.skin=this.getSkin(e.skin)),e.meshes!==void 0&&e.meshes.length&&(n.mesh=e.meshes.reduce((e,t)=>{let n=this.getMesh(t);return e.id=n.id,e.primitives=e.primitives.concat(n.primitives),e},{primitives:[]})),n}_resolveNodeChildren(e){return e.children&&=e.children.map(e=>this.getNode(e)),e}_resolveSkin(e,t){let n=typeof e.inverseBindMatrices==`number`?this.getAccessor(e.inverseBindMatrices):void 0;return{...e,id:e.id||`skin-${t}`,inverseBindMatrices:n}}_resolveMesh(e,t){let n={...e,id:e.id||`mesh-${t}`,primitives:[]};return e.primitives&&(n.primitives=e.primitives.map(e=>{let t={...e,attributes:{},indices:void 0,material:void 0},n=e.attributes;for(let e in n)t.attributes[e]=this.getAccessor(n[e]);return e.indices!==void 0&&(t.indices=this.getAccessor(e.indices)),e.material!==void 0&&(t.material=this.getMaterial(e.material)),t})),n}_resolveMaterial(e,t){let n={...e,id:e.id||`material-${t}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||=n.emissiveTexture?[1,1,1]:[0,0,0],n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let e=n.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture={...e.baseColorTexture},e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture={...e.metallicRoughnessTexture},e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return n}_resolveAccessor(e,t){let n=HE(e.componentType),r=UE(e.type),i=n*r,a={...e,id:e.id||`accessor-${t}`,bytesPerComponent:n,components:r,bytesPerElement:i,value:void 0,bufferView:void 0,sparse:void 0};if(e.bufferView!==void 0&&(a.bufferView=this.getBufferView(e.bufferView)),a.bufferView){let e=a.bufferView.buffer,{ArrayType:t,byteLength:n}=cS(a,a.bufferView),r=(a.bufferView.byteOffset||0)+(a.byteOffset||0)+e.byteOffset,i=er(e.arrayBuffer,r,n);a.bufferView.byteStride&&(i=this._getValueFromInterleavedBuffer(e,r,a.bufferView.byteStride,a.bytesPerElement,a.count)),a.value=new t(i)}return a}_getValueFromInterleavedBuffer(e,t,n,r,i){let a=new Uint8Array(i*r);for(let o=0;on?n:e}function tD(e){return Math.log(e)*Math.LOG2E}var nD=Math.log2||tD;function rD(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14],_=t[15],v=n*s-r*o,y=n*c-i*o,b=n*l-a*o,x=r*c-i*s,S=r*l-a*s,C=i*l-a*c,w=u*h-d*m,T=u*g-f*m,E=u*_-p*m,D=d*g-f*h,O=d*_-p*h,k=f*_-p*g,A=v*k-y*O+b*D+x*E-S*T+C*w;return A?(A=1/A,e[0]=(s*k-c*O+l*D)*A,e[1]=(i*O-r*k-a*D)*A,e[2]=(h*C-g*S+_*x)*A,e[3]=(f*S-d*C-p*x)*A,e[4]=(c*E-o*k-l*T)*A,e[5]=(n*k-i*E+a*T)*A,e[6]=(g*b-m*C-_*y)*A,e[7]=(u*C-f*b+p*y)*A,e[8]=(o*O-s*E+l*w)*A,e[9]=(r*E-n*O-a*w)*A,e[10]=(m*S-h*b+_*v)*A,e[11]=(d*b-u*S-p*v)*A,e[12]=(s*T-o*D-c*w)*A,e[13]=(n*D-r*T+i*w)*A,e[14]=(h*y-m*x-g*v)*A,e[15]=(u*x-d*y+f*v)*A,e):null}function iD(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=n[0],b=n[1],x=n[2],S=n[3];return e[0]=y*r+b*s+x*d+S*h,e[1]=y*i+b*c+x*f+S*g,e[2]=y*a+b*l+x*p+S*_,e[3]=y*o+b*u+x*m+S*v,y=n[4],b=n[5],x=n[6],S=n[7],e[4]=y*r+b*s+x*d+S*h,e[5]=y*i+b*c+x*f+S*g,e[6]=y*a+b*l+x*p+S*_,e[7]=y*o+b*u+x*m+S*v,y=n[8],b=n[9],x=n[10],S=n[11],e[8]=y*r+b*s+x*d+S*h,e[9]=y*i+b*c+x*f+S*g,e[10]=y*a+b*l+x*p+S*_,e[11]=y*o+b*u+x*m+S*v,y=n[12],b=n[13],x=n[14],S=n[15],e[12]=y*r+b*s+x*d+S*h,e[13]=y*i+b*c+x*f+S*g,e[14]=y*a+b*l+x*p+S*_,e[15]=y*o+b*u+x*m+S*v,e}function aD(e,t,n){var r=n[0],i=n[1],a=n[2],o,s,c,l,u,d,f,p,m,h,g,_;return t===e?(e[12]=t[0]*r+t[4]*i+t[8]*a+t[12],e[13]=t[1]*r+t[5]*i+t[9]*a+t[13],e[14]=t[2]*r+t[6]*i+t[10]*a+t[14],e[15]=t[3]*r+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],c=t[2],l=t[3],u=t[4],d=t[5],f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],e[0]=o,e[1]=s,e[2]=c,e[3]=l,e[4]=u,e[5]=d,e[6]=f,e[7]=p,e[8]=m,e[9]=h,e[10]=g,e[11]=_,e[12]=o*r+u*i+m*a+t[12],e[13]=s*r+d*i+h*a+t[13],e[14]=c*r+f*i+g*a+t[14],e[15]=l*r+p*i+_*a+t[15]),e}function oD(e,t,n){var r=n[0],i=n[1],a=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function sD(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+l*r,e[5]=o*i+u*r,e[6]=s*i+d*r,e[7]=c*i+f*r,e[8]=l*i-a*r,e[9]=u*i-o*r,e[10]=d*i-s*r,e[11]=f*i-c*r,e}function cD(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[4],u=t[5],d=t[6],f=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+l*r,e[1]=o*i+u*r,e[2]=s*i+d*r,e[3]=c*i+f*r,e[4]=l*i-a*r,e[5]=u*i-o*r,e[6]=d*i-s*r,e[7]=f*i-c*r,e}function lD(e,t,n,r,i){var a=1/Math.tan(t/2),o;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(o=1/(r-i),e[10]=(i+r)*o,e[14]=2*i*r*o):(e[10]=-1,e[14]=-2*r),e}var uD=lD;function dD(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],d=e[9],f=e[10],p=e[11],m=e[12],h=e[13],g=e[14],_=e[15],v=t[0],y=t[1],b=t[2],x=t[3],S=t[4],C=t[5],w=t[6],T=t[7],E=t[8],D=t[9],O=t[10],k=t[11],A=t[12],j=t[13],M=t[14],N=t[15];return Math.abs(n-v)<=1e-6*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-x)<=1e-6*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-S)<=1e-6*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(s-C)<=1e-6*Math.max(1,Math.abs(s),Math.abs(C))&&Math.abs(c-w)<=1e-6*Math.max(1,Math.abs(c),Math.abs(w))&&Math.abs(l-T)<=1e-6*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(u-E)<=1e-6*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(d-D)<=1e-6*Math.max(1,Math.abs(d),Math.abs(D))&&Math.abs(f-O)<=1e-6*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(p-k)<=1e-6*Math.max(1,Math.abs(p),Math.abs(k))&&Math.abs(m-A)<=1e-6*Math.max(1,Math.abs(m),Math.abs(A))&&Math.abs(h-j)<=1e-6*Math.max(1,Math.abs(h),Math.abs(j))&&Math.abs(g-M)<=1e-6*Math.max(1,Math.abs(g),Math.abs(M))&&Math.abs(_-N)<=1e-6*Math.max(1,Math.abs(_),Math.abs(N))}function fD(){var e=new KE(2);return KE!=Float32Array&&(e[0]=0,e[1]=0),e}function pD(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function mD(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function hD(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function gD(e){var t=e[0],n=e[1];return Math.hypot(t,n)}function _D(e,t){return e[0]=-t[0],e[1]=-t[1],e}function vD(e,t,n,r){var i=t[0],a=t[1];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e}var yD=mD;(function(){var e=fD();return function(t,n,r,i,a,o){var s,c;for(n||=2,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;s=-90&&n<=90,`invalid latitude`);let r=t*OD,i=n*OD;return[AD*(r+ED)/(2*ED),AD*(ED+Math.log(Math.tan(DD+i*.5)))/(2*ED)]}function LD(e){let[t,n]=e,r=t/AD*(2*ED)-ED,i=2*(Math.atan(Math.exp(n/AD*(2*ED)-ED))-DD);return[r*kD,i*kD]}function RD(e){let{latitude:t,longitude:n,highPrecision:r=!1}=e;TD(Number.isFinite(t)&&Number.isFinite(n));let i=AD,a=Math.cos(t*OD),o=i/360,s=o/a,c=i/jD/a,l={unitsPerMeter:[c,c,c],metersPerUnit:[1/c,1/c,1/c],unitsPerDegree:[o,s,c],degreesPerUnit:[1/o,1/s,1/c]};if(r){let e=OD*Math.tan(t*OD)/a,n=o*e/2,r=i/jD*e,u=r/s*c;l.unitsPerDegree2=[0,n,r],l.unitsPerMeter2=[u,0,u]}return l}function zD(e){let{height:t,pitch:n,bearing:r,altitude:i,scale:a,center:o}=e,s=XE();aD(s,s,[0,0,-i]),sD(s,s,-n*OD),cD(s,s,r*OD);let c=a/t;return oD(s,s,[c,c,c]),o&&aD(s,s,CD([],o)),s}function BD(e){let{width:t,height:n,altitude:r,pitch:i=0,offset:a,center:o,scale:s,nearZMultiplier:c=1,farZMultiplier:l=1}=e,{fovy:u=HD(ND)}=e;r!==void 0&&(u=HD(r));let d=u*OD,f=i*OD,p=UD(u),m=p;o&&(m+=o[2]*s/Math.cos(f)/n);let h=d*(.5+(a?a[1]:0)/n),g=Math.sin(h)*m/Math.sin(eD(Math.PI/2-f-h,.01,Math.PI-.01)),_=Math.sin(f)*g+m,v=m*10,y=Math.min(_*l,v);return{fov:d,aspect:t/n,focalDistance:p,near:c,far:y}}function VD(e){let{fov:t,aspect:n,near:r,far:i}=BD(e);return uD([],t,n,r,i)}function HD(e){return 2*Math.atan(.5/e)*kD}function UD(e){return .5/Math.tan(.5*e*OD)}function WD(e,t){let[n,r,i=0]=e;return TD(Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(i)),ZE(t,[n,r,i,1])}function GD(e,t,n=0){let[r,i,a]=e;if(TD(Number.isFinite(r)&&Number.isFinite(i),`invalid pixel coordinate`),Number.isFinite(a))return ZE(t,[r,i,a,1]);let o=ZE(t,[r,i,0,1]),s=ZE(t,[r,i,1,1]),c=o[2],l=s[2];return vD([],o,s,c===l?0:((n||0)-c)/(l-c))}function KD(e){let{width:t,height:n,bounds:r,minExtent:i=0,maxZoom:a=24,offset:o=[0,0]}=e,[[s,c],[l,u]]=r,d=qD(e.padding),f=ID([s,eD(u,-MD,MD)]),p=ID([l,eD(c,-MD,MD)]),m=[Math.max(Math.abs(p[0]-f[0]),i),Math.max(Math.abs(p[1]-f[1]),i)],h=[t-d.left-d.right-Math.abs(o[0])*2,n-d.top-d.bottom-Math.abs(o[1])*2];TD(h[0]>0&&h[1]>0);let g=h[0]/m[0],_=h[1]/m[1],v=(d.right-d.left)/2/g,y=(d.top-d.bottom)/2/_,b=LD([(p[0]+f[0])/2+v,(p[1]+f[1])/2+y]),x=Math.min(a,nD(Math.abs(Math.min(g,_))));return TD(Number.isFinite(x)),{longitude:b[0],latitude:b[1],zoom:x}}function qD(e=0){return typeof e==`number`?{top:e,bottom:e,left:e,right:e}:(TD(Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)),e)}var JD=Math.PI/180;function YD(e,t=0){let{width:n,height:r,unproject:i}=e,a={targetZ:t},o=i([0,r],a),s=i([n,r],a),c,l;return(e.fovy?.5*e.fovy*JD:Math.atan(.5/e.altitude))>(90-e.pitch)*JD-.01?(c=XD(e,0,t),l=XD(e,n,t)):(c=i([0,0],a),l=i([n,0],a)),[o,s,l,c]}function XD(e,t,n){let{pixelUnprojectionMatrix:r}=e,i=ZE(r,[t,0,1,1]),a=ZE(r,[t,e.height,1,1]),o=LD(vD([],i,a,(n*e.distanceScales.unitsPerMeter[2]-i[2])/(a[2]-i[2])));return o.push(n),o}var ZD=class e{constructor(t={width:1,height:1}){C(this,`latitude`,void 0),C(this,`longitude`,void 0),C(this,`zoom`,void 0),C(this,`pitch`,void 0),C(this,`bearing`,void 0),C(this,`altitude`,void 0),C(this,`fovy`,void 0),C(this,`meterOffset`,void 0),C(this,`center`,void 0),C(this,`width`,void 0),C(this,`height`,void 0),C(this,`scale`,void 0),C(this,`distanceScales`,void 0),C(this,`viewMatrix`,void 0),C(this,`projectionMatrix`,void 0),C(this,`viewProjectionMatrix`,void 0),C(this,`pixelProjectionMatrix`,void 0),C(this,`pixelUnprojectionMatrix`,void 0),C(this,`equals`,t=>t instanceof e&&t.width===this.width&&t.height===this.height&&dD(t.projectionMatrix,this.projectionMatrix)&&dD(t.viewMatrix,this.viewMatrix)),C(this,`project`,(e,t={})=>{let{topLeft:n=!0}=t,r=WD(this.projectPosition(e),this.pixelProjectionMatrix),[i,a]=r,o=n?a:this.height-a;return e.length===2?[i,o]:[i,o,r[2]]}),C(this,`unproject`,(e,t={})=>{let{topLeft:n=!0,targetZ:r=void 0}=t,[i,a,o]=e,s=n?a:this.height-a,c=r&&r*this.distanceScales.unitsPerMeter[2],l=GD([i,s,o],this.pixelUnprojectionMatrix,c),[u,d,f]=this.unprojectPosition(l);return Number.isFinite(o)?[u,d,f]:Number.isFinite(r)?[u,d,r]:[u,d]}),C(this,`projectPosition`,e=>{let[t,n]=ID(e);return[t,n,(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}),C(this,`unprojectPosition`,e=>{let[t,n]=LD(e);return[t,n,(e[2]||0)*this.distanceScales.metersPerUnit[2]]});let{width:n,height:r,altitude:i=null,fovy:a=null}=t,{latitude:o=0,longitude:s=0,zoom:c=0,pitch:l=0,bearing:u=0,position:d=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}=t;n||=1,r||=1,a===null&&i===null?(i=ND,a=HD(i)):a===null?a=HD(i):i===null&&(i=UD(a));let m=PD(c);i=Math.max(.75,i);let h=RD({longitude:s,latitude:o}),g=ID([s,o]);g.push(0),d&&xD(g,g,wD([],d,h.unitsPerMeter)),this.projectionMatrix=VD({width:n,height:r,scale:m,center:g,pitch:l,fovy:a,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=zD({height:r,scale:m,center:g,pitch:l,bearing:u,altitude:i}),this.width=n,this.height=r,this.scale=m,this.latitude=o,this.longitude=s,this.zoom=c,this.pitch=l,this.bearing=u,this.altitude=i,this.fovy=a,this.center=g,this.meterOffset=d||[0,0,0],this.distanceScales=h,this._initMatrices(),Object.freeze(this)}_initMatrices(){let{width:e,height:t,projectionMatrix:n,viewMatrix:r}=this,i=XE();iD(i,i,n),iD(i,i,r),this.viewProjectionMatrix=i;let a=XE();oD(a,a,[e/2,-t/2,1]),aD(a,a,[1,-1,0]),iD(a,a,i);let o=rD(XE(),a);if(!o)throw Error(`Pixel project matrix not invertible`);this.pixelProjectionMatrix=a,this.pixelUnprojectionMatrix=o}projectFlat(e){return ID(e)}unprojectFlat(e){return LD(e)}getMapCenterByLngLatPosition({lngLat:e,pos:t}){let n=GD(t,this.pixelUnprojectionMatrix),r=pD([],ID(e),_D([],n));return LD(pD([],this.center,r))}fitBounds(t,n={}){let{width:r,height:i}=this,{longitude:a,latitude:o,zoom:s}=KD(Object.assign({width:r,height:i,bounds:t},n));return new e({width:r,height:i,longitude:a,latitude:o,zoom:s})}getBounds(e){let t=this.getBoundingRegion(e),n=Math.min(...t.map(e=>e[0])),r=Math.max(...t.map(e=>e[0])),i=Math.min(...t.map(e=>e[1])),a=Math.max(...t.map(e=>e[1]));return[[n,i],[r,a]]}getBoundingRegion(e={}){return YD(this,e.z||0)}getLocationAtPoint({lngLat:e,pos:t}){return this.getMapCenterByLngLatPosition({lngLat:e,pos:t})}},QD=512;function $D(e){let{width:t,height:n,pitch:r=0}=e,{longitude:i,latitude:a,zoom:o,bearing:s=0}=e;(i<-180||i>180)&&(i=QE(i+180,360)-180),(s<-180||s>180)&&(s=QE(s+180,360)-180);let c=nD(n/QD);if(o<=c)o=c,a=0;else{let e=n/2/2**o,t=LD([0,e])[1];if(at&&(a=t)}}return{width:t,height:n,longitude:i,latitude:a,zoom:o,pitch:r,bearing:s}}var eO=.01,tO=[`longitude`,`latitude`,`zoom`],nO={curve:1.414,speed:1.2};function rO(e,t,n,r){let{startZoom:i,startCenterXY:a,uDelta:o,w0:s,u1:c,S:l,rho:u,rho2:d,r0:f}=aO(e,t,r);if(co?0:u}function aO(e,t,n){n=Object.assign({},nO,n);let r=n.curve,i=e.zoom,a=[e.longitude,e.latitude],o=PD(i),s=t.zoom,c=[t.longitude,t.latitude],l=PD(s-i),u=ID(a),d=yD([],ID(c),u),f=Math.max(e.width,e.height),p=f/l,m=gD(d)*o,h=Math.max(m,eO),g=r*r,_=(p*p-f*f+g*g*h*h)/(2*f*g*h),v=(p*p-f*f-g*g*h*h)/(2*p*g*h),y=Math.log(Math.sqrt(_*_+1)-_),b=Math.log(Math.sqrt(v*v+1)-v);return{startZoom:i,startCenterXY:u,uDelta:d,w0:f,u1:m,S:(b-y)/r,rho:r,rho2:g,r0:y,r1:b}}typeof window<`u`||global;var oO=typeof document<`u`?document:{};function sO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cO(e){for(var t=1;t`u`||e[Symbol.iterator]==null){if(Array.isArray(e)||(n=uO(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(o)throw s}}}}function uO(e,t){if(e){if(typeof e==`string`)return dO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dO(e,t)}}function dO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&arguments[1]!==void 0?arguments[1]:`component`;e.debug&&Z.checkPropTypes(gO,e,`prop`,t)}var bO=function(){function e(t){var n=this;if(ie(this,e),C(this,`props`,_O),C(this,`width`,0),C(this,`height`,0),C(this,`_fireLoadEvent`,function(){n.props.onLoad({type:`load`,target:n._map})}),C(this,`_handleError`,function(e){n.props.onError(e)}),!t.mapboxgl)throw Error(`Mapbox not available`);this.mapboxgl=t.mapboxgl,e.initialized||(e.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(t)}return ae(e,[{key:`finalize`,value:function(){return this._destroy(),this}},{key:`setProps`,value:function(e){return this._update(this.props,e),this}},{key:`redraw`,value:function(){var e=this._map;e.style&&(e._frame&&=(e._frame.cancel(),null),e._render())}},{key:`getMap`,value:function(){return this._map}},{key:`_reuse`,value:function(t){this._map=e.savedMap;var n=this._map.getContainer(),r=t.container;for(r.classList.add(`mapboxgl-map`);n.childNodes.length>0;)r.appendChild(n.childNodes[0]);this._map._container=r,e.savedMap=null,t.mapStyle&&this._map.setStyle(pO(t.mapStyle),{diff:!1}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once(`styledata`,this._fireLoadEvent)}},{key:`_create`,value:function(t){if(t.reuseMaps&&e.savedMap)this._reuse(t);else{if(t.gl){var n=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=n,t.gl}}var r={container:t.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:pO(t.mapStyle),interactive:!1,trackResize:!1,attributionControl:t.attributionControl,preserveDrawingBuffer:t.preserveDrawingBuffer};t.transformRequest&&(r.transformRequest=t.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},r,t.mapOptions)),this._map.once(`load`,this._fireLoadEvent),this._map.on(`error`,this._handleError)}return this}},{key:`_destroy`,value:function(){this._map&&=(this.props.reuseMaps&&!e.savedMap?(e.savedMap=this._map,this._map.off(`load`,this._fireLoadEvent),this._map.off(`error`,this._handleError),this._map.off(`styledata`,this._fireLoadEvent)):this._map.remove(),null)}},{key:`_initialize`,value:function(e){var t=this;e=Object.assign({},_O,e),yO(e,`Mapbox`),this.mapboxgl.accessToken=e.mapboxApiAccessToken||_O.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=e.mapboxApiUrl,this._create(e);var n=e.container;Object.defineProperty(n,"offsetWidth",{configurable:!0,get:function(){return t.width}}),Object.defineProperty(n,"clientWidth",{configurable:!0,get:function(){return t.width}}),Object.defineProperty(n,"offsetHeight",{configurable:!0,get:function(){return t.height}}),Object.defineProperty(n,"clientHeight",{configurable:!0,get:function(){return t.height}});var r=this._map.getCanvas();r&&(r.style.outline=`none`),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}},{key:`_update`,value:function(e,t){if(this._map){t=Object.assign({},this.props,t),yO(t,`Mapbox`);var n=this._updateMapViewport(e,t),r=this._updateMapSize(e,t);this._updateMapStyle(e,t),!t.asyncRender&&(n||r)&&this.redraw(),this.props=t}}},{key:`_updateMapStyle`,value:function(e,t){e.mapStyle!==t.mapStyle&&this._map.setStyle(pO(t.mapStyle),{diff:!t.preventStyleDiffing})}},{key:`_updateMapSize`,value:function(e,t){var n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this._map.resize()),n}},{key:`_updateMapViewport`,value:function(e,t){var n=this._getViewState(e),r=this._getViewState(t),i=r.latitude!==n.latitude||r.longitude!==n.longitude||r.zoom!==n.zoom||r.pitch!==n.pitch||r.bearing!==n.bearing||r.altitude!==n.altitude;return i&&(this._map.jumpTo(this._viewStateToMapboxProps(r)),r.altitude!==n.altitude&&(this._map.transform.altitude=r.altitude)),i}},{key:`_getViewState`,value:function(e){var t=e.viewState||e,n=t.longitude,r=t.latitude,i=t.zoom,a=t.pitch,o=a===void 0?0:a,s=t.bearing,c=s===void 0?0:s,l=t.altitude;return{longitude:n,latitude:r,zoom:i,pitch:o,bearing:c,altitude:l===void 0?1.5:l}}},{key:`_checkStyleSheet`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`0.47.0`;if(oO!==void 0)try{var t=oO.createElement(`div`);if(t.className=`mapboxgl-map`,t.style.display=`none`,oO.body.appendChild(t),window.getComputedStyle(t).position===`static`){var n=oO.createElement(`link`);n.setAttribute(`rel`,`stylesheet`),n.setAttribute(`type`,`text/css`),n.setAttribute(`href`,`https://api.tiles.mapbox.com/mapbox-gl-js/v${e}/mapbox-gl.css`),oO.head.appendChild(n)}}catch{}}},{key:`_viewStateToMapboxProps`,value:function(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}]),e}();C(bO,`initialized`,!1),C(bO,`propTypes`,gO),C(bO,`defaultProps`,_O),C(bO,`savedMap`,null);var xO=t(r(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n||=self,n.mapboxgl=r())})(e,(function(){var e,t,n;function r(r,i){if(!e)e=i;else if(!t)t=i;else{var a=`var sharedChunk = {}; (`+e+`)(sharedChunk); (`+t+`)(sharedChunk);`,o={};e(o),n=i(o),typeof window<`u`&&(n.workerUrl=window.URL.createObjectURL(new Blob([a],{type:`text/javascript`})))}}return r([`exports`],(function(e){function t(e,t){return e(t={exports:{}},t.exports),t.exports}var n=r;function r(e,t,n,r){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=n,this.p2y=r}r.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},r.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},r.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},r.prototype.solveCurveX=function(e,t){var n,r,i,a,o;for(t===void 0&&(t=1e-6),i=e,o=0;o<8;o++){if(a=this.sampleCurveX(i)-e,Math.abs(a)(r=1))return r;for(;na?n=i:r=i,i=.5*(r-n)+n}return i},r.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var i=a;function a(e,t){this.x=e,this.y=t}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=n*this.x+t*this.y;return this.x=t*this.x-n*this.y,this.y=r,this},_rotateAround:function(e,t){var n=Math.cos(e),r=Math.sin(e),i=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=t.x+n*(this.x-t.x)-r*(this.y-t.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(e){return e instanceof a?e:Array.isArray(e)?new a(e[0],e[1]):e};var o=typeof self<`u`?self:{},s=2**53-1;function c(e,t,r,i){var a=new n(e,t,r,i);return function(e){return a.solve(e)}}var l=c(.25,.1,.25,1);function u(e,t,n){return Math.min(n,Math.max(t,e))}function d(e,t,n){var r=n-t,i=((e-t)%r+r)%r+t;return i===t?n:i}function f(e){for(var t=[],n=arguments.length-1;n-->0;)t[n]=arguments[n+1];for(var r=0,i=t;r>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function g(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function _(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}function v(e,t){return e.indexOf(t,e.length-t.length)!==-1}function y(e,t,n){var r={};for(var i in e)r[i]=t.call(n||this,e[i],i,e);return r}function b(e,t,n){var r={};for(var i in e)t.call(n||this,e[i],i,e)&&(r[i]=e[i]);return r}function x(e){return Array.isArray(e)?e.map(x):typeof e==`object`&&e?y(e,x):e}var S={};function C(e){S[e]||(typeof console<`u`&&console.warn(e),S[e]=!0)}function w(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}function T(e){for(var t=0,n=0,r=e.length,i=r-1,a=void 0,o=void 0;n@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(e,n,r,i){var a=r||i;return t[n]=!a||a.toLowerCase(),``})),t[`max-age`]){var n=parseInt(t[`max-age`],10);isNaN(n)?delete t[`max-age`]:t[`max-age`]=n}return t}var O=null;function k(e){if(O==null){var t=e.navigator?e.navigator.userAgent:null;O=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match(`Safari`)&&!t.match(`Chrome`)))}return O}function A(e){try{var t=o[e];return t.setItem(`_mapbox_test_`,1),t.removeItem(`_mapbox_test_`),!0}catch{return!1}}var j,M,N,P,ee=o.performance&&o.performance.now?o.performance.now.bind(o.performance):Date.now.bind(Date),F=o.requestAnimationFrame||o.mozRequestAnimationFrame||o.webkitRequestAnimationFrame||o.msRequestAnimationFrame,I=o.cancelAnimationFrame||o.mozCancelAnimationFrame||o.webkitCancelAnimationFrame||o.msCancelAnimationFrame,te={now:ee,frame:function(e){var t=F(e);return{cancel:function(){return I(t)}}},getImageData:function(e,t){t===void 0&&(t=0);var n=o.document.createElement(`canvas`),r=n.getContext(`2d`);if(!r)throw Error(`failed to create canvas 2d context`);return n.width=e.width,n.height=e.height,r.drawImage(e,0,0,e.width,e.height),r.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return j||=o.document.createElement(`a`),j.href=e,j.href},hardwareConcurrency:o.navigator&&o.navigator.hardwareConcurrency||4,get devicePixelRatio(){return o.devicePixelRatio},get prefersReducedMotion(){return!!o.matchMedia&&(M??=o.matchMedia(`(prefers-reduced-motion: reduce)`),M.matches)}},ne={API_URL:`https://api.mapbox.com`,get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf(`https://api.mapbox.cn`)===0?`https://events.mapbox.cn/events/v2`:this.API_URL.indexOf(`https://api.mapbox.com`)===0?`https://events.mapbox.com/events/v2`:null:null},FEEDBACK_URL:`https://apps.mapbox.com/feedback`,REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},re={supported:!1,testSupport:function(e){!ie&&P&&(ae?L(e):N=e)}},ie=!1,ae=!1;function L(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,P),e.isContextLost())return;re.supported=!0}catch{}e.deleteTexture(t),ie=!0}o.document&&((P=o.document.createElement(`img`)).onload=function(){N&&L(N),N=null,ae=!0},P.onerror=function(){ie=!0,N=null},P.src=`data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=`);var oe=`01`,se=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function ce(e){return e.indexOf(`mapbox:`)===0}se.prototype._createSkuToken=function(){var e=function(){for(var e=``,t=0;t<10;t++)e+=`0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`[Math.floor(62*Math.random())];return{token:[`1`,oe,e].join(``),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},se.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},se.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},se.prototype.normalizeStyleURL=function(e,t){if(!ce(e))return e;var n=fe(e);return n.path=`/styles/v1`+n.path,this._makeAPIURL(n,this._customAccessToken||t)},se.prototype.normalizeGlyphsURL=function(e,t){if(!ce(e))return e;var n=fe(e);return n.path=`/fonts/v1`+n.path,this._makeAPIURL(n,this._customAccessToken||t)},se.prototype.normalizeSourceURL=function(e,t){if(!ce(e))return e;var n=fe(e);return n.path=`/v4/`+n.authority+`.json`,n.params.push(`secure`),this._makeAPIURL(n,this._customAccessToken||t)},se.prototype.normalizeSpriteURL=function(e,t,n,r){var i=fe(e);return ce(e)?(i.path=`/styles/v1`+i.path+`/sprite`+t+n,this._makeAPIURL(i,this._customAccessToken||r)):(i.path+=``+t+n,pe(i))},se.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!ce(e))return e;var n=fe(e);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,(te.devicePixelRatio>=2||t===512?`@2x`:``)+(re.supported?`.webp`:`$1`)),n.path=n.path.replace(/^.+\/v4\//,`/`),n.path=`/v4`+n.path;var r=this._customAccessToken||function(e){for(var t=0,n=e;t=0&&e.params.splice(i,1)}if(r.path!==`/`&&(e.path=``+r.path+e.path),!ne.REQUIRE_ACCESS_TOKEN)return pe(e);if(!(t||=ne.ACCESS_TOKEN))throw Error(`An API access token is required to use Mapbox GL. `+n);if(t[0]===`s`)throw Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). `+n);return e.params=e.params.filter((function(e){return e.indexOf(`access_token`)===-1})),e.params.push(`access_token=`+t),pe(e)};var le=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function ue(e){return le.test(e)}var de=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function fe(e){var t=e.match(de);if(!t)throw Error(`Unable to parse URL object`);return{protocol:t[1],authority:t[2],path:t[3]||`/`,params:t[4]?t[4].split(`&`):[]}}function pe(e){var t=e.params.length?`?`+e.params.join(`&`):``;return e.protocol+`://`+e.authority+e.path+t}function me(e){if(!e)return null;var t=e.split(`.`);if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(o.atob(t[1]).split(``).map((function(e){return`%`+(`00`+e.charCodeAt(0).toString(16)).slice(-2)})).join(``)))}catch{return null}}var R=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};R.prototype.getStorageKey=function(e){var t,n=me(ne.ACCESS_TOKEN);return t=n&&n.u?o.btoa(encodeURIComponent(n.u).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode(Number(`0x`+t))}))):ne.ACCESS_TOKEN||``,e?`mapbox.eventData.`+e+`:`+t:`mapbox.eventData:`+t},R.prototype.fetchEventData=function(){var e=A(`localStorage`),t=this.getStorageKey(),n=this.getStorageKey(`uuid`);if(e)try{var r=o.localStorage.getItem(t);r&&(this.eventData=JSON.parse(r));var i=o.localStorage.getItem(n);i&&(this.anonId=i)}catch{C(`Unable to read from LocalStorage`)}},R.prototype.saveEventData=function(){var e=A(`localStorage`),t=this.getStorageKey(),n=this.getStorageKey(`uuid`);if(e)try{o.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&o.localStorage.setItem(t,JSON.stringify(this.eventData))}catch{C(`Unable to write to LocalStorage`)}},R.prototype.processRequests=function(e){},R.prototype.postEvent=function(e,t,n,r){var i=this;if(ne.EVENTS_URL){var a=fe(ne.EVENTS_URL);a.params.push(`access_token=`+(r||ne.ACCESS_TOKEN||``));var o={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:`mapbox-gl-js`,sdkVersion:`1.13.3`,skuId:oe,userId:this.anonId},s=t?f(o,t):o,c={url:pe(a),headers:{"Content-Type":`text/plain`},body:JSON.stringify([s])};this.pendingRequest=Me(c,(function(e){i.pendingRequest=null,n(e),i.saveEventData(),i.processRequests(r)}))}},R.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var z,he,ge=function(e){function t(){e.call(this,`map.load`),this.success={},this.skuToken=``}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postMapLoadEvent=function(e,t,n,r){this.skuToken=n;var i=!(!r&&!ne.ACCESS_TOKEN),a=Array.isArray(e)&&e.some((function(e){return ce(e)||ue(e)}));ne.EVENTS_URL&&i&&a&&this.queueRequest({id:t,timestamp:Date.now()},r)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&this.queue.length!==0){var n=this.queue.shift(),r=n.id,i=n.timestamp;r&&this.success[r]||(this.anonId||this.fetchEventData(),g(this.anonId)||(this.anonId=h()),this.postEvent(i,{skuToken:this.skuToken},(function(e){e||r&&(t.success[r]=!0)}),e))}},t}(R),_e=new(function(e){function t(t){e.call(this,`appUserTurnstile`),this._customAccessToken=t}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postTurnstileEvent=function(e,t){ne.EVENTS_URL&&ne.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return ce(e)||ue(e)}))&&this.queueRequest(Date.now(),t)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var n=me(ne.ACCESS_TOKEN),r=n?n.u:ne.ACCESS_TOKEN,i=r!==this.eventData.tokenU;g(this.anonId)||(this.anonId=h(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),c=(a-this.eventData.lastSuccess)/864e5;i=i||c>=1||c<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(e){e||(t.eventData.lastSuccess=a,t.eventData.tokenU=r)}),e)}},t}(R)),ve=_e.postTurnstileEvent.bind(_e),B=new ge,ye=B.postMapLoadEvent.bind(B),V=500,H=50;function be(){o.caches&&!z&&(z=o.caches.open(`mapbox-tiles`))}function xe(e){var t=e.indexOf(`?`);return t<0?e:e.slice(0,t)}var Se,Ce=1/0;function we(){return Se??=o.OffscreenCanvas&&new o.OffscreenCanvas(1,1).getContext(`2d`)&&typeof o.createImageBitmap==`function`,Se}var Te={Unknown:`Unknown`,Style:`Style`,Source:`Source`,Tile:`Tile`,Glyphs:`Glyphs`,SpriteImage:`SpriteImage`,SpriteJSON:`SpriteJSON`,Image:`Image`};typeof Object.freeze==`function`&&Object.freeze(Te);var Ee=function(e){function t(t,n,r){n===401&&ue(r)&&(t+=`: you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes`),e.call(this,t),this.status=n,this.url=r,this.name=this.constructor.name,this.message=t}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toString=function(){return this.name+`: `+this.message+` (`+this.status+`): `+this.url},t}(Error),De=E()?function(){return self.worker&&self.worker.referrer}:function(){return(o.location.protocol===`blob:`?o.parent:o).location.href},Oe,ke,Ae=function(e,t){if(!(/^file:/.test(n=e.url)||/^file:/.test(De())&&!/^\w+:/.test(n))){if(o.fetch&&o.Request&&o.AbortController&&o.Request.prototype.hasOwnProperty(`signal`))return function(e,t){var n,r=new o.AbortController,i=new o.Request(e.url,{method:e.method||`GET`,body:e.body,credentials:e.credentials,headers:e.headers,referrer:De(),signal:r.signal}),a=!1,s=!1,c=(n=i.url).indexOf(`sku=`)>0&&ue(n);e.type===`json`&&i.headers.set(`Accept`,`application/json`);var l=function(n,r,a){if(!s){if(n&&n.message!==`SecurityError`&&C(n),r&&a)return u(r);var l=Date.now();o.fetch(i).then((function(n){return n.ok?u(n,c?n.clone():null,l):t(new Ee(n.statusText,n.status,e.url))})).catch((function(e){e.code!==20&&t(Error(e.message))}))}},u=function(n,r,c){(e.type===`arrayBuffer`?n.arrayBuffer():e.type===`json`?n.json():n.text()).then((function(e){s||(r&&c&&function(e,t,n){if(be(),z){var r={status:t.status,statusText:t.statusText,headers:new o.Headers};t.headers.forEach((function(e,t){return r.headers.set(t,e)}));var i=D(t.headers.get(`Cache-Control`)||``);i[`no-store`]||(i[`max-age`]&&r.headers.set(`Expires`,new Date(n+1e3*i[`max-age`]).toUTCString()),new Date(r.headers.get(`Expires`)).getTime()-n<42e4||function(e,t){if(he===void 0)try{new Response(new ReadableStream),he=!0}catch{he=!1}he?t(e.body):e.blob().then(t)}(t,(function(t){var n=new o.Response(t,r);be(),z&&z.then((function(t){return t.put(xe(e.url),n)})).catch((function(e){return C(e.message)}))})))}}(i,r,c),a=!0,t(null,e,n.headers.get(`Cache-Control`),n.headers.get(`Expires`)))})).catch((function(e){s||t(Error(e.message))}))};return c?function(e,t){if(be(),!z)return t(null);var n=xe(e.url);z.then((function(e){e.match(n).then((function(r){var i=function(e){if(!e)return!1;var t=new Date(e.headers.get(`Expires`)||0),n=D(e.headers.get(`Cache-Control`)||``);return t>Date.now()&&!n[`no-cache`]}(r);e.delete(n),i&&e.put(n,r.clone()),t(null,r,i)})).catch(t)})).catch(t)}(i,l):l(null,null),{cancel:function(){s=!0,a||r.abort()}}}(e,t);if(E()&&self.worker&&self.worker.actor)return self.worker.actor.send(`getResource`,e,t,void 0,!0)}var n;return function(e,t){var n=new o.XMLHttpRequest;for(var r in n.open(e.method||`GET`,e.url,!0),e.type===`arrayBuffer`&&(n.responseType=`arraybuffer`),e.headers)n.setRequestHeader(r,e.headers[r]);return e.type===`json`&&(n.responseType=`text`,n.setRequestHeader(`Accept`,`application/json`)),n.withCredentials=e.credentials===`include`,n.onerror=function(){t(Error(n.statusText))},n.onload=function(){if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){var r=n.response;if(e.type===`json`)try{r=JSON.parse(n.response)}catch(e){return t(e)}t(null,r,n.getResponseHeader(`Cache-Control`),n.getResponseHeader(`Expires`))}else t(new Ee(n.statusText,n.status,e.url))},n.send(e.body),{cancel:function(){return n.abort()}}}(e,t)},je=function(e,t){return Ae(f(e,{type:`arrayBuffer`}),t)},Me=function(e,t){return Ae(f(e,{method:`POST`}),t)},Ne=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=`;Oe=[],ke=0;var Pe=function(e,t){if(re.supported&&(e.headers||={},e.headers.accept=`image/webp,*/*`),ke>=ne.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return Oe.push(n),n}ke++;var r=!1,i=function(){if(!r)for(r=!0,ke--;Oe.length&&ke0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},Re.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var W={$version:8,$root:{version:{required:!0,type:`enum`,values:[8]},name:{type:`string`},metadata:{type:`*`},center:{type:`array`,value:`number`},zoom:{type:`number`},bearing:{type:`number`,default:0,period:360,units:`degrees`},pitch:{type:`number`,default:0,units:`degrees`},light:{type:`light`},sources:{required:!0,type:`sources`},sprite:{type:`string`},glyphs:{type:`string`},transition:{type:`transition`},layers:{required:!0,type:`array`,value:`layer`}},sources:{"*":{type:`source`}},source:[`source_vector`,`source_raster`,`source_raster_dem`,`source_geojson`,`source_video`,`source_image`],source_vector:{type:{required:!0,type:`enum`,values:{vector:{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:`enum`,values:{xyz:{},tms:{}},default:`xyz`},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},attribution:{type:`string`},promoteId:{type:`promoteId`},volatile:{type:`boolean`,default:!1},"*":{type:`*`}},source_raster:{type:{required:!0,type:`enum`,values:{raster:{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},tileSize:{type:`number`,default:512,units:`pixels`},scheme:{type:`enum`,values:{xyz:{},tms:{}},default:`xyz`},attribution:{type:`string`},volatile:{type:`boolean`,default:!1},"*":{type:`*`}},source_raster_dem:{type:{required:!0,type:`enum`,values:{"raster-dem":{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},tileSize:{type:`number`,default:512,units:`pixels`},attribution:{type:`string`},encoding:{type:`enum`,values:{terrarium:{},mapbox:{}},default:`mapbox`},volatile:{type:`boolean`,default:!1},"*":{type:`*`}},source_geojson:{type:{required:!0,type:`enum`,values:{geojson:{}}},data:{type:`*`},maxzoom:{type:`number`,default:18},attribution:{type:`string`},buffer:{type:`number`,default:128,maximum:512,minimum:0},filter:{type:`*`},tolerance:{type:`number`,default:.375},cluster:{type:`boolean`,default:!1},clusterRadius:{type:`number`,default:50,minimum:0},clusterMaxZoom:{type:`number`},clusterMinPoints:{type:`number`},clusterProperties:{type:`*`},lineMetrics:{type:`boolean`,default:!1},generateId:{type:`boolean`,default:!1},promoteId:{type:`promoteId`}},source_video:{type:{required:!0,type:`enum`,values:{video:{}}},urls:{required:!0,type:`array`,value:`string`},coordinates:{required:!0,type:`array`,length:4,value:{type:`array`,length:2,value:`number`}}},source_image:{type:{required:!0,type:`enum`,values:{image:{}}},url:{required:!0,type:`string`},coordinates:{required:!0,type:`array`,length:4,value:{type:`array`,length:2,value:`number`}}},layer:{id:{type:`string`,required:!0},type:{type:`enum`,values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:`*`},source:{type:`string`},"source-layer":{type:`string`},minzoom:{type:`number`,minimum:0,maximum:24},maxzoom:{type:`number`,minimum:0,maximum:24},filter:{type:`filter`},layout:{type:`layout`},paint:{type:`paint`}},layout:[`layout_fill`,`layout_line`,`layout_circle`,`layout_heatmap`,`layout_fill-extrusion`,`layout_symbol`,`layout_raster`,`layout_hillshade`,`layout_background`],layout_background:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},layout_fill:{"fill-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},layout_circle:{"circle-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},layout_heatmap:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},"layout_fill-extrusion":{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},layout_line:{"line-cap":{type:`enum`,values:{butt:{},round:{},square:{}},default:`butt`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"line-join":{type:`enum`,values:{bevel:{},round:{},miter:{}},default:`miter`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"line-miter-limit":{type:`number`,default:2,requires:[{"line-join":`miter`}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"line-round-limit":{type:`number`,default:1.05,requires:[{"line-join":`round`}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"line-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},layout_symbol:{"symbol-placement":{type:`enum`,values:{point:{},line:{},"line-center":{}},default:`point`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-spacing":{type:`number`,default:250,minimum:1,units:`pixels`,requires:[{"symbol-placement":`line`}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-avoid-edges":{type:`boolean`,default:!1,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"symbol-z-order":{type:`enum`,values:{auto:{},"viewport-y":{},source:{}},default:`auto`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-allow-overlap":{type:`boolean`,default:!1,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-ignore-placement":{type:`boolean`,default:!1,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-optional":{type:`boolean`,default:!1,requires:[`icon-image`,`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-rotation-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-size":{type:`number`,default:1,minimum:0,units:`factor of the original icon size`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-text-fit":{type:`enum`,values:{none:{},width:{},height:{},both:{}},default:`none`,requires:[`icon-image`,`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-text-fit-padding":{type:`array`,value:`number`,length:4,default:[0,0,0,0],units:`pixels`,requires:[`icon-image`,`text-field`,{"icon-text-fit":[`both`,`width`,`height`]}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"icon-image":{type:`resolvedImage`,tokens:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-rotate":{type:`number`,default:0,period:360,units:`degrees`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-padding":{type:`number`,default:2,minimum:0,units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"icon-keep-upright":{type:`boolean`,default:!1,requires:[`icon-image`,{"icon-rotation-alignment":`map`},{"symbol-placement":[`line`,`line-center`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-offset":{type:`array`,value:`number`,length:2,default:[0,0],requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-anchor":{type:`enum`,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:`center`,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-pitch-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-pitch-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-rotation-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-field":{type:`formatted`,default:``,tokens:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-font":{type:`array`,value:`string`,default:[`Open Sans Regular`,`Arial Unicode MS Regular`],requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-size":{type:`number`,default:16,minimum:0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-max-width":{type:`number`,default:10,minimum:0,units:`ems`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-line-height":{type:`number`,default:1.2,units:`ems`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-letter-spacing":{type:`number`,default:0,units:`ems`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-justify":{type:`enum`,values:{auto:{},left:{},center:{},right:{}},default:`center`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-radial-offset":{type:`number`,units:`ems`,default:0,requires:[`text-field`],"property-type":`data-driven`,expression:{interpolated:!0,parameters:[`zoom`,`feature`]}},"text-variable-anchor":{type:`array`,value:`enum`,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:[`text-field`,{"symbol-placement":[`point`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-anchor":{type:`enum`,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:`center`,requires:[`text-field`,{"!":`text-variable-anchor`}],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-max-angle":{type:`number`,default:45,units:`degrees`,requires:[`text-field`,{"symbol-placement":[`line`,`line-center`]}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-writing-mode":{type:`array`,value:`enum`,values:{horizontal:{},vertical:{}},requires:[`text-field`,{"symbol-placement":[`point`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-rotate":{type:`number`,default:0,period:360,units:`degrees`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-padding":{type:`number`,default:2,minimum:0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-keep-upright":{type:`boolean`,default:!0,requires:[`text-field`,{"text-rotation-alignment":`map`},{"symbol-placement":[`line`,`line-center`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-transform":{type:`enum`,values:{none:{},uppercase:{},lowercase:{}},default:`none`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-offset":{type:`array`,value:`number`,units:`ems`,length:2,default:[0,0],requires:[`text-field`,{"!":`text-radial-offset`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-allow-overlap":{type:`boolean`,default:!1,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-ignore-placement":{type:`boolean`,default:!1,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-optional":{type:`boolean`,default:!1,requires:[`text-field`,`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},layout_raster:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},layout_hillshade:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},filter:{type:`array`,value:`*`},filter_operator:{type:`enum`,values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:`enum`,values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:`expression`},stops:{type:`array`,value:`function_stop`},base:{type:`number`,default:1,minimum:0},property:{type:`string`,default:`$zoom`},type:{type:`enum`,values:{identity:{},exponential:{},interval:{},categorical:{}},default:`exponential`},colorSpace:{type:`enum`,values:{rgb:{},lab:{},hcl:{}},default:`rgb`},default:{type:`*`,required:!1}},function_stop:{type:`array`,minimum:0,maximum:24,value:[`number`,`color`],length:2},expression:{type:`array`,value:`*`,minimum:1},light:{anchor:{type:`enum`,default:`viewport`,values:{map:{},viewport:{}},"property-type":`data-constant`,transition:!1,expression:{interpolated:!1,parameters:[`zoom`]}},position:{type:`array`,default:[1.15,210,30],length:3,value:`number`,"property-type":`data-constant`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]}},color:{type:`color`,"property-type":`data-constant`,default:`#ffffff`,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},intensity:{type:`number`,"property-type":`data-constant`,default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0}},paint:[`paint_fill`,`paint_line`,`paint_circle`,`paint_heatmap`,`paint_fill-extrusion`,`paint_symbol`,`paint_raster`,`paint_hillshade`,`paint_background`],paint_fill:{"fill-antialias":{type:`boolean`,default:!0,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"fill-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-color":{type:`color`,default:`#000000`,transition:!0,requires:[{"!":`fill-pattern`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-outline-color":{type:`color`,transition:!0,requires:[{"!":`fill-pattern`},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"fill-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`fill-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"fill-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`cross-faded-data-driven`}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"fill-extrusion-color":{type:`color`,default:`#000000`,transition:!0,requires:[{"!":`fill-extrusion-pattern`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-extrusion-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"fill-extrusion-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`fill-extrusion-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"fill-extrusion-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`cross-faded-data-driven`},"fill-extrusion-height":{type:`number`,default:0,minimum:0,units:`meters`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-extrusion-base":{type:`number`,default:0,minimum:0,units:`meters`,transition:!0,requires:[`fill-extrusion-height`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-extrusion-vertical-gradient":{type:`boolean`,default:!0,transition:!1,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},paint_line:{"line-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-color":{type:`color`,default:`#000000`,transition:!0,requires:[{"!":`line-pattern`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"line-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`line-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"line-width":{type:`number`,default:1,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-gap-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-offset":{type:`number`,default:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-blur":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-dasharray":{type:`array`,value:`number`,minimum:0,transition:!0,units:`line widths`,requires:[{"!":`line-pattern`}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`cross-faded`},"line-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`cross-faded-data-driven`},"line-gradient":{type:`color`,transition:!1,requires:[{"!":`line-dasharray`},{"!":`line-pattern`},{source:`geojson`,has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:[`line-progress`]},"property-type":`color-ramp`}},paint_circle:{"circle-radius":{type:`number`,default:5,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-blur":{type:`number`,default:0,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"circle-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`circle-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"circle-pitch-scale":{type:`enum`,values:{map:{},viewport:{}},default:`map`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"circle-pitch-alignment":{type:`enum`,values:{map:{},viewport:{}},default:`viewport`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"circle-stroke-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-stroke-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-stroke-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`}},paint_heatmap:{"heatmap-radius":{type:`number`,default:30,minimum:1,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"heatmap-weight":{type:`number`,default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"heatmap-intensity":{type:`number`,default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"heatmap-color":{type:`color`,default:[`interpolate`,[`linear`],[`heatmap-density`],0,`rgba(0, 0, 255, 0)`,.1,`royalblue`,.3,`cyan`,.5,`lime`,.7,`yellow`,1,`red`],transition:!1,expression:{interpolated:!0,parameters:[`heatmap-density`]},"property-type":`color-ramp`},"heatmap-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},paint_symbol:{"icon-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-color":{type:`color`,default:`#000000`,transition:!0,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-halo-color":{type:`color`,default:`rgba(0, 0, 0, 0)`,transition:!0,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-halo-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-halo-blur":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"icon-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`icon-image`,`icon-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-color":{type:`color`,default:`#000000`,transition:!0,overridable:!0,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-halo-color":{type:`color`,default:`rgba(0, 0, 0, 0)`,transition:!0,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-halo-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-halo-blur":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`text-field`,`text-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},paint_raster:{"raster-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-hue-rotate":{type:`number`,default:0,period:360,transition:!0,units:`degrees`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-brightness-min":{type:`number`,default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-brightness-max":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-saturation":{type:`number`,default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-contrast":{type:`number`,default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-resampling":{type:`enum`,values:{linear:{},nearest:{}},default:`linear`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"raster-fade-duration":{type:`number`,default:300,minimum:0,transition:!1,units:`milliseconds`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},paint_hillshade:{"hillshade-illumination-direction":{type:`number`,default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-illumination-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`viewport`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-exaggeration":{type:`number`,default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-shadow-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-highlight-color":{type:`color`,default:`#FFFFFF`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-accent-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},paint_background:{"background-color":{type:`color`,default:`#000000`,transition:!0,requires:[{"!":`background-pattern`}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"background-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`cross-faded`},"background-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},transition:{duration:{type:`number`,default:300,minimum:0,units:`milliseconds`},delay:{type:`number`,default:0,minimum:0,units:`milliseconds`}},"property-type":{"data-driven":{type:`property-type`},"cross-faded":{type:`property-type`},"cross-faded-data-driven":{type:`property-type`},"color-ramp":{type:`property-type`},"data-constant":{type:`property-type`},constant:{type:`property-type`}},promoteId:{"*":{type:`string`}}},ze=function(e,t,n,r){this.message=(e?e+`: `:``)+n,r&&(this.identifier=r),t!=null&&t.__line__&&(this.line=t.__line__)};function Be(e){var t=e.value;return t?[new ze(e.key,t,`constants have been deprecated as of v8`)]:[]}function Ve(e){for(var t=[],n=arguments.length-1;n-->0;)t[n]=arguments[n+1];for(var r=0,i=t;r`:e.itemType.kind===`value`?`array`:`array<`+t+`>`}return e.kind}var rt=[Ke,G,qe,Je,Ye,$e,Xe,tt(Ze),et];function it(e,t){if(t.kind===`error`)return null;if(e.kind===`array`){if(t.kind===`array`&&(t.N===0&&t.itemType.kind===`value`||!it(e.itemType,t.itemType))&&(typeof e.N!=`number`||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind===`value`){for(var n=0,r=rt;n255?255:e}function i(e){return r(e[e.length-1]===`%`?parseFloat(e)/100*255:parseInt(e))}function a(e){return(t=e[e.length-1]===`%`?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function o(e,t,n){return n<0?n+=1:n>1&&--n,6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}try{t.parseCSSColor=function(e){var t,s=e.replace(/ /g,``).toLowerCase();if(s in n)return n[s].slice();if(s[0]===`#`)return s.length===4?(t=parseInt(s.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:s.length===7&&(t=parseInt(s.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var c=s.indexOf(`(`),l=s.indexOf(`)`);if(c!==-1&&l+1===s.length){var u=s.substr(0,c),d=s.substr(c+1,l-(c+1)).split(`,`),f=1;switch(u){case`rgba`:if(d.length!==4)return null;f=a(d.pop());case`rgb`:return d.length===3?[i(d[0]),i(d[1]),i(d[2]),f]:null;case`hsla`:if(d.length!==4)return null;f=a(d.pop());case`hsl`:if(d.length!==3)return null;var p=(parseFloat(d[0])%360+360)%360/360,m=a(d[1]),h=a(d[2]),g=h<=.5?h*(m+1):h+m-h*m,_=2*h-g;return[r(255*o(_,g,p+1/3)),r(255*o(_,g,p)),r(255*o(_,g,p-1/3)),f];default:return null}}return null}}catch{}})).parseCSSColor,ct=function(e,t,n,r){r===void 0&&(r=1),this.r=e,this.g=t,this.b=n,this.a=r};ct.parse=function(e){if(e){if(e instanceof ct)return e;if(typeof e==`string`){var t=st(e);if(t)return new ct(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},ct.prototype.toString=function(){var e=this.toArray(),t=e[1],n=e[2],r=e[3];return`rgba(`+Math.round(e[0])+`,`+Math.round(t)+`,`+Math.round(n)+`,`+r+`)`},ct.prototype.toArray=function(){var e=this.a;return e===0?[0,0,0,0]:[255*this.r/e,255*this.g/e,255*this.b/e,e]},ct.black=new ct(0,0,0,1),ct.white=new ct(1,1,1,1),ct.transparent=new ct(0,0,0,0),ct.red=new ct(1,0,0,1);var lt=function(e,t,n){this.sensitivity=e?t?`variant`:`case`:t?`accent`:`base`,this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:`search`})};lt.prototype.compare=function(e,t){return this.collator.compare(e,t)},lt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ut=function(e,t,n,r,i){this.text=e,this.image=t,this.scale=n,this.fontStack=r,this.textColor=i},dt=function(e){this.sections=e};dt.fromString=function(e){return new dt([new ut(e,null,null,null,null)])},dt.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some((function(e){return e.text.length!==0||e.image&&e.image.name.length!==0}))},dt.factory=function(e){return e instanceof dt?e:dt.fromString(e)},dt.prototype.toString=function(){return this.sections.length===0?``:this.sections.map((function(e){return e.text})).join(``)},dt.prototype.serialize=function(){for(var e=[`format`],t=0,n=this.sections;t=0&&e<=255&&typeof t==`number`&&t>=0&&t<=255&&typeof n==`number`&&n>=0&&n<=255?r===void 0||typeof r==`number`&&r>=0&&r<=1?null:`Invalid rgba value [`+[e,t,n,r].join(`, `)+`]: 'a' must be between 0 and 1.`:`Invalid rgba value [`+(typeof r==`number`?[e,t,n,r]:[e,t,n]).join(`, `)+`]: 'r', 'g', and 'b' must be between 0 and 255.`}function mt(e){if(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||e instanceof ct||e instanceof lt||e instanceof dt||e instanceof ft)return!0;if(Array.isArray(e)){for(var t=0,n=e;t2){var s=e[1];if(typeof s!=`string`||!(s in yt)||s===`object`)return t.error(`The item type argument of "array" must be one of string, number, boolean`,1);a=yt[s],r++}else a=Ze;if(e.length>3){if(e[2]!==null&&(typeof e[2]!=`number`||e[2]<0||e[2]!==Math.floor(e[2])))return t.error(`The length argument to "array" must be a positive integer literal`,2);o=e[2],r++}n=tt(a,o)}else n=yt[i];for(var c=[];r1)&&t.push(r)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var xt=function(e){this.type=$e,this.sections=e};xt.parse=function(e,t){if(e.length<2)return t.error(`Expected at least one argument.`);var n=e[1];if(!Array.isArray(n)&&typeof n==`object`)return t.error(`First argument must be an image or text section.`);for(var r=[],i=!1,a=1;a<=e.length-1;++a){var o=e[a];if(i&&typeof o==`object`&&!Array.isArray(o)){i=!1;var s=null;if(o[`font-scale`]&&!(s=t.parse(o[`font-scale`],1,G)))return null;var c=null;if(o[`text-font`]&&!(c=t.parse(o[`text-font`],1,tt(qe))))return null;var l=null;if(o[`text-color`]&&!(l=t.parse(o[`text-color`],1,Ye)))return null;var u=r[r.length-1];u.scale=s,u.font=c,u.textColor=l}else{var d=t.parse(e[a],1,Ze);if(!d)return null;var f=d.type.kind;if(f!==`string`&&f!==`value`&&f!==`null`&&f!==`resolvedImage`)return t.error(`Formatted text type must be 'string', 'value', 'image' or 'null'.`);i=!0,r.push({content:d,scale:null,font:null,textColor:null})}}return new xt(r)},xt.prototype.evaluate=function(e){return new dt(this.sections.map((function(t){var n=t.content.evaluate(e);return ht(n)===et?new ut(``,n,null,null,null):new ut(gt(n),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(`,`):null,t.textColor?t.textColor.evaluate(e):null)})))},xt.prototype.eachChild=function(e){for(var t=0,n=this.sections;t-1),n},St.prototype.eachChild=function(e){e(this.input)},St.prototype.outputDefined=function(){return!1},St.prototype.serialize=function(){return[`image`,this.input.serialize()]};var Ct={"to-boolean":Je,"to-color":Ye,"to-number":G,"to-string":qe},wt=function(e,t){this.type=e,this.args=t};wt.parse=function(e,t){if(e.length<2)return t.error(`Expected at least one argument.`);var n=e[0];if((n===`to-boolean`||n===`to-string`)&&e.length!==2)return t.error(`Expected one argument.`);for(var r=Ct[n],i=[],a=1;a4?`Invalid rbga value `+JSON.stringify(t)+`: expected an array containing either three or four numeric values.`:pt(t[0],t[1],t[2],t[3])))return new ct(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new vt(n||`Could not parse color from value '`+(typeof t==`string`?t:String(JSON.stringify(t)))+`'`)}if(this.type.kind===`number`){for(var o=null,s=0,c=this.args;s=t[2]||e[1]<=t[1]||e[3]>=t[3])}function jt(e,t){var n=(180+e[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=2**t.z;return[Math.round(n*i*8192),Math.round(r*i*8192)]}function Mt(e,t,n){return t[1]>e[1]!=n[1]>e[1]&&e[0]<(n[0]-t[0])*(e[1]-t[1])/(n[1]-t[1])+t[0]}function Nt(e,t){for(var n,r,i,a,o,s,c,l=!1,u=0,d=t.length;u0&&s<0||o<0&&s>0}function It(e,t,n){for(var r=0,i=n;rn[2]){var i=.5*r,a=e[0]-n[0]>i?-r:n[0]-e[0]>i?r:0;a===0&&(a=e[0]-n[2]>i?-r:n[2]-e[0]>i?r:0),e[0]+=a}kt(t,e)}function Ht(e,t,n,r){for(var i=8192*2**r.z,a=[8192*r.x,8192*r.y],o=[],s=0,c=e;s=0)return!1;var n=!0;return e.eachChild((function(e){n&&!qt(e,t)&&(n=!1)})),n}Wt.parse=function(e,t){if(e.length!==2)return t.error(`'within' expression requires exactly one argument, but found `+(e.length-1)+` instead.`);if(mt(e[1])){var n=e[1];if(n.type===`FeatureCollection`)for(var r=0;rt))throw new vt(`Input is not a number.`);a=o-1}return 0}Yt.prototype.parse=function(e,t,n,r,i){return i===void 0&&(i={}),t?this.concat(t,n,r)._parse(e,i):this._parse(e,i)},Yt.prototype._parse=function(e,t){function n(e,t,n){return n===`assert`?new bt(t,[e]):n===`coerce`?new wt(t,[e]):e}if(e!==null&&typeof e!=`string`&&typeof e!=`boolean`&&typeof e!=`number`||(e=[`literal`,e]),Array.isArray(e)){if(e.length===0)return this.error(`Expected an array with at least one element. If you wanted a literal array, use ["literal", []].`);var r=e[0];if(typeof r!=`string`)return this.error(`Expression name must be a string, but found `+typeof r+` instead. If you wanted a literal array, use ["literal", [...]].`,0),null;var i=this.registry[r];if(i){var a=i.parse(e,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if(o.kind!==`string`&&o.kind!==`number`&&o.kind!==`boolean`&&o.kind!==`object`&&o.kind!==`array`||s.kind!==`value`)if(o.kind!==`color`&&o.kind!==`formatted`&&o.kind!==`resolvedImage`||s.kind!==`value`&&s.kind!==`string`){if(this.checkSubtype(o,s))return null}else a=n(a,o,t.typeAnnotation||`coerce`);else a=n(a,o,t.typeAnnotation||`assert`)}if(!(a instanceof _t)&&a.type.kind!==`resolvedImage`&&function e(t){if(t instanceof Jt)return e(t.boundExpression);if(t instanceof Dt&&t.name===`error`||t instanceof Ot||t instanceof Wt)return!1;var n=t instanceof wt||t instanceof bt,r=!0;return t.eachChild((function(t){r=n?r&&e(t):r&&t instanceof _t})),!!r&&Gt(t)&&qt(t,[`zoom`,`heatmap-density`,`line-progress`,`accumulated`,`is-supported-script`])}(a)){var c=new Et;try{a=new _t(a.type,a.evaluate(c))}catch(e){return this.error(e.message),null}}return a}return this.error(`Unknown expression "`+r+`". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?`'undefined' value invalid. Use null instead.`:typeof e==`object`?`Bare objects invalid. Use ["literal", {...}] instead.`:`Expected an array, but found `+typeof e+` instead.`)},Yt.prototype.concat=function(e,t,n){var r=typeof e==`number`?this.path.concat(e):this.path,i=n?this.scope.concat(n):this.scope;return new Yt(this.registry,r,t||null,i,this.errors)},Yt.prototype.error=function(e){for(var t=[],n=arguments.length-1;n-->0;)t[n]=arguments[n+1];var r=``+this.key+t.map((function(e){return`[`+e+`]`})).join(``);this.errors.push(new We(r,e))},Yt.prototype.checkSubtype=function(e,t){var n=it(e,t);return n&&this.error(n),n};var Zt=function(e,t,n){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var r=0,i=n;r=o)return t.error(`Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.`,c);var u=t.parse(s,l,i);if(!u)return null;i||=u.type,r.push([o,u])}return new Zt(i,n,r)},Zt.prototype.evaluate=function(e){var t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);var i=t.length;return r>=t[i-1]?n[i-1].evaluate(e):n[Xt(t,r)].evaluate(e)},Zt.prototype.eachChild=function(e){e(this.input);for(var t=0,n=this.outputs;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var $t=Object.freeze({__proto__:null,number:Qt,color:function(e,t,n){return new ct(Qt(e.r,t.r,n),Qt(e.g,t.g,n),Qt(e.b,t.b,n),Qt(e.a,t.a,n))},array:function(e,t,n){return e.map((function(e,r){return Qt(e,t[r],n)}))}}),en=6/29*3*(6/29),tn=Math.PI/180,nn=180/Math.PI;function rn(e){return e>.008856451679035631?e**(1/3):e/en+4/29}function an(e){return e>6/29?e*e*e:en*(e-4/29)}function on(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function sn(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function cn(e){var t=sn(e.r),n=sn(e.g),r=sn(e.b),i=rn((.4124564*t+.3575761*n+.1804375*r)/.95047),a=rn((.2126729*t+.7151522*n+.072175*r)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-rn((.0193339*t+.119192*n+.9503041*r)/1.08883)),alpha:e.a}}function ln(e){var t=(e.l+16)/116,n=isNaN(e.a)?t:t+e.a/500,r=isNaN(e.b)?t:t-e.b/200;return t=1*an(t),n=.95047*an(n),r=1.08883*an(r),new ct(on(3.2404542*n-1.5371385*t-.4985314*r),on(-.969266*n+1.8760108*t+.041556*r),on(.0556434*n-.2040259*t+1.0572252*r),e.alpha)}function un(e,t,n){var r=t-e;return e+n*(r>180||r<-180?r-360*Math.round(r/360):r)}var dn={forward:cn,reverse:ln,interpolate:function(e,t,n){return{l:Qt(e.l,t.l,n),a:Qt(e.a,t.a,n),b:Qt(e.b,t.b,n),alpha:Qt(e.alpha,t.alpha,n)}}},fn={forward:function(e){var t=cn(e),n=t.l,r=t.a,i=t.b,a=Math.atan2(i,r)*nn;return{h:a<0?a+360:a,c:Math.sqrt(r*r+i*i),l:n,alpha:e.a}},reverse:function(e){var t=e.h*tn,n=e.c;return ln({l:e.l,a:Math.cos(t)*n,b:Math.sin(t)*n,alpha:e.alpha})},interpolate:function(e,t,n){return{h:un(e.h,t.h,n),c:Qt(e.c,t.c,n),l:Qt(e.l,t.l,n),alpha:Qt(e.alpha,t.alpha,n)}}},pn=Object.freeze({__proto__:null,lab:dn,hcl:fn}),mn=function(e,t,n,r,i){this.type=e,this.operator=t,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(var a=0,o=i;a1})))return t.error(`Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.`,1);r={name:`cubic-bezier`,controlPoints:s}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only `+(e.length-1)+`.`);if((e.length-1)%2!=0)return t.error(`Expected an even number of arguments.`);if(!(i=t.parse(i,2,G)))return null;var c=[],l=null;n===`interpolate-hcl`||n===`interpolate-lab`?l=Ye:t.expectedType&&t.expectedType.kind!==`value`&&(l=t.expectedType);for(var u=0;u=d)return t.error(`Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.`,p);var h=t.parse(f,m,l);if(!h)return null;l||=h.type,c.push([d,h])}return l.kind===`number`||l.kind===`color`||l.kind===`array`&&l.itemType.kind===`number`&&typeof l.N==`number`?new mn(l,n,r,i,c):t.error(`Type `+nt(l)+` is not interpolatable.`)},mn.prototype.evaluate=function(e){var t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);var i=t.length;if(r>=t[i-1])return n[i-1].evaluate(e);var a=Xt(t,r),o=mn.interpolationFactor(this.interpolation,r,t[a],t[a+1]),s=n[a].evaluate(e),c=n[a+1].evaluate(e);return this.operator===`interpolate`?$t[this.type.kind.toLowerCase()](s,c,o):this.operator===`interpolate-hcl`?fn.reverse(fn.interpolate(fn.forward(s),fn.forward(c),o)):dn.reverse(dn.interpolate(dn.forward(s),dn.forward(c),o))},mn.prototype.eachChild=function(e){e(this.input);for(var t=0,n=this.outputs;t=n.length)throw new vt(`Array index out of bounds: `+t+` > `+(n.length-1)+`.`);if(t!==Math.floor(t))throw new vt(`Array index must be an integer, but found `+t+` instead.`);return n[t]},vn.prototype.eachChild=function(e){e(this.index),e(this.input)},vn.prototype.outputDefined=function(){return!1},vn.prototype.serialize=function(){return[`at`,this.index.serialize(),this.input.serialize()]};var yn=function(e,t){this.type=Je,this.needle=e,this.haystack=t};yn.parse=function(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found `+(e.length-1)+` instead.`);var n=t.parse(e[1],1,Ze),r=t.parse(e[2],2,Ze);return n&&r?at(n.type,[Je,qe,G,Ke,Ze])?new yn(n,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found `+nt(n.type)+` instead`):null},yn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!ot(t,[`boolean`,`string`,`number`,`null`]))throw new vt(`Expected first argument to be of type boolean, string, number or null, but found `+nt(ht(t))+` instead.`);if(!ot(n,[`string`,`array`]))throw new vt(`Expected second argument to be of type array or string, but found `+nt(ht(n))+` instead.`);return n.indexOf(t)>=0},yn.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},yn.prototype.outputDefined=function(){return!0},yn.prototype.serialize=function(){return[`in`,this.needle.serialize(),this.haystack.serialize()]};var bn=function(e,t,n){this.type=G,this.needle=e,this.haystack=t,this.fromIndex=n};bn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found `+(e.length-1)+` instead.`);var n=t.parse(e[1],1,Ze),r=t.parse(e[2],2,Ze);if(!n||!r)return null;if(!at(n.type,[Je,qe,G,Ke,Ze]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found `+nt(n.type)+` instead`);if(e.length===4){var i=t.parse(e[3],3,G);return i?new bn(n,r,i):null}return new bn(n,r)},bn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!ot(t,[`boolean`,`string`,`number`,`null`]))throw new vt(`Expected first argument to be of type boolean, string, number or null, but found `+nt(ht(t))+` instead.`);if(!ot(n,[`string`,`array`]))throw new vt(`Expected second argument to be of type array or string, but found `+nt(ht(n))+` instead.`);if(this.fromIndex){var r=this.fromIndex.evaluate(e);return n.indexOf(t,r)}return n.indexOf(t)},bn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},bn.prototype.outputDefined=function(){return!1},bn.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var e=this.fromIndex.serialize();return[`index-of`,this.needle.serialize(),this.haystack.serialize(),e]}return[`index-of`,this.needle.serialize(),this.haystack.serialize()]};var xn=function(e,t,n,r,i,a){this.inputType=e,this.type=t,this.input=n,this.cases=r,this.outputs=i,this.otherwise=a};xn.parse=function(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only `+(e.length-1)+`.`);if(e.length%2!=1)return t.error(`Expected an even number of arguments.`);var n,r;t.expectedType&&t.expectedType.kind!==`value`&&(r=t.expectedType);for(var i={},a=[],o=2;o2**53-1)return l.error(`Branch labels must be integers no larger than `+(2**53-1)+`.`);if(typeof f==`number`&&Math.floor(f)!==f)return l.error(`Numeric branch labels must be integer values.`);if(n){if(l.checkSubtype(n,ht(f)))return null}else n=ht(f);if(i[String(f)]!==void 0)return l.error(`Branch labels must be unique.`);i[String(f)]=a.length}var p=t.parse(c,o,r);if(!p)return null;r||=p.type,a.push(p)}var m=t.parse(e[1],1,Ze);if(!m)return null;var h=t.parse(e[e.length-1],e.length-1,r);return h?m.type.kind!==`value`&&t.concat(1).checkSubtype(n,m.type)?null:new xn(n,r,m,i,a,h):null},xn.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(ht(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},xn.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},xn.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},xn.prototype.serialize=function(){for(var e=this,t=[`match`,this.input.serialize()],n=[],r={},i=0,a=Object.keys(this.cases).sort();i=5)return t.error(`Expected 3 or 4 arguments, but found `+(e.length-1)+` instead.`);var n=t.parse(e[1],1,Ze),r=t.parse(e[2],2,G);if(!n||!r)return null;if(!at(n.type,[tt(Ze),qe,Ze]))return t.error(`Expected first argument to be of type array or string, but found `+nt(n.type)+` instead`);if(e.length===4){var i=t.parse(e[3],3,G);return i?new Cn(n.type,n,r,i):null}return new Cn(n.type,n,r)},Cn.prototype.evaluate=function(e){var t=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(!ot(t,[`string`,`array`]))throw new vt(`Expected first argument to be of type array or string, but found `+nt(ht(t))+` instead.`);if(this.endIndex){var r=this.endIndex.evaluate(e);return t.slice(n,r)}return t.slice(n)},Cn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Cn.prototype.outputDefined=function(){return!1},Cn.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var e=this.endIndex.serialize();return[`slice`,this.input.serialize(),this.beginIndex.serialize(),e]}return[`slice`,this.input.serialize(),this.beginIndex.serialize()]};var Dn=En(`==`,(function(e,t,n){return t===n}),Tn),On=En(`!=`,(function(e,t,n){return t!==n}),(function(e,t,n,r){return!Tn(0,t,n,r)})),kn=En(`<`,(function(e,t,n){return t`,(function(e,t,n){return t>n}),(function(e,t,n,r){return r.compare(t,n)>0})),jn=En(`<=`,(function(e,t,n){return t<=n}),(function(e,t,n,r){return r.compare(t,n)<=0})),Mn=En(`>=`,(function(e,t,n){return t>=n}),(function(e,t,n,r){return r.compare(t,n)>=0})),Nn=function(e,t,n,r,i){this.type=qe,this.number=e,this.locale=t,this.currency=n,this.minFractionDigits=r,this.maxFractionDigits=i};Nn.parse=function(e,t){if(e.length!==3)return t.error(`Expected two arguments.`);var n=t.parse(e[1],1,G);if(!n)return null;var r=e[2];if(typeof r!=`object`||Array.isArray(r))return t.error(`NumberFormat options argument must be an object.`);var i=null;if(r.locale&&!(i=t.parse(r.locale,1,qe)))return null;var a=null;if(r.currency&&!(a=t.parse(r.currency,1,qe)))return null;var o=null;if(r[`min-fraction-digits`]&&!(o=t.parse(r[`min-fraction-digits`],1,G)))return null;var s=null;return r[`max-fraction-digits`]&&!(s=t.parse(r[`max-fraction-digits`],1,G))?null:new Nn(n,i,a,o,s)},Nn.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?`currency`:`decimal`,currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},Nn.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},Nn.prototype.outputDefined=function(){return!1},Nn.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e[`min-fraction-digits`]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e[`max-fraction-digits`]=this.maxFractionDigits.serialize()),[`number-format`,this.number.serialize(),e]};var Pn=function(e){this.type=G,this.input=e};Pn.parse=function(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found `+(e.length-1)+` instead.`);var n=t.parse(e[1],1);return n?n.type.kind!==`array`&&n.type.kind!==`string`&&n.type.kind!==`value`?t.error(`Expected argument of type string or array, but found `+nt(n.type)+` instead.`):new Pn(n):null},Pn.prototype.evaluate=function(e){var t=this.input.evaluate(e);if(typeof t==`string`||Array.isArray(t))return t.length;throw new vt(`Expected value to be of type string or array, but found `+nt(ht(t))+` instead.`)},Pn.prototype.eachChild=function(e){e(this.input)},Pn.prototype.outputDefined=function(){return!1},Pn.prototype.serialize=function(){var e=[`length`];return this.eachChild((function(t){e.push(t.serialize())})),e};var Fn={"==":Dn,"!=":On,">":An,"<":kn,">=":Mn,"<=":jn,array:bt,at:vn,boolean:bt,case:Sn,coalesce:gn,collator:Ot,format:xt,image:St,in:yn,"index-of":bn,interpolate:mn,"interpolate-hcl":mn,"interpolate-lab":mn,length:Pn,let:_n,literal:_t,match:xn,number:bt,"number-format":Nn,object:bt,slice:Cn,step:Zt,string:bt,"to-boolean":wt,"to-color":wt,"to-number":wt,"to-string":wt,var:Jt,within:Wt};function In(e,t){var n=t[0],r=t[1],i=t[2],a=t[3];n=n.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);var o=a?a.evaluate(e):1,s=pt(n,r,i,o);if(s)throw new vt(s);return new ct(n/255*o,r/255*o,i/255*o,o)}function Ln(e,t){return e in t}function Rn(e,t){var n=t[e];return n===void 0?null:n}function zn(e){return{type:e}}function Bn(e){return{result:`success`,value:e}}function Vn(e){return{result:`error`,value:e}}function Hn(e){return e[`property-type`]===`data-driven`||e[`property-type`]===`cross-faded-data-driven`}function Un(e){return!!e.expression&&e.expression.parameters.indexOf(`zoom`)>-1}function Wn(e){return!!e.expression&&e.expression.interpolated}function Gn(e){return e instanceof Number?`number`:e instanceof String?`string`:e instanceof Boolean?`boolean`:Array.isArray(e)?`array`:e===null?`null`:typeof e}function Kn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function qn(e){return e}function Jn(e,t,n){return e===void 0?t===void 0?n===void 0?void 0:n:t:e}function Yn(e,t,n,r,i){return Jn(typeof n===i?r[n]:void 0,e.default,t.default)}function Xn(e,t,n){if(Gn(n)!==`number`)return Jn(e.default,t.default);var r=e.stops.length;if(r===1||n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[r-1][0])return e.stops[r-1][1];var i=Xt(e.stops.map((function(e){return e[0]})),n);return e.stops[i][1]}function Zn(e,t,n){var r=e.base===void 0?1:e.base;if(Gn(n)!==`number`)return Jn(e.default,t.default);var i=e.stops.length;if(i===1||n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[i-1][0])return e.stops[i-1][1];var a=Xt(e.stops.map((function(e){return e[0]})),n),o=function(e,t,n,r){var i=r-n,a=e-n;return i===0?0:t===1?a/i:(t**+a-1)/(t**+i-1)}(n,r,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],c=e.stops[a+1][1],l=$t[t.type]||qn;if(e.colorSpace&&e.colorSpace!==`rgb`){var u=pn[e.colorSpace];l=function(e,t){return u.reverse(u.interpolate(u.forward(e),u.forward(t),o))}}return typeof s.evaluate==`function`?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=s.evaluate.apply(void 0,e),r=c.evaluate.apply(void 0,e);if(n!==void 0&&r!==void 0)return l(n,r,o)}}:l(s,c,o)}function Qn(e,t,n){return t.type===`color`?n=ct.parse(n):t.type===`formatted`?n=dt.fromString(n.toString()):t.type===`resolvedImage`?n=ft.fromString(n.toString()):Gn(n)===t.type||t.type===`enum`&&t.values[n]||(n=void 0),Jn(n,e.default,t.default)}Dt.register(Fn,{error:[{kind:`error`},[qe],function(e,t){throw new vt(t[0].evaluate(e))}],typeof:[qe,[Ze],function(e,t){return nt(ht(t[0].evaluate(e)))}],"to-rgba":[tt(G,4),[Ye],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Ye,[G,G,G],In],rgba:[Ye,[G,G,G,G],In],has:{type:Je,overloads:[[[qe],function(e,t){return Ln(t[0].evaluate(e),e.properties())}],[[qe,Xe],function(e,t){var n=t[1];return Ln(t[0].evaluate(e),n.evaluate(e))}]]},get:{type:Ze,overloads:[[[qe],function(e,t){return Rn(t[0].evaluate(e),e.properties())}],[[qe,Xe],function(e,t){var n=t[1];return Rn(t[0].evaluate(e),n.evaluate(e))}]]},"feature-state":[Ze,[qe],function(e,t){return Rn(t[0].evaluate(e),e.featureState||{})}],properties:[Xe,[],function(e){return e.properties()}],"geometry-type":[qe,[],function(e){return e.geometryType()}],id:[Ze,[],function(e){return e.id()}],zoom:[G,[],function(e){return e.globals.zoom}],"heatmap-density":[G,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[G,[],function(e){return e.globals.lineProgress||0}],accumulated:[Ze,[],function(e){return e.globals.accumulated===void 0?null:e.globals.accumulated}],"+":[G,zn(G),function(e,t){for(var n=0,r=0,i=t;r":[Je,[qe,Ze],function(e,t){var n=t[0],r=t[1],i=e.properties()[n.value],a=r.value;return typeof i==typeof a&&i>a}],"filter-id->":[Je,[Ze],function(e,t){var n=t[0],r=e.id(),i=n.value;return typeof r==typeof i&&r>i}],"filter-<=":[Je,[qe,Ze],function(e,t){var n=t[0],r=t[1],i=e.properties()[n.value],a=r.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[Je,[Ze],function(e,t){var n=t[0],r=e.id(),i=n.value;return typeof r==typeof i&&r<=i}],"filter->=":[Je,[qe,Ze],function(e,t){var n=t[0],r=t[1],i=e.properties()[n.value],a=r.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[Je,[Ze],function(e,t){var n=t[0],r=e.id(),i=n.value;return typeof r==typeof i&&r>=i}],"filter-has":[Je,[Ze],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Je,[],function(e){return e.id()!==null&&e.id()!==void 0}],"filter-type-in":[Je,[tt(qe)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Je,[tt(Ze)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Je,[qe,tt(Ze)],function(e,t){var n=t[0];return t[1].value.indexOf(e.properties()[n.value])>=0}],"filter-in-large":[Je,[qe,tt(Ze)],function(e,t){var n=t[0],r=t[1];return function(e,t,n,r){for(;n<=r;){var i=n+r>>1;if(t[i]===e)return!0;t[i]>e?r=i-1:n=i+1}return!1}(e.properties()[n.value],r.value,0,r.value.length-1)}],all:{type:Je,overloads:[[[Je,Je],function(e,t){var n=t[1];return t[0].evaluate(e)&&n.evaluate(e)}],[zn(Je),function(e,t){for(var n=0,r=t;n0&&typeof e[0]==`string`&&e[0]in Fn}function tr(e,t){var n=new Yt(Fn,[],t?function(e){var t={color:Ye,string:qe,number:G,enum:qe,boolean:Je,formatted:$e,resolvedImage:et};return e.type===`array`?tt(t[e.value]||Ze,e.length):t[e.type]}(t):void 0),r=n.parse(e,void 0,void 0,void 0,t&&t.type===`string`?{typeAnnotation:`coerce`}:void 0);return r?Bn(new $n(r,t)):Vn(n.errors)}$n.prototype.evaluateWithoutErrorHandling=function(e,t,n,r,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},$n.prototype.evaluate=function(e,t,n,r,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(o==null||typeof o==`number`&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new vt(`Expected value to be one of `+Object.keys(this._enumValues).map((function(e){return JSON.stringify(e)})).join(`, `)+`, but found `+JSON.stringify(o)+` instead.`);return o}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,typeof console<`u`&&console.warn(e.message)),this._defaultValue}};var nr=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!==`constant`&&!Kt(t.expression)};nr.prototype.evaluateWithoutErrorHandling=function(e,t,n,r,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)},nr.prototype.evaluate=function(e,t,n,r,i,a){return this._styleExpression.evaluate(e,t,n,r,i,a)};var rr=function(e,t,n,r){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent=e!==`camera`&&!Kt(t.expression),this.interpolationType=r};function ir(e,t){if((e=tr(e,t)).result===`error`)return e;var n=e.value.expression,r=Gt(n);if(!r&&!Hn(t))return Vn([new We(``,`data expressions not supported`)]);var i=qt(n,[`zoom`]);if(!i&&!Un(t))return Vn([new We(``,`zoom expressions not supported`)]);var a=function e(t){var n=null;if(t instanceof _n)n=e(t.result);else if(t instanceof gn)for(var r=0,i=t.args;rr.maximum?[new ze(t,n,n+` is greater than the maximum value `+r.maximum)]:[]:[new ze(t,n,`number expected, `+i+` found`)]}function lr(e){var t,n,r,i=e.valueSpec,a=He(e.value.type),o={},s=a!==`categorical`&&e.value.property===void 0,c=!s,l=Gn(e.value.stops)===`array`&&Gn(e.value.stops[0])===`array`&&Gn(e.value.stops[0][0])===`object`,u=or({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if(a===`identity`)return[new ze(e.key,e.value,`identity function may not have a "stops" property`)];var t=[],n=e.value;return t=t.concat(sr({key:e.key,value:n,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:d})),Gn(n)===`array`&&n.length===0&&t.push(new ze(e.key,n,`array must have at least one stop`)),t},default:function(e){return Ar({key:e.key,value:e.value,valueSpec:i,style:e.style,styleSpec:e.styleSpec})}}});return a===`identity`&&s&&u.push(new ze(e.key,e.value,`missing required property "property"`)),a===`identity`||e.value.stops||u.push(new ze(e.key,e.value,`missing required property "stops"`)),a===`exponential`&&e.valueSpec.expression&&!Wn(e.valueSpec)&&u.push(new ze(e.key,e.value,`exponential functions not supported`)),e.styleSpec.$version>=8&&(c&&!Hn(e.valueSpec)?u.push(new ze(e.key,e.value,`property functions not supported`)):s&&!Un(e.valueSpec)&&u.push(new ze(e.key,e.value,`zoom functions not supported`))),a!==`categorical`&&!l||e.value.property!==void 0||u.push(new ze(e.key,e.value,`"property" property is required`)),u;function d(e){var t=[],a=e.value,s=e.key;if(Gn(a)!==`array`)return[new ze(s,a,`array expected, `+Gn(a)+` found`)];if(a.length!==2)return[new ze(s,a,`array length 2 expected, length `+a.length+` found`)];if(l){if(Gn(a[0])!==`object`)return[new ze(s,a,`object expected, `+Gn(a[0])+` found`)];if(a[0].zoom===void 0)return[new ze(s,a,`object stop key must have zoom`)];if(a[0].value===void 0)return[new ze(s,a,`object stop key must have value`)];if(r&&r>He(a[0].zoom))return[new ze(s,a[0].zoom,`stop zoom values must appear in ascending order`)];He(a[0].zoom)!==r&&(r=He(a[0].zoom),n=void 0,o={}),t=t.concat(or({key:s+`[0]`,value:a[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:cr,value:f}}))}else t=t.concat(f({key:s+`[0]`,value:a[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},a));return er(Ue(a[1]))?t.concat([new ze(s+`[1]`,a[1],`expressions are not allowed in function stops.`)]):t.concat(Ar({key:s+`[1]`,value:a[1],valueSpec:i,style:e.style,styleSpec:e.styleSpec}))}function f(e,r){var s=Gn(e.value),c=He(e.value),l=e.value===null?r:e.value;if(t){if(s!==t)return[new ze(e.key,l,s+` stop domain type must match previous stop domain type `+t)]}else t=s;if(s!==`number`&&s!==`string`&&s!==`boolean`)return[new ze(e.key,l,`stop domain value must be a number, string, or boolean`)];if(s!==`number`&&a!==`categorical`){var u=`number expected, `+s+` found`;return Hn(i)&&a===void 0&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ze(e.key,l,u)]}return a!==`categorical`||s!==`number`||isFinite(c)&&Math.floor(c)===c?a!==`categorical`&&s===`number`&&n!==void 0&&c=2&&e[1]!==`$id`&&e[1]!==`$type`;case`in`:return e.length>=3&&(typeof e[1]!=`string`||Array.isArray(e[2]));case`!in`:case`!has`:case`none`:return!1;case`==`:case`!=`:case`>`:case`>=`:case`<`:case`<=`:return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case`any`:case`all`:for(var t=0,n=e.slice(1);tt)}function gr(e){if(!e)return!0;var t,n=e[0];return e.length<=1?n!==`any`:n===`==`?_r(e[1],e[2],`==`):n===`!=`?br(_r(e[1],e[2],`==`)):n===`<`||n===`>`||n===`<=`||n===`>=`?_r(e[1],e[2],n):n===`any`?(t=e.slice(1),[`any`].concat(t.map(gr))):n===`all`?[`all`].concat(e.slice(1).map(gr)):n===`none`?[`all`].concat(e.slice(1).map(gr).map(br)):n===`in`?vr(e[1],e.slice(2)):n===`!in`?br(vr(e[1],e.slice(2))):n===`has`?yr(e[1]):n===`!has`?br(yr(e[1])):n!==`within`||e}function _r(e,t,n){switch(e){case`$type`:return[`filter-type-`+n,t];case`$id`:return[`filter-id-`+n,t];default:return[`filter-`+n,e,t]}}function vr(e,t){if(t.length===0)return!1;switch(e){case`$type`:return[`filter-type-in`,[`literal`,t]];case`$id`:return[`filter-id-in`,[`literal`,t]];default:return t.length>200&&!t.some((function(e){return typeof e!=typeof t[0]}))?[`filter-in-large`,e,[`literal`,t.sort(hr)]]:[`filter-in-small`,e,[`literal`,t]]}}function yr(e){switch(e){case`$type`:return!0;case`$id`:return[`filter-has-id`];default:return[`filter-has`,e]}}function br(e){return[`!`,e]}function xr(e){return fr(Ue(e.value))?ur(Ve({},e,{expressionContext:`filter`,valueSpec:{value:`boolean`}})):function e(t){var n=t.value,r=t.key;if(Gn(n)!==`array`)return[new ze(r,n,`array expected, `+Gn(n)+` found`)];var i,a=t.styleSpec,o=[];if(n.length<1)return[new ze(r,n,`filter array must have at least 1 element`)];switch(o=o.concat(dr({key:r+`[0]`,value:n[0],valueSpec:a.filter_operator,style:t.style,styleSpec:t.styleSpec})),He(n[0])){case`<`:case`<=`:case`>`:case`>=`:n.length>=2&&He(n[1])===`$type`&&o.push(new ze(r,n,`"$type" cannot be use with operator "`+n[0]+`"`));case`==`:case`!=`:n.length!==3&&o.push(new ze(r,n,`filter array for operator "`+n[0]+`" must have 3 elements`));case`in`:case`!in`:n.length>=2&&(i=Gn(n[1]))!==`string`&&o.push(new ze(r+`[1]`,n[1],`string expected, `+i+` found`));for(var s=2;s=u[p+0]&&r>=u[p+1])?(o[f]=!0,a.push(l[f])):o[f]=!1}}},zr.prototype._forEachCell=function(e,t,n,r,i,a,o,s){for(var c=this._convertToCellCoord(e),l=this._convertToCellCoord(t),u=this._convertToCellCoord(n),d=this._convertToCellCoord(r),f=c;f<=u;f++)for(var p=l;p<=d;p++){var m=this.d*p+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(p),this._convertFromCellCoord(f+1),this._convertFromCellCoord(p+1)))&&i.call(this,e,t,n,r,m,a,o,s))return}},zr.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},zr.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},zr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,n=0,r=0;r=0)){var u=e[l];c[l]=Hr[s].shallow.indexOf(l)>=0?u:qr(u,t)}e instanceof Error&&(c.message=e.message)}if(c.$name)throw Error(`$name property is reserved for worker serialization logic.`);return s!==`Object`&&(c.$name=s),c}throw Error(`can't serialize object of type `+typeof e)}function Jr(e){if(e==null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||Gr(e)||Kr(e)||ArrayBuffer.isView(e)||e instanceof Br)return e;if(Array.isArray(e))return e.map(Jr);if(typeof e==`object`){var t=e.$name||`Object`,n=Hr[t].klass;if(!n)throw Error(`can't deserialize unregistered class `+t);if(n.deserialize)return n.deserialize(e);for(var r=Object.create(n.prototype),i=0,a=Object.keys(e);i=0?s:Jr(s)}}return r}throw Error(`can't deserialize object of type `+typeof e)}var Yr=function(){this.first=!0};Yr.prototype.update=function(e,t){var n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=t):this.lastFloorZoom=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function Zr(e){for(var t=0,n=e;t=65097&&e<=65103)||Xr[`CJK Compatibility Ideographs`](e)||Xr[`CJK Compatibility`](e)||Xr[`CJK Radicals Supplement`](e)||Xr[`CJK Strokes`](e)||!(!Xr[`CJK Symbols and Punctuation`](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||e===12336)||Xr[`CJK Unified Ideographs Extension A`](e)||Xr[`CJK Unified Ideographs`](e)||Xr[`Enclosed CJK Letters and Months`](e)||Xr[`Hangul Compatibility Jamo`](e)||Xr[`Hangul Jamo Extended-A`](e)||Xr[`Hangul Jamo Extended-B`](e)||Xr[`Hangul Jamo`](e)||Xr[`Hangul Syllables`](e)||Xr.Hiragana(e)||Xr[`Ideographic Description Characters`](e)||Xr.Kanbun(e)||Xr[`Kangxi Radicals`](e)||Xr[`Katakana Phonetic Extensions`](e)||Xr.Katakana(e)&&e!==12540||!(!Xr[`Halfwidth and Fullwidth Forms`](e)||e===65288||e===65289||e===65293||e>=65306&&e<=65310||e===65339||e===65341||e===65343||e>=65371&&e<=65503||e===65507||e>=65512&&e<=65519)||!(!Xr[`Small Form Variants`](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Xr[`Unified Canadian Aboriginal Syllabics`](e)||Xr[`Unified Canadian Aboriginal Syllabics Extended`](e)||Xr[`Vertical Forms`](e)||Xr[`Yijing Hexagram Symbols`](e)||Xr[`Yi Syllables`](e)||Xr[`Yi Radicals`](e))))}function $r(e){return!(Qr(e)||function(e){return!!(Xr[`Latin-1 Supplement`](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Xr[`General Punctuation`](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||Xr[`Letterlike Symbols`](e)||Xr[`Number Forms`](e)||Xr[`Miscellaneous Technical`](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||Xr[`Control Pictures`](e)&&e!==9251||Xr[`Optical Character Recognition`](e)||Xr[`Enclosed Alphanumerics`](e)||Xr[`Geometric Shapes`](e)||Xr[`Miscellaneous Symbols`](e)&&!(e>=9754&&e<=9759)||Xr[`Miscellaneous Symbols and Arrows`](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Xr[`CJK Symbols and Punctuation`](e)||Xr.Katakana(e)||Xr[`Private Use Area`](e)||Xr[`CJK Compatibility Forms`](e)||Xr[`Small Form Variants`](e)||Xr[`Halfwidth and Fullwidth Forms`](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(e))}function ei(e){return e>=1424&&e<=2303||Xr[`Arabic Presentation Forms-A`](e)||Xr[`Arabic Presentation Forms-B`](e)}function ti(e,t){return!(!t&&ei(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Xr.Khmer(e))}function ni(e){for(var t=0,n=e;t-1&&(ii=`error`),ri&&ri(e)};function si(){ci.fire(new Ie(`pluginStateChange`,{pluginStatus:ii,pluginURL:ai}))}var ci=new Re,li=function(){return ii},ui=function(){if(ii!==`deferred`||!ai)throw Error(`rtl-text-plugin cannot be downloaded unless a pluginURL is specified`);ii=`loading`,si(),ai&&je({url:ai},(function(e){e?oi(e):(ii=`loaded`,si())}))},di={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ii===`loaded`||di.applyArabicShaping!=null},isLoading:function(){return ii===`loading`},setState:function(e){ii=e.pluginStatus,ai=e.pluginURL},isParsed:function(){return di.applyArabicShaping!=null&&di.processBidirectionalText!=null&&di.processStyledBidirectionalText!=null},getPluginURL:function(){return ai}},fi=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Yr,this.transition={})};fi.prototype.isSupportedScript=function(e){return function(e,t){for(var n=0,r=e;nthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*t}};var pi=function(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(Kn(e))return new ar(e,t);if(er(e)){var n=ir(e,t);if(n.result===`error`)throw Error(n.value.map((function(e){return e.key+`: `+e.message})).join(`, `));return n.value}var r=e;return typeof e==`string`&&t.type===`color`&&(r=ct.parse(e)),{kind:`constant`,evaluate:function(){return r}}}(t===void 0?e.specification.default:t,e.specification)};pi.prototype.isDataDriven=function(){return this.expression.kind===`source`||this.expression.kind===`composite`},pi.prototype.possiblyEvaluate=function(e,t,n){return this.property.possiblyEvaluate(this,e,t,n)};var mi=function(e){this.property=e,this.value=new pi(e,void 0)};mi.prototype.transitioned=function(e,t){return new gi(this.property,this.value,t,f({},e.transition,this.transition),e.now)},mi.prototype.untransitioned=function(){return new gi(this.property,this.value,null,{},0)};var hi=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};hi.prototype.getValue=function(e){return x(this._values[e].value.value)},hi.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new mi(this._values[e].property)),this._values[e].value=new pi(this._values[e].property,t===null?void 0:x(t))},hi.prototype.getTransition=function(e){return x(this._values[e].transition)},hi.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new mi(this._values[e].property)),this._values[e].transition=x(t)||void 0},hi.prototype.serialize=function(){for(var e={},t=0,n=Object.keys(this._values);tthis.end||this.value.isDataDriven())return this.prior=null,i;if(r=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}(o))}return i};var _i=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};_i.prototype.possiblyEvaluate=function(e,t,n){for(var r=new bi(this._properties),i=0,a=Object.keys(this._values);ir.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}},t.prototype.interpolate=function(e){return e},t}(Si),wi=function(e){this.specification=e};wi.prototype.possiblyEvaluate=function(e,t,n,r){if(e.value!==void 0){if(e.expression.kind===`constant`){var i=e.expression.evaluate(t,null,{},n,r);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new fi(Math.floor(t.zoom-1),t)),e.expression.evaluate(new fi(Math.floor(t.zoom),t)),e.expression.evaluate(new fi(Math.floor(t.zoom+1),t)),t)}},wi.prototype._calculate=function(e,t,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}},wi.prototype.interpolate=function(e){return e};var Ti=function(e){this.specification=e};Ti.prototype.possiblyEvaluate=function(e,t,n,r){return!!e.expression.evaluate(t,null,{},n,r)},Ti.prototype.interpolate=function(){return!1};var Ei=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var n=e[t];n.specification.overridable&&this.overridableProperties.push(t);var r=this.defaultPropertyValues[t]=new pi(n,void 0),i=this.defaultTransitionablePropertyValues[t]=new mi(n);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=r.possiblyEvaluate({})}};Ur(`DataDrivenProperty`,Si),Ur(`DataConstantProperty`,xi),Ur(`CrossFadedDataDrivenProperty`,Ci),Ur(`CrossFadedProperty`,wi),Ur(`ColorRampProperty`,Ti);var Di=function(e){function t(t,n){if(e.call(this),this.id=t.id,this.type=t.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},t.type!==`custom`&&(this.metadata=(t=t).metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!==`background`&&(this.source=t.source,this.sourceLayer=t[`source-layer`],this.filter=t.filter),n.layout&&(this._unevaluatedLayout=new vi(n.layout)),n.paint)){for(var r in this._transitionablePaint=new hi(n.paint),t.paint)this.setPaintProperty(r,t.paint[r],{validate:!1});for(var i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new bi(n.paint)}}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(e){return e===`visibility`?this.visibility:this._unevaluatedLayout.getValue(e)},t.prototype.setLayoutProperty=function(e,t,n){n===void 0&&(n={}),t!=null&&this._validate(q,`layers.`+this.id+`.layout.`+e,e,t,n)||(e===`visibility`?this.visibility=t:this._unevaluatedLayout.setValue(e,t))},t.prototype.getPaintProperty=function(e){return v(e,`-transition`)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)},t.prototype.setPaintProperty=function(e,t,n){if(n===void 0&&(n={}),t!=null&&this._validate(Lr,`layers.`+this.id+`.paint.`+e,e,t,n))return!1;if(v(e,`-transition`))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;var r=this._transitionablePaint._values[e],i=r.property.specification[`property-type`]===`cross-faded-data-driven`,a=r.value.isDataDriven(),o=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var s=this._transitionablePaint._values[e].value;return s.isDataDriven()||a||i||this._handleOverridablePaintPropertyUpdate(e,o,s)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){},t.prototype._handleOverridablePaintPropertyUpdate=function(e,t,n){return!1},t.prototype.isHidden=function(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility===`none`},t.prototype.updateTransitions=function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)},t.prototype.serialize=function(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),b(e,(function(e,t){return!(e===void 0||t===`layout`&&!Object.keys(e).length||t===`paint`&&!Object.keys(e).length)}))},t.prototype._validate=function(e,t,n,r,i){return i===void 0&&(i={}),(!i||!1!==i.validate)&&J(this,e.call(Fr,{key:t,layerType:this.type,objectKey:n,value:r,styleSpec:W,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var e in this.paint._values){var t=this.paint.get(e);if(t instanceof yi&&Hn(t.property.specification)&&(t.value.kind===`source`||t.value.kind===`composite`)&&t.value.isStateDependent)return!0}return!1},t}(Re),Oi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ki=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Ai=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function ji(e,t){t===void 0&&(t=1);var n=0,r=0;return{members:e.map((function(e){var i=Oi[e.type].BYTES_PER_ELEMENT,a=n=Mi(n,Math.max(t,i)),o=e.components||1;return r=Math.max(r,i),n+=i*o,{name:e.name,type:e.type,components:o,offset:a}})),size:Mi(n,Math.max(r,t)),alignment:t}}function Mi(e,t){return Math.ceil(e/t)*t}Ai.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Ai.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Ai.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ai.prototype.clear=function(){this.length=0},Ai.prototype.resize=function(e){this.reserve(e),this.length=e},Ai.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Ai.prototype._refreshViews=function(){throw Error(`_refreshViews() must be implemented by each concrete StructArray layout`)};var Ni=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)},t.prototype.emplace=function(e,t,n){var r=2*e;return this.int16[r+0]=t,this.int16[r+1]=n,e},t}(Ai);Ni.prototype.bytesPerElement=4,Ur(`StructArrayLayout2i4`,Ni);var Pi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)},t.prototype.emplace=function(e,t,n,r,i){var a=4*e;return this.int16[a+0]=t,this.int16[a+1]=n,this.int16[a+2]=r,this.int16[a+3]=i,e},t}(Ai);Pi.prototype.bytesPerElement=8,Ur(`StructArrayLayout4i8`,Pi);var Fi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)},t.prototype.emplace=function(e,t,n,r,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(Ai);Fi.prototype.bytesPerElement=12,Ur(`StructArrayLayout2i4i12`,Fi);var Ii=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)},t.prototype.emplace=function(e,t,n,r,i,a,o){var s=4*e,c=8*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.uint8[c+4]=r,this.uint8[c+5]=i,this.uint8[c+6]=a,this.uint8[c+7]=o,e},t}(Ai);Ii.prototype.bytesPerElement=8,Ur(`StructArrayLayout2i4ub8`,Ii);var Li=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)},t.prototype.emplace=function(e,t,n){var r=2*e;return this.float32[r+0]=t,this.float32[r+1]=n,e},t}(Ai);Li.prototype.bytesPerElement=8,Ur(`StructArrayLayout2f8`,Li);var Ri=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,a,o,s,c,l){var u=this.length;return this.resize(u+1),this.emplace(u,e,t,n,r,i,a,o,s,c,l)},t.prototype.emplace=function(e,t,n,r,i,a,o,s,c,l,u){var d=10*e;return this.uint16[d+0]=t,this.uint16[d+1]=n,this.uint16[d+2]=r,this.uint16[d+3]=i,this.uint16[d+4]=a,this.uint16[d+5]=o,this.uint16[d+6]=s,this.uint16[d+7]=c,this.uint16[d+8]=l,this.uint16[d+9]=u,e},t}(Ai);Ri.prototype.bytesPerElement=20,Ur(`StructArrayLayout10ui20`,Ri);var zi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,a,o,s,c,l,u,d){var f=this.length;return this.resize(f+1),this.emplace(f,e,t,n,r,i,a,o,s,c,l,u,d)},t.prototype.emplace=function(e,t,n,r,i,a,o,s,c,l,u,d,f){var p=12*e;return this.int16[p+0]=t,this.int16[p+1]=n,this.int16[p+2]=r,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=c,this.int16[p+8]=l,this.int16[p+9]=u,this.int16[p+10]=d,this.int16[p+11]=f,e},t}(Ai);zi.prototype.bytesPerElement=24,Ur(`StructArrayLayout4i4ui4i24`,zi);var Bi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)},t.prototype.emplace=function(e,t,n,r){var i=3*e;return this.float32[i+0]=t,this.float32[i+1]=n,this.float32[i+2]=r,e},t}(Ai);Bi.prototype.bytesPerElement=12,Ur(`StructArrayLayout3f12`,Bi);var Vi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){return this.uint32[1*e+0]=t,e},t}(Ai);Vi.prototype.bytesPerElement=4,Ur(`StructArrayLayout1ul4`,Vi);var Hi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,a,o,s,c){var l=this.length;return this.resize(l+1),this.emplace(l,e,t,n,r,i,a,o,s,c)},t.prototype.emplace=function(e,t,n,r,i,a,o,s,c,l){var u=10*e,d=5*e;return this.int16[u+0]=t,this.int16[u+1]=n,this.int16[u+2]=r,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[d+3]=s,this.uint16[u+8]=c,this.uint16[u+9]=l,e},t}(Ai);Hi.prototype.bytesPerElement=20,Ur(`StructArrayLayout6i1ul2ui20`,Hi);var Ui=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)},t.prototype.emplace=function(e,t,n,r,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(Ai);Ui.prototype.bytesPerElement=12,Ur(`StructArrayLayout2i2i2i12`,Ui);var Wi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i)},t.prototype.emplace=function(e,t,n,r,i,a){var o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=n,this.float32[o+2]=r,this.int16[s+6]=i,this.int16[s+7]=a,e},t}(Ai);Wi.prototype.bytesPerElement=16,Ur(`StructArrayLayout2f1f2i16`,Wi);var Gi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)},t.prototype.emplace=function(e,t,n,r,i){var a=12*e,o=3*e;return this.uint8[a+0]=t,this.uint8[a+1]=n,this.float32[o+1]=r,this.float32[o+2]=i,e},t}(Ai);Gi.prototype.bytesPerElement=12,Ur(`StructArrayLayout2ub2f12`,Gi);var Ki=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)},t.prototype.emplace=function(e,t,n,r){var i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=n,this.uint16[i+2]=r,e},t}(Ai);Ki.prototype.bytesPerElement=6,Ur(`StructArrayLayout3ui6`,Ki);var qi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){var _=this.length;return this.resize(_+1),this.emplace(_,e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)},t.prototype.emplace=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){var v=24*e,y=12*e,b=48*e;return this.int16[v+0]=t,this.int16[v+1]=n,this.uint16[v+2]=r,this.uint16[v+3]=i,this.uint32[y+2]=a,this.uint32[y+3]=o,this.uint32[y+4]=s,this.uint16[v+10]=c,this.uint16[v+11]=l,this.uint16[v+12]=u,this.float32[y+7]=d,this.float32[y+8]=f,this.uint8[b+36]=p,this.uint8[b+37]=m,this.uint8[b+38]=h,this.uint32[y+10]=g,this.int16[v+22]=_,e},t}(Ai);qi.prototype.bytesPerElement=48,Ur(`StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48`,qi);var Ji=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D){var O=this.length;return this.resize(O+1),this.emplace(O,e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D)},t.prototype.emplace=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O){var k=34*e,A=17*e;return this.int16[k+0]=t,this.int16[k+1]=n,this.int16[k+2]=r,this.int16[k+3]=i,this.int16[k+4]=a,this.int16[k+5]=o,this.int16[k+6]=s,this.int16[k+7]=c,this.uint16[k+8]=l,this.uint16[k+9]=u,this.uint16[k+10]=d,this.uint16[k+11]=f,this.uint16[k+12]=p,this.uint16[k+13]=m,this.uint16[k+14]=h,this.uint16[k+15]=g,this.uint16[k+16]=_,this.uint16[k+17]=v,this.uint16[k+18]=y,this.uint16[k+19]=b,this.uint16[k+20]=x,this.uint16[k+21]=S,this.uint16[k+22]=C,this.uint32[A+12]=w,this.float32[A+13]=T,this.float32[A+14]=E,this.float32[A+15]=D,this.float32[A+16]=O,e},t}(Ai);Ji.prototype.bytesPerElement=68,Ur(`StructArrayLayout8i15ui1ul4f68`,Ji);var Yi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){return this.float32[1*e+0]=t,e},t}(Ai);Yi.prototype.bytesPerElement=4,Ur(`StructArrayLayout1f4`,Yi);var Xi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)},t.prototype.emplace=function(e,t,n,r){var i=3*e;return this.int16[i+0]=t,this.int16[i+1]=n,this.int16[i+2]=r,e},t}(Ai);Xi.prototype.bytesPerElement=6,Ur(`StructArrayLayout3i6`,Xi);var Zi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)},t.prototype.emplace=function(e,t,n,r){var i=4*e;return this.uint32[2*e+0]=t,this.uint16[i+2]=n,this.uint16[i+3]=r,e},t}(Ai);Zi.prototype.bytesPerElement=8,Ur(`StructArrayLayout1ul2ui8`,Zi);var Qi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)},t.prototype.emplace=function(e,t,n){var r=2*e;return this.uint16[r+0]=t,this.uint16[r+1]=n,e},t}(Ai);Qi.prototype.bytesPerElement=4,Ur(`StructArrayLayout2ui4`,Qi);var $i=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){return this.uint16[1*e+0]=t,e},t}(Ai);$i.prototype.bytesPerElement=2,Ur(`StructArrayLayout1ui2`,$i);var ea=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)},t.prototype.emplace=function(e,t,n,r,i){var a=4*e;return this.float32[a+0]=t,this.float32[a+1]=n,this.float32[a+2]=r,this.float32[a+3]=i,e},t}(Ai);ea.prototype.bytesPerElement=16,Ur(`StructArrayLayout4f16`,ea);var ta=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var n={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,n),t}(ki);ta.prototype.size=20;var na=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(e){return new ta(this,e)},t}(Hi);Ur(`CollisionBoxArray`,na);var ra=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},n.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},n.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},n.segment.get=function(){return this._structArray.uint16[this._pos2+10]},n.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},n.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},n.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},n.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},n.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},n.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},n.placedOrientation.set=function(e){this._structArray.uint8[this._pos1+37]=e},n.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},n.hidden.set=function(e){this._structArray.uint8[this._pos1+38]=e},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},n.crossTileID.set=function(e){this._structArray.uint32[this._pos4+10]=e},n.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,n),t}(ki);ra.prototype.size=48;var ia=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(e){return new ra(this,e)},t}(qi);Ur(`PlacedSymbolArray`,ia);var aa=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},n.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},n.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},n.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},n.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},n.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},n.key.get=function(){return this._structArray.uint16[this._pos2+8]},n.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},n.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},n.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},n.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},n.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},n.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},n.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},n.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},n.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},n.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},n.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},n.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},n.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},n.crossTileID.set=function(e){this._structArray.uint32[this._pos4+12]=e},n.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},n.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},n.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},n.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,n),t}(ki);aa.prototype.size=68;var oa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(e){return new aa(this,e)},t}(Ji);Ur(`SymbolInstanceArray`,oa);var sa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getoffsetX=function(e){return this.float32[1*e+0]},t}(Yi);Ur(`GlyphOffsetArray`,sa);var ca=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getx=function(e){return this.int16[3*e+0]},t.prototype.gety=function(e){return this.int16[3*e+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[3*e+2]},t}(Xi);Ur(`SymbolLineVertexArray`,ca);var la=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var n={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,n),t}(ki);la.prototype.size=8;var ua=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(e){return new la(this,e)},t}(Zi);Ur(`FeatureIndexArray`,ua);var da=ji([{name:`a_pos`,components:2,type:`Int16`}],4).members,fa=function(e){e===void 0&&(e=[]),this.segments=e};function pa(e,t){return 256*(e=u(Math.floor(e),0,255))+u(Math.floor(t),0,255)}fa.prototype.prepareSegment=function(e,t,n,r){var i=this.segments[this.segments.length-1];return e>fa.MAX_VERTEX_ARRAY_LENGTH&&C(`Max vertices per segment is `+fa.MAX_VERTEX_ARRAY_LENGTH+`: bucket requested `+e),(!i||i.vertexLength+e>fa.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==r)&&(i={vertexOffset:t.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},r!==void 0&&(i.sortKey=r),this.segments.push(i)),i},fa.prototype.get=function(){return this.segments},fa.prototype.destroy=function(){for(var e=0,t=this.segments;e>>16)*o&65535)<<16)&4294967295)<<15|c>>>17))*s+(((c>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(c=0,n){case 3:c^=(255&e.charCodeAt(l+2))<<16;case 2:c^=(255&e.charCodeAt(l+1))<<8;case 1:i^=c=(65535&(c=(c=(65535&(c^=255&e.charCodeAt(l)))*o+(((c>>>16)*o&65535)<<16)&4294967295)<<15|c>>>17))*s+(((c>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),ga=t((function(e){e.exports=function(e,t){for(var n,r=e.length,i=t^r,a=0;r>=4;)n=1540483477*(65535&(n=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(n>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),r-=4,++a;switch(r){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),_a=ha,va=ga;_a.murmur3=ha,_a.murmur2=va;var ya=function(){this.ids=[],this.positions=[],this.indexed=!1};ya.prototype.add=function(e,t,n,r){this.ids.push(xa(e)),this.positions.push(t,n,r)},ya.prototype.getPositions=function(e){for(var t=xa(e),n=0,r=this.ids.length-1;n>1;this.ids[i]>=t?r=i:n=i+1}for(var a=[];this.ids[n]===t;)a.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return a},ya.serialize=function(e,t){var n=new Float64Array(e.ids),r=new Uint32Array(e.positions);return function e(t,n,r,i){for(;r>1],o=r-1,s=i+1;;){do o++;while(t[o]a);if(o>=s)break;Sa(t,o,s),Sa(n,3*o,3*s),Sa(n,3*o+1,3*s+1),Sa(n,3*o+2,3*s+2)}s-ro.x+1||co.y+1)&&C(`Geometry exceeds allowed extent, reduce your vector tile buffer size`)}return n}function Ga(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Wa(e):[]}}function Ka(e,t,n,r,i){e.emplaceBack(2*t+(r+1)/2,2*n+(i+1)/2)}var qa=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Ni,this.indexArray=new Ki,this.segments=new fa,this.programConfigurations=new za(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function Ja(e,t){for(var n=0;n1){if(Qa(e,t))return!0;for(var r=0;r1?n:n.sub(t)._mult(i)._add(t))}function no(e,t){for(var n,r,i,a=!1,o=0;ot.y!=(i=n[c]).y>t.y&&t.x<(i.x-r.x)*(t.y-r.y)/(i.y-r.y)+r.x&&(a=!a);return a}function ro(e,t){for(var n=!1,r=0,i=e.length-1;rt.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(n=!n)}return n}function io(e,t,n){var r=n[0],i=n[2];if(e.xi.x&&t.x>i.x||e.yi.y&&t.y>i.y)return!1;var a=w(e,t,n[0]);return a!==w(e,t,n[1])||a!==w(e,t,n[2])||a!==w(e,t,n[3])}function ao(e,t,n){var r=t.paint.get(e).value;return r.kind===`constant`?r.value:n.programConfigurations.get(t.id).getMaxValue(e)}function oo(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function so(e,t,n,r,a){if(!t[0]&&!t[1])return e;var o=i.convert(t)._mult(a);n===`viewport`&&o._rotate(-r);for(var s=[],c=0;c=8192||u<0||u>=8192)){var d=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),f=d.vertexLength;Ka(this.layoutVertexArray,l,u,-1,-1),Ka(this.layoutVertexArray,l,u,1,-1),Ka(this.layoutVertexArray,l,u,1,1),Ka(this.layoutVertexArray,l,u,-1,1),this.indexArray.emplaceBack(f,f+1,f+2),this.indexArray.emplaceBack(f,f+3,f+2),d.vertexLength+=4,d.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},r)},Ur(`CircleBucket`,qa,{omit:[`layers`]});var co=new Ei({"circle-sort-key":new Si(W.layout_circle[`circle-sort-key`])}),lo={paint:new Ei({"circle-radius":new Si(W.paint_circle[`circle-radius`]),"circle-color":new Si(W.paint_circle[`circle-color`]),"circle-blur":new Si(W.paint_circle[`circle-blur`]),"circle-opacity":new Si(W.paint_circle[`circle-opacity`]),"circle-translate":new xi(W.paint_circle[`circle-translate`]),"circle-translate-anchor":new xi(W.paint_circle[`circle-translate-anchor`]),"circle-pitch-scale":new xi(W.paint_circle[`circle-pitch-scale`]),"circle-pitch-alignment":new xi(W.paint_circle[`circle-pitch-alignment`]),"circle-stroke-width":new Si(W.paint_circle[`circle-stroke-width`]),"circle-stroke-color":new Si(W.paint_circle[`circle-stroke-color`]),"circle-stroke-opacity":new Si(W.paint_circle[`circle-stroke-opacity`])}),layout:co},uo=typeof Float32Array<`u`?Float32Array:Array;function fo(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function po(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=n[0],b=n[1],x=n[2],S=n[3];return e[0]=y*r+b*s+x*d+S*h,e[1]=y*i+b*c+x*f+S*g,e[2]=y*a+b*l+x*p+S*_,e[3]=y*o+b*u+x*m+S*v,e[4]=(y=n[4])*r+(b=n[5])*s+(x=n[6])*d+(S=n[7])*h,e[5]=y*i+b*c+x*f+S*g,e[6]=y*a+b*l+x*p+S*_,e[7]=y*o+b*u+x*m+S*v,e[8]=(y=n[8])*r+(b=n[9])*s+(x=n[10])*d+(S=n[11])*h,e[9]=y*i+b*c+x*f+S*g,e[10]=y*a+b*l+x*p+S*_,e[11]=y*o+b*u+x*m+S*v,e[12]=(y=n[12])*r+(b=n[13])*s+(x=n[14])*d+(S=n[15])*h,e[13]=y*i+b*c+x*f+S*g,e[14]=y*a+b*l+x*p+S*_,e[15]=y*o+b*u+x*m+S*v,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,n=arguments.length;n--;)t+=e[n]*e[n];return Math.sqrt(t)});var mo,ho=po;function go(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,e}mo=new uo(3),uo!=Float32Array&&(mo[0]=0,mo[1]=0,mo[2]=0),function(){var e=new uo(4);uo!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var _o=(function(){var e=new uo(2);uo!=Float32Array&&(e[0]=0,e[1]=0)}(),function(e){function t(t){e.call(this,t,lo)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(e){return new qa(e)},t.prototype.queryRadius=function(e){var t=e;return ao(`circle-radius`,this,t)+ao(`circle-stroke-width`,this,t)+oo(this.paint.get(`circle-translate`))},t.prototype.queryIntersectsFeature=function(e,t,n,r,i,a,o,s){for(var c=so(e,this.paint.get(`circle-translate`),this.paint.get(`circle-translate-anchor`),a.angle,o),l=this.paint.get(`circle-radius`).evaluate(t,n)+this.paint.get(`circle-stroke-width`).evaluate(t,n),u=this.paint.get(`circle-pitch-alignment`)===`map`,d=u?c:function(e,t){return e.map((function(e){return vo(e,t)}))}(c,s),f=u?l*o:l,p=0,m=r;pe.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw RangeError(`out of range source coordinates for image copy`);if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw RangeError(`out of range destination coordinates for image copy`);for(var o=e.data,s=t.data,c=0;c80*n){r=a=e[0],i=o=e[1];for(var m=n;ma&&(a=s),c>o&&(o=c);l=(l=Math.max(a-r,o-i))===0?0:1/l}return Io(f,p,n,r,i,l),p}function Po(e,t,n,r,i){var a,o;if(i===is(e,t,n,r)>0)for(a=t;a=t;a-=r)o=ts(a,e[a],e[a+1],o);return o&&Yo(o,o.next)&&(ns(o),o=o.next),o}function Fo(e,t){if(!e)return e;t||=e;var n,r=e;do if(n=!1,r.steiner||!Yo(r,r.next)&&Jo(r.prev,r,r.next)!==0)r=r.next;else{if(ns(r),(r=t=r.prev)===r.next)break;n=!0}while(n||r!==t);return t}function Io(e,t,n,r,i,a,o){if(e){!o&&a&&function(e,t,n,r){var i=e;do i.z===null&&(i.z=Wo(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1)}(i)}(e,r,i,a);for(var s,c,l=e;e.prev!==e.next;)if(s=e.prev,c=e.next,a?Ro(e,r,i,a):Lo(e))t.push(s.i/n),t.push(e.i/n),t.push(c.i/n),ns(e),e=c.next,l=c.next;else if((e=c)===l){o?o===1?Io(e=zo(Fo(e),t,n),t,n,r,i,a,2):o===2&&Bo(e,t,n,r,i,a):Io(Fo(e),t,n,r,i,a,1);break}}}function Lo(e){var t=e.prev,n=e,r=e.next;if(Jo(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Ko(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Jo(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ro(e,t,n,r){var i=e.prev,a=e,o=e.next;if(Jo(i,a,o)>=0)return!1;for(var s=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,l=Wo(i.x=l&&f&&f.z<=u;){if(d!==e.prev&&d!==e.next&&Ko(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Jo(d.prev,d,d.next)>=0||(d=d.prevZ,f!==e.prev&&f!==e.next&&Ko(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Jo(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;d&&d.z>=l;){if(d!==e.prev&&d!==e.next&&Ko(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Jo(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=u;){if(f!==e.prev&&f!==e.next&&Ko(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Jo(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zo(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!Yo(i,a)&&Xo(i,r,r.next,a)&&$o(i,a)&&$o(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),ns(r),ns(r.next),r=e=a),r=r.next}while(r!==e);return Fo(r)}function Bo(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&qo(o,s)){var c=es(o,s);o=Fo(o,o.next),c=Fo(c,c.next),Io(o,t,n,r,i,a),Io(c,t,n,r,i,a);return}s=s.next}o=o.next}while(o!==e)}function Vo(e,t){return e.x-t.x}function Ho(e,t){if(t=function(e,t){var n,r=t,i=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x=r.x&&r.x>=u&&i!==r.x&&Ko(an.x||r.x===n.x&&Uo(n,r)))&&(n=r,f=c)),r=r.next;while(r!==l);return n}(e,t)){var n=es(t,e);Fo(t,t.next),Fo(n,n.next)}}function Uo(e,t){return Jo(e.prev,e,t.prev)<0&&Jo(t.next,e,e.next)<0}function Wo(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Go(e){var t=e,n=e;do(t.x=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function qo(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Xo(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&($o(e,t)&&$o(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}(e,t)&&(Jo(e.prev,e,t.prev)||Jo(e,t.prev,t))||Yo(e,t)&&Jo(e.prev,e,e.next)>0&&Jo(t.prev,t,t.next)>0)}function Jo(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Yo(e,t){return e.x===t.x&&e.y===t.y}function Xo(e,t,n,r){var i=Qo(Jo(e,t,n)),a=Qo(Jo(e,t,r)),o=Qo(Jo(n,r,e)),s=Qo(Jo(n,r,t));return i!==a&&o!==s||!(i!==0||!Zo(e,n,t))||!(a!==0||!Zo(e,r,t))||!(o!==0||!Zo(n,e,r))||!(s!==0||!Zo(n,t,r))}function Zo(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Qo(e){return e>0?1:e<0?-1:0}function $o(e,t){return Jo(e.prev,e,e.next)<0?Jo(e,t,e.next)>=0&&Jo(e,e.prev,t)>=0:Jo(e,t,e.prev)<0||Jo(e,e.next,t)<0}function es(e,t){var n=new rs(e.i,e.x,e.y),r=new rs(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function ts(e,t,n,r){var i=new rs(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ns(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function rs(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function is(e,t,n,r){for(var i=0,a=t,o=n-r;ar;){if(i-r>600){var o=i-r+1,s=n-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1);e(t,n,Math.max(r,Math.floor(n-s*l/o+u)),Math.min(i,Math.floor(n+(o-s)*l/o+u)),a)}var d=t[n],f=r,p=i;for(os(t,r,n),a(t[i],d)>0&&os(t,r,i);f0;)p--}a(t[r],d)===0?os(t,r,p):os(t,++p,i),p<=n&&(r=p+1),n<=p&&(i=p-1)}})(e,t,n||0,r||e.length-1,i||ss)}function os(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function ss(e,t){return et)}function cs(e,t){var n=e.length;if(n<=1)return[e];for(var r,i,a=[],o=0;o1)for(var c=0;c0&&n.holes.push(r+=e[i-1].length)}return n},jo.default=Mo;var fs=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ni,this.indexArray=new Ki,this.indexArray2=new Qi,this.programConfigurations=new za(e.layers,e.zoom),this.segments=new fa,this.segments2=new fa,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};fs.prototype.populate=function(e,t,n){this.hasPattern=us(`fill`,this.layers,t);for(var r=this.layers[0].layout.get(`fill-sort-key`),i=[],a=0,o=e;a>3}if(a--,r===1||r===2)o+=e.readSVarint(),s+=e.readSVarint(),r===1&&(t&&c.push(t),t=[]),t.push(new i(o,s));else{if(r!==7)throw Error(`unknown command `+r);t&&t.push(t[0].clone())}}return t&&c.push(t),c},vs.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,n=1,r=0,i=0,a=0,o=1/0,s=-1/0,c=1/0,l=-1/0;e.pos>3}if(r--,n===1||n===2)(i+=e.readSVarint())s&&(s=i),(a+=e.readSVarint())l&&(l=a);else if(n!==7)throw Error(`unknown command `+n)}return[o,c,s,l]},vs.prototype.toGeoJSON=function(e,t,n){var r,i,a=this.extent*2**n,o=this.extent*e,s=this.extent*t,c=this.loadGeometry(),l=vs.types[this.type];function u(e){for(var t=0;t>3;t=r===1?e.readString():r===2?e.readFloat():r===3?e.readDouble():r===4?e.readVarint64():r===5?e.readVarint():r===6?e.readSVarint():r===7?e.readBoolean():null}return t}(n))}function ws(e,t,n){if(e===3){var r=new xs(n,n.readVarint()+n.pos);r.length&&(t[r.name]=r)}}Ss.prototype.feature=function(e){if(e<0||e>=this._features.length)throw Error(`feature index out of bounds`);this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new _s(this._pbf,t,this.extent,this._keys,this._values)};var Ts={VectorTile:function(e,t){this.layers=e.readFields(ws,{},t)},VectorTileFeature:_s,VectorTileLayer:xs},Es=Ts.VectorTileFeature.types,Ds=2**13;function Os(e,t,n,r,i,a,o,s){e.emplaceBack(t,n,2*Math.floor(r*Ds)+o,i*Ds*2,a*Ds*2,Math.round(s))}var ks=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Fi,this.indexArray=new Ki,this.programConfigurations=new za(e.layers,e.zoom),this.segments=new fa,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function As(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}ks.prototype.populate=function(e,t,n){this.features=[],this.hasPattern=us(`fill-extrusion`,this.layers,t);for(var r=0,i=e;r8192}))||M.every((function(e){return e.y<0}))||M.every((function(e){return e.y>8192}))))for(var h=0,g=0;g=1){var v=m[g-1];if(!As(_,v)){d.vertexLength+4>fa.MAX_VERTEX_ARRAY_LENGTH&&(d=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var y=_.sub(v)._perp()._unit(),b=v.dist(_);h+b>32768&&(h=0),Os(this.layoutVertexArray,_.x,_.y,y.x,y.y,0,0,h),Os(this.layoutVertexArray,_.x,_.y,y.x,y.y,0,1,h),Os(this.layoutVertexArray,v.x,v.y,y.x,y.y,0,0,h+=b),Os(this.layoutVertexArray,v.x,v.y,y.x,y.y,0,1,h);var x=d.vertexLength;this.indexArray.emplaceBack(x,x+2,x+1),this.indexArray.emplaceBack(x+1,x+2,x+3),d.vertexLength+=4,d.primitiveLength+=2}}}}if(d.vertexLength+c>fa.MAX_VERTEX_ARRAY_LENGTH&&(d=this.segments.prepareSegment(c,this.layoutVertexArray,this.indexArray)),Es[e.type]===`Polygon`){for(var S=[],C=[],w=d.vertexLength,T=0,E=s;T=2&&e[c-1].equals(e[c-2]);)c--;for(var l=0;l0;if(C&&_>l){var T=u.dist(p);if(T>2*d){var E=u.sub(u.sub(p)._mult(d/T)._round());this.updateDistance(p,E),this.addCurrentVertex(E,h,0,0,f),p=E}}var D=p&&m,O=D?n:s?`butt`:r;if(D&&O===`round`&&(xi&&(O=`bevel`),O===`bevel`&&(x>2&&(O=`flipbevel`),x100)v=g.mult(-1);else{var k=x*h.add(g).mag()/h.sub(g).mag();v._perp()._mult(k*(w?-1:1))}this.addCurrentVertex(u,v,0,0,f),this.addCurrentVertex(u,v.mult(-1),0,0,f)}else if(O===`bevel`||O===`fakeround`){var A=-Math.sqrt(x*x-1),j=w?A:0,M=w?0:A;if(p&&this.addCurrentVertex(u,h,j,M,f),O===`fakeround`)for(var N=Math.round(180*S/Math.PI/20),P=1;P2*d){var re=u.add(m.sub(u)._mult(d/ne)._round());this.updateDistance(u,re),this.addCurrentVertex(re,g,0,0,f),u=re}}}}},Bs.prototype.addCurrentVertex=function(e,t,n,r,i,a){a===void 0&&(a=!1);var o=t.y*r-t.x,s=-t.y-t.x*r;this.addHalfVertex(e,t.x+t.y*n,t.y-t.x*n,a,!1,n,i),this.addHalfVertex(e,o,s,a,!0,-r,i),this.distance>zs/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,t,n,r,i,a))},Bs.prototype.addHalfVertex=function(e,t,n,r,i,a,o){var s=.5*(this.lineClips?this.scaledDistance*(zs-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e.x<<1)+ +!!r,(e.y<<1)+ +!!i,Math.round(63*t)+128,Math.round(63*n)+128,1+(a===0?0:a<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var c=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),o.primitiveLength++),i?this.e2=c:this.e1=c},Bs.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Bs.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},Ur(`LineBucket`,Bs,{omit:[`layers`,`patternFeatures`]});var Vs=new Ei({"line-cap":new xi(W.layout_line[`line-cap`]),"line-join":new Si(W.layout_line[`line-join`]),"line-miter-limit":new xi(W.layout_line[`line-miter-limit`]),"line-round-limit":new xi(W.layout_line[`line-round-limit`]),"line-sort-key":new Si(W.layout_line[`line-sort-key`])}),Hs={paint:new Ei({"line-opacity":new Si(W.paint_line[`line-opacity`]),"line-color":new Si(W.paint_line[`line-color`]),"line-translate":new xi(W.paint_line[`line-translate`]),"line-translate-anchor":new xi(W.paint_line[`line-translate-anchor`]),"line-width":new Si(W.paint_line[`line-width`]),"line-gap-width":new Si(W.paint_line[`line-gap-width`]),"line-offset":new Si(W.paint_line[`line-offset`]),"line-blur":new Si(W.paint_line[`line-blur`]),"line-dasharray":new wi(W.paint_line[`line-dasharray`]),"line-pattern":new Ci(W.paint_line[`line-pattern`]),"line-gradient":new Ti(W.paint_line[`line-gradient`])}),layout:Vs},Us=new(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(t,n){return n=new fi(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),e.prototype.possiblyEvaluate.call(this,t,n)},t.prototype.evaluate=function(t,n,r,i){return n=f({},n,{zoom:Math.floor(n.zoom)}),e.prototype.evaluate.call(this,t,n,r,i)},t}(Si))(Hs.paint.properties[`line-width`].specification);Us.useIntegerZoom=!0;var Ws=function(e){function t(t){e.call(this,t,Hs),this.gradientVersion=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){e===`line-gradient`&&(this.stepInterpolant=this._transitionablePaint._values[`line-gradient`].value.expression._styleExpression.expression instanceof Zt,this.gradientVersion=(this.gradientVersion+1)%s)},t.prototype.gradientExpression=function(){return this._transitionablePaint._values[`line-gradient`].value.expression},t.prototype.recalculate=function(t,n){e.prototype.recalculate.call(this,t,n),this.paint._values[`line-floorwidth`]=Us.possiblyEvaluate(this._transitioningPaint._values[`line-width`].value,t)},t.prototype.createBucket=function(e){return new Bs(e)},t.prototype.queryRadius=function(e){var t=e,n=Gs(ao(`line-width`,this,t),ao(`line-gap-width`,this,t)),r=ao(`line-offset`,this,t);return n/2+Math.abs(r)+oo(this.paint.get(`line-translate`))},t.prototype.queryIntersectsFeature=function(e,t,n,r,a,o,s){var c=so(e,this.paint.get(`line-translate`),this.paint.get(`line-translate-anchor`),o.angle,s),l=s/2*Gs(this.paint.get(`line-width`).evaluate(t,n),this.paint.get(`line-gap-width`).evaluate(t,n)),u=this.paint.get(`line-offset`).evaluate(t,n);return u&&(r=function(e,t){for(var n=[],r=new i(0,0),a=0;a=3){for(var a=0;a0?t+2*e:e}var Ks=ji([{name:`a_pos_offset`,components:4,type:`Int16`},{name:`a_data`,components:4,type:`Uint16`},{name:`a_pixeloffset`,components:4,type:`Int16`}],4),qs=ji([{name:`a_projected_pos`,components:3,type:`Float32`}],4),Js=(ji([{name:`a_fade_opacity`,components:1,type:`Uint32`}],4),ji([{name:`a_placed`,components:2,type:`Uint8`},{name:`a_shift`,components:2,type:`Float32`}])),Ys=(ji([{type:`Int16`,name:`anchorPointX`},{type:`Int16`,name:`anchorPointY`},{type:`Int16`,name:`x1`},{type:`Int16`,name:`y1`},{type:`Int16`,name:`x2`},{type:`Int16`,name:`y2`},{type:`Uint32`,name:`featureIndex`},{type:`Uint16`,name:`sourceLayerIndex`},{type:`Uint16`,name:`bucketIndex`}]),ji([{name:`a_pos`,components:2,type:`Int16`},{name:`a_anchor_pos`,components:2,type:`Int16`},{name:`a_extrude`,components:2,type:`Int16`}],4)),Xs=ji([{name:`a_pos`,components:2,type:`Float32`},{name:`a_radius`,components:1,type:`Float32`},{name:`a_flags`,components:2,type:`Int16`}],4);function Zs(e,t,n){return e.sections.forEach((function(e){e.text=function(e,t,n){var r=t.layout.get(`text-transform`).evaluate(n,{});return r===`uppercase`?e=e.toLocaleUpperCase():r===`lowercase`&&(e=e.toLocaleLowerCase()),di.applyArabicShaping&&(e=di.applyArabicShaping(e)),e}(e.text,t,n)})),e}ji([{name:`triangle`,components:3,type:`Uint16`}]),ji([{type:`Int16`,name:`anchorX`},{type:`Int16`,name:`anchorY`},{type:`Uint16`,name:`glyphStartIndex`},{type:`Uint16`,name:`numGlyphs`},{type:`Uint32`,name:`vertexStartIndex`},{type:`Uint32`,name:`lineStartIndex`},{type:`Uint32`,name:`lineLength`},{type:`Uint16`,name:`segment`},{type:`Uint16`,name:`lowerSize`},{type:`Uint16`,name:`upperSize`},{type:`Float32`,name:`lineOffsetX`},{type:`Float32`,name:`lineOffsetY`},{type:`Uint8`,name:`writingMode`},{type:`Uint8`,name:`placedOrientation`},{type:`Uint8`,name:`hidden`},{type:`Uint32`,name:`crossTileID`},{type:`Int16`,name:`associatedIconIndex`}]),ji([{type:`Int16`,name:`anchorX`},{type:`Int16`,name:`anchorY`},{type:`Int16`,name:`rightJustifiedTextSymbolIndex`},{type:`Int16`,name:`centerJustifiedTextSymbolIndex`},{type:`Int16`,name:`leftJustifiedTextSymbolIndex`},{type:`Int16`,name:`verticalPlacedTextSymbolIndex`},{type:`Int16`,name:`placedIconSymbolIndex`},{type:`Int16`,name:`verticalPlacedIconSymbolIndex`},{type:`Uint16`,name:`key`},{type:`Uint16`,name:`textBoxStartIndex`},{type:`Uint16`,name:`textBoxEndIndex`},{type:`Uint16`,name:`verticalTextBoxStartIndex`},{type:`Uint16`,name:`verticalTextBoxEndIndex`},{type:`Uint16`,name:`iconBoxStartIndex`},{type:`Uint16`,name:`iconBoxEndIndex`},{type:`Uint16`,name:`verticalIconBoxStartIndex`},{type:`Uint16`,name:`verticalIconBoxEndIndex`},{type:`Uint16`,name:`featureIndex`},{type:`Uint16`,name:`numHorizontalGlyphVertices`},{type:`Uint16`,name:`numVerticalGlyphVertices`},{type:`Uint16`,name:`numIconVertices`},{type:`Uint16`,name:`numVerticalIconVertices`},{type:`Uint16`,name:`useRuntimeCollisionCircles`},{type:`Uint32`,name:`crossTileID`},{type:`Float32`,name:`textBoxScale`},{type:`Float32`,components:2,name:`textOffset`},{type:`Float32`,name:`collisionCircleDiameter`}]),ji([{type:`Float32`,name:`offsetX`}]),ji([{type:`Int16`,name:`x`},{type:`Int16`,name:`y`},{type:`Int16`,name:`tileUnitDistanceFromAnchor`}]);var Qs={"!":`︕`,"#":`#`,$:`$`,"%":`%`,"&":`&`,"(":`︵`,")":`︶`,"*":`*`,"+":`+`,",":`︐`,"-":`︲`,".":`・`,"/":`/`,":":`︓`,";":`︔`,"<":`︿`,"=":`=`,">":`﹀`,"?":`︖`,"@":`@`,"[":`﹇`,"\\":`\`,"]":`﹈`,"^":`^`,_:`︳`,"`":```,"{":`︷`,"|":`―`,"}":`︸`,"~":`~`,"¢":`¢`,"£":`£`,"¥":`¥`,"¦":`¦`,"¬":`¬`,"¯":` ̄`,"–":`︲`,"—":`︱`,"‘":`﹃`,"’":`﹄`,"“":`﹁`,"”":`﹂`,"…":`︙`,"‧":`・`,"₩":`₩`,"、":`︑`,"。":`︒`,"〈":`︿`,"〉":`﹀`,"《":`︽`,"》":`︾`,"「":`﹁`,"」":`﹂`,"『":`﹃`,"』":`﹄`,"【":`︻`,"】":`︼`,"〔":`︹`,"〕":`︺`,"〖":`︗`,"〗":`︘`,"!":`︕`,"(":`︵`,")":`︶`,",":`︐`,"-":`︲`,".":`・`,":":`︓`,";":`︔`,"<":`︿`,">":`﹀`,"?":`︖`,"[":`﹇`,"]":`﹈`,"_":`︳`,"{":`︷`,"|":`―`,"}":`︸`,"⦅":`︵`,"⦆":`︶`,"。":`︒`,"「":`﹁`,"」":`﹂`},$s=function(e,t,n,r,i){var a,o,s=8*i-r-1,c=(1<>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=256*o+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else{if(a===c)return o?NaN:1/0*(p?-1:1);o+=2**r,a-=l}return(p?-1:1)*o*2**(a-r)},ec=function(e,t,n,r,i,a){var o,s,c,l=8*a-i-1,u=(1<>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),(t+=o+d>=1?f/c:f*2**(1-d))*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=255&s,p+=m,s/=256,i-=8);for(o=o<0;e[n+p]=255&o,p+=m,o/=256,l-=8);e[n+p-m]|=128*h},tc=nc;function nc(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}nc.Varint=0,nc.Fixed64=1,nc.Bytes=2,nc.Fixed32=5;var rc=typeof TextDecoder>`u`?null:new TextDecoder(`utf8`);function ic(e){return e.type===nc.Bytes?e.readVarint()+e.pos:e.pos+1}function ac(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function oc(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function sc(e,t){for(var n=0;n>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function vc(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function yc(e,t,n){e===1&&n.readMessage(bc,t)}function bc(e,t,n){if(e===3){var r=n.readMessage(xc,{}),i=r.width,a=r.height,o=r.left,s=r.top,c=r.advance;t.push({id:r.id,bitmap:new Co({width:i+6,height:a+6},r.bitmap),metrics:{width:i,height:a,left:o,top:s,advance:c}})}}function xc(e,t,n){e===1?t.id=n.readVarint():e===2?t.bitmap=n.readBytes():e===3?t.width=n.readVarint():e===4?t.height=n.readVarint():e===5?t.left=n.readSVarint():e===6?t.top=n.readSVarint():e===7&&(t.advance=n.readVarint())}function Sc(e){for(var t=0,n=0,r=0,i=e;r=0;f--){var p=o[f];if(!(d.w>p.w||d.h>p.h)){if(d.x=p.x,d.y=p.y,c=Math.max(c,d.y+d.h),s=Math.max(s,d.x+d.w),d.w===p.w&&d.h===p.h){var m=o.pop();f>3,a=this.pos;this.type=7&r,e(i,t,this),this.pos===a&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=gc(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=vc(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=gc(this.buf,this.pos)+4294967296*gc(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=gc(this.buf,this.pos)+4294967296*vc(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=$s(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=$s(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,n,r=this.buf;return t=127&(n=r[this.pos++]),n<128?t:(t|=(127&(n=r[this.pos++]))<<7,n<128?t:(t|=(127&(n=r[this.pos++]))<<14,n<128?t:(t|=(127&(n=r[this.pos++]))<<21,n<128?t:function(e,t,n){var r,i,a=n.buf;if(r=(112&(i=a[n.pos++]))>>4,i<128||(r|=(127&(i=a[n.pos++]))<<3,i<128)||(r|=(127&(i=a[n.pos++]))<<10,i<128)||(r|=(127&(i=a[n.pos++]))<<17,i<128)||(r|=(127&(i=a[n.pos++]))<<24,i<128)||(r|=(1&(i=a[n.pos++]))<<31,i<128))return ac(e,r,t);throw Error(`Expected varint not more than 10 bytes`)}(t|=(15&(n=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&rc?function(e,t,n){return rc.decode(e.subarray(t,n))}(this.buf,t,e):function(e,t,n){for(var r=``,i=t;i239?4:c>223?3:c>191?2:1;if(i+u>n)break;u===1?c<128&&(l=c):u===2?(192&(a=e[i+1]))==128&&(l=(31&c)<<6|63&a)<=127&&(l=null):u===3?(o=e[i+2],(192&(a=e[i+1]))==128&&(192&o)==128&&((l=(15&c)<<12|(63&a)<<6|63&o)<=2047||l>=55296&&l<=57343)&&(l=null)):u===4&&(o=e[i+2],s=e[i+3],(192&(a=e[i+1]))==128&&(192&o)==128&&(192&s)==128&&((l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||l>=1114112)&&(l=null)),l===null?(l=65533,u=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),i+=u}return r}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==nc.Bytes)return e.push(this.readVarint(t));var n=ic(this);for(e||=[];this.pos127;);else if(t===nc.Bytes)this.pos=this.readVarint()+this.pos;else if(t===nc.Fixed32)this.pos+=4;else{if(t!==nc.Fixed64)throw Error(`Unimplemented type: `+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?function(e,t){var n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw Error(`Given varint doesn't fit into 10 bytes`);t.realloc(10),function(e,t,n){n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,n.buf[n.pos]=127&(e>>>=7)}(n,0,t),function(e,t){var n=(7&e)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,n){for(var r,i,a=0;a55295&&r<57344){if(!i){r>56319||a+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):i=r;continue}if(r<56320){e[n++]=239,e[n++]=191,e[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&=(e[n++]=239,e[n++]=191,e[n++]=189,null);r<128?e[n++]=r:(r<2048?e[n++]=r>>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return n}(this.buf,e,this.pos);var n=this.pos-t;n>=128&&oc(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(e){this.realloc(4),ec(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),ec(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n=128&&oc(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,n){this.writeTag(e,nc.Bytes),this.writeRawMessage(t,n)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,sc,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,cc,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,dc,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,lc,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,uc,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,fc,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,pc,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,mc,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,hc,t)},writeBytesField:function(e,t){this.writeTag(e,nc.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,nc.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,nc.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,nc.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,nc.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,nc.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,nc.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,nc.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,nc.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,nc.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var Cc=function(e,t){var n=t.pixelRatio,r=t.version,i=t.stretchX,a=t.stretchY,o=t.content;this.paddedRect=e,this.pixelRatio=n,this.stretchX=i,this.stretchY=a,this.content=o,this.version=r},wc={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};wc.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},wc.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},wc.tlbr.get=function(){return this.tl.concat(this.br)},wc.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Cc.prototype,wc);var Tc=function(e,t){var n={},r={};this.haveRenderCallbacks=[];var i=[];this.addImages(e,n,i),this.addImages(t,r,i);var a=Sc(i),o=new wo({width:a.w||1,height:a.h||1});for(var s in e){var c=e[s],l=n[s].paddedRect;wo.copy(c.data,o,{x:0,y:0},{x:l.x+1,y:l.y+1},c.data)}for(var u in t){var d=t[u],f=r[u].paddedRect,p=f.x+1,m=f.y+1,h=d.data.width,g=d.data.height;wo.copy(d.data,o,{x:0,y:0},{x:p,y:m},d.data),wo.copy(d.data,o,{x:0,y:g-1},{x:p,y:m-1},{width:h,height:1}),wo.copy(d.data,o,{x:0,y:0},{x:p,y:m+g},{width:h,height:1}),wo.copy(d.data,o,{x:h-1,y:0},{x:p-1,y:m},{width:1,height:g}),wo.copy(d.data,o,{x:0,y:0},{x:p+h,y:m},{width:1,height:g})}this.image=o,this.iconPositions=n,this.patternPositions=r};Tc.prototype.addImages=function(e,t,n){for(var r in e){var i=e[r],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};n.push(a),t[r]=new Cc(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(r)}},Tc.prototype.patchUpdatedImages=function(e,t){for(var n in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),t),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),t)},Tc.prototype.patchUpdatedImage=function(e,t,n){if(e&&t&&e.version!==t.version){e.version=t.version;var r=e.tl;n.update(t.data,void 0,{x:r[0],y:r[1]})}},Ur(`ImagePosition`,Cc),Ur(`ImageAtlas`,Tc);var Ec={horizontal:1,vertical:2,horizontalOnly:3},Dc=function(){this.scale=1,this.fontStack=``,this.imageName=null};Dc.forText=function(e,t){var n=new Dc;return n.scale=e||1,n.fontStack=t,n},Dc.forImage=function(e){var t=new Dc;return t.imageName=e,t};var Oc=function(){this.text=``,this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function kc(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g,_=Oc.fromFeature(e,i);d===Ec.vertical&&_.verticalizePunctuation();var v=di.processBidirectionalText,y=di.processStyledBidirectionalText;if(v&&_.sections.length===1){g=[];for(var b=0,x=v(_.toString(),Ic(_,l,a,t,r,p,m));b0&&te>T&&(T=te)}else{var ne=n[D.fontStack],re=ne&&ne[k];if(re&&re.rect)M=re.rect,j=re.metrics;else{var ie=t[D.fontStack],ae=ie&&ie[k];if(!ae)continue;j=ae.metrics}A=24*(x-D.scale)}ee?(e.verticalizable=!0,w.push({glyph:k,imageName:N,x:f,y:p+A,vertical:ee,scale:D.scale,fontStack:D.fontStack,sectionIndex:O,metrics:j,rect:M}),f+=P*D.scale+l):(w.push({glyph:k,imageName:N,x:f,y:p+A,vertical:ee,scale:D.scale,fontStack:D.fontStack,sectionIndex:O,metrics:j,rect:M}),f+=j.advance*D.scale+l)}w.length!==0&&(m=Math.max(f-l,m),Rc(w,0,w.length-1,g,T)),f=0;var L=a*x+T;C.lineOffset=Math.max(T,S),p+=L,h=Math.max(L,h),++_}else p+=a,++_}var oe,se=p- -17,ce=Lc(o),le=ce.horizontalAlign,ue=ce.verticalAlign;(function(e,t,n,r,i,a,o,s,c){var l,u=(t-n)*i;l=a===o?(-r*c+.5)*o:-s*r- -17;for(var d=0,f=e;d=0&&r>=e&&Ac[this.text.charCodeAt(r)];r--)n--;this.text=this.text.substring(e,n),this.sectionIndex=this.sectionIndex.slice(e,n)},Oc.prototype.substring=function(e,t){var n=new Oc;return n.text=this.text.substring(e,t),n.sectionIndex=this.sectionIndex.slice(e,t),n.sections=this.sections,n},Oc.prototype.toString=function(){return this.text},Oc.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,n){return Math.max(t,e.sections[n].scale)}),0)},Oc.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(Dc.forText(e.scale,e.fontStack||t));for(var n=this.sections.length-1,r=0;r=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Ac={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},jc={};function Mc(e,t,n,r,i,a){if(t.imageName){var o=r[t.imageName];return o?o.displaySize[0]*t.scale*24/a+i:0}var s=n[t.fontStack],c=s&&s[e];return c?c.metrics.advance*t.scale+i:0}function Nc(e,t,n,r){var i=(e-t)**2;return r?e=0,d=0,f=0;f-n/2;){if(--o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;for(var c=[],l=0;sr;)l-=c.shift().angleDelta;if(l>i)return!1;o++,s+=u.dist(d)}return!0}function Kc(e){for(var t=0,n=0;nl){var m=(l-c)/p,h=new Bc(Qt(d.x,f.x,m),Qt(d.y,f.y,m),f.angleTo(d),u);return h._round(),!o||Gc(e,h,s,o,t)?h:void 0}c+=p}}function Xc(e,t,n,r,i,a,o,s,c){var l=qc(r,a,o),u=Jc(r,i),d=u*o,f=e[0].x===0||e[0].x===c||e[0].y===0||e[0].y===c;return t-d=0&&x=0&&S=0&&p+u<=d){var C=new Bc(x,S,y,h);C._round(),i&&!Gc(t,C,o,i,a)||m.push(C)}}f+=v}return c||m.length||s||(m=e(t,f/2,r,i,a,o,s,!0,l)),m}(e,f?t/2*s%t:(u/2+2*a)*o*s%t,t,l,n,d,f,!1,c)}function Zc(e,t,n,r,a){for(var o=[],s=0;s=r&&f.x>=r||(d.x>=r?d=new i(r,d.y+(r-d.x)/(f.x-d.x)*(f.y-d.y))._round():f.x>=r&&(f=new i(r,d.y+(r-d.x)/(f.x-d.x)*(f.y-d.y))._round()),d.y>=a&&f.y>=a||(d.y>=a?d=new i(d.x+(a-d.y)/(f.y-d.y)*(f.x-d.x),a)._round():f.y>=a&&(f=new i(d.x+(a-d.y)/(f.y-d.y)*(f.x-d.x),a)._round()),l&&d.equals(l[l.length-1])||o.push(l=[d]),l.push(f)))))}return o}function Qc(e,t,n,r){var a=[],o=e.image,s=o.pixelRatio,c=o.paddedRect.w-2,l=o.paddedRect.h-2,u=e.right-e.left,d=e.bottom-e.top,f=o.stretchX||[[0,c]],p=o.stretchY||[[0,l]],m=function(e,t){return e+t[1]-t[0]},h=f.reduce(m,0),g=p.reduce(m,0),_=c-h,v=l-g,y=0,b=h,x=0,S=g,C=0,w=_,T=0,E=v;if(o.content&&r){var D=o.content;y=$c(f,0,D[0]),x=$c(p,0,D[1]),b=$c(f,D[0],D[2]),S=$c(p,D[1],D[3]),C=D[0]-y,T=D[1]-x,w=D[2]-D[0]-b,E=D[3]-D[1]-S}var O=function(r,a,c,l){var f=tl(r.stretch-y,b,u,e.left),p=nl(r.fixed-C,w,r.stretch,h),m=tl(a.stretch-x,S,d,e.top),_=nl(a.fixed-T,E,a.stretch,g),v=tl(c.stretch-y,b,u,e.left),D=nl(c.fixed-C,w,c.stretch,h),O=tl(l.stretch-x,S,d,e.top),k=nl(l.fixed-T,E,l.stretch,g),A=new i(f,m),j=new i(v,m),M=new i(v,O),N=new i(f,O),P=new i(p/s,_/s),ee=new i(D/s,k/s),F=t*Math.PI/180;if(F){var I=Math.sin(F),te=Math.cos(F),ne=[te,-I,I,te];A._matMult(ne),j._matMult(ne),N._matMult(ne),M._matMult(ne)}var re=r.stretch+r.fixed,ie=a.stretch+a.fixed;return{tl:A,tr:j,bl:N,br:M,tex:{x:o.paddedRect.x+1+re,y:o.paddedRect.y+1+ie,w:c.stretch+c.fixed-re,h:l.stretch+l.fixed-ie},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:P,pixelOffsetBR:ee,minFontScaleX:w/s/u,minFontScaleY:E/s/d,isSDF:n}};if(r&&(o.stretchX||o.stretchY))for(var k=el(f,_,h),A=el(p,v,g),j=0;j0&&(m=Math.max(10,m),this.circleDiameter=m)}else{var h=o.top*s-c,g=o.bottom*s+c,_=o.left*s-c,v=o.right*s+c,y=o.collisionPadding;if(y&&(_-=y[0]*s,h-=y[1]*s,v+=y[2]*s,g+=y[3]*s),u){var b=new i(_,h),x=new i(v,h),S=new i(_,g),C=new i(v,g),w=u*Math.PI/180;b._rotate(w),x._rotate(w),S._rotate(w),C._rotate(w),_=Math.min(b.x,x.x,S.x,C.x),v=Math.max(b.x,x.x,S.x,C.x),h=Math.min(b.y,x.y,S.y,C.y),g=Math.max(b.y,x.y,S.y,C.y)}e.emplaceBack(t.x,t.y,_,h,v,g,n,r,a)}this.boxEndIndex=e.length},il=function(e,t){if(e===void 0&&(e=[]),t===void 0&&(t=al),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)};function al(e,t){return et)}function ol(e,t,n){t===void 0&&(t=1),n===void 0&&(n=!1);for(var r=1/0,a=1/0,o=-1/0,s=-1/0,c=e[0],l=0;lo)&&(o=u.x),(!l||u.y>s)&&(s=u.y)}var d=Math.min(o-r,s-a),f=d/2,p=new il([],sl);if(d===0)return new i(r,a);for(var m=r;mg.d||!g.d)&&(g=v,n&&console.log(`found best %d after %d probes`,Math.round(1e4*v.d)/1e4,_)),v.max-g.d<=t||(p.push(new cl(v.p.x-(f=v.h/2),v.p.y-f,f,e)),p.push(new cl(v.p.x+f,v.p.y-f,f,e)),p.push(new cl(v.p.x-f,v.p.y+f,f,e)),p.push(new cl(v.p.x+f,v.p.y+f,f,e)),_+=4)}return n&&(console.log(`num probes: `+_),console.log(`best distance: `+g.d)),g.p}function sl(e,t){return t.max-e.max}function cl(e,t,n,r){this.p=new i(e,t),this.h=n,this.d=function(e,t){for(var n=!1,r=1/0,i=0;ie.y!=u.y>e.y&&e.x<(u.x-l.x)*(e.y-l.y)/(u.y-l.y)+l.x&&(n=!n),r=Math.min(r,to(e,l,u))}return(n?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}il.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},il.prototype.pop=function(){if(this.length!==0){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},il.prototype.peek=function(){return this.data[0]},il.prototype._up=function(e){for(var t=this.data,n=this.compare,r=t[e];e>0;){var i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r},il.prototype._down=function(e){for(var t=this.data,n=this.compare,r=this.length>>1,i=t[e];e=0)break;t[e]=o,e=a}t[e]=i};var ll=1/0;function ul(e,t){return t[1]===ll?function(e,t){var n=0,r=0;t<0&&(t=0);var i=t/Math.sqrt(2);switch(e){case`top-right`:case`top-left`:r=i-7;break;case`bottom-right`:case`bottom-left`:r=7-i;break;case`bottom`:r=7-t;break;case`top`:r=t-7}switch(e){case`top-right`:case`bottom-right`:n=-i;break;case`top-left`:case`bottom-left`:n=i;break;case`left`:n=t;break;case`right`:n=-t}return[n,r]}(e,t[0]):function(e,t,n){var r=0,i=0;switch(t=Math.abs(t),n=Math.abs(n),e){case`top-right`:case`top-left`:case`top`:i=n-7;break;case`bottom-right`:case`bottom-left`:case`bottom`:i=7-n}switch(e){case`top-right`:case`bottom-right`:case`right`:r=-t;break;case`top-left`:case`bottom-left`:case`left`:r=t}return[r,i]}(e,t[0],t[1])}function dl(e){switch(e){case`right`:case`top-right`:case`bottom-right`:return`right`;case`left`:case`top-left`:case`bottom-left`:return`left`}return`center`}function fl(e,t,n,r,a,o,s,c,l,u,d,f,p,m,h){var g=function(e,t,n,r,a,o,s,c){for(var l=r.layout.get(`text-rotate`).evaluate(o,{})*Math.PI/180,u=[],d=0,f=t.positionedLines;d32640&&C(e.layerIds[0]+`: Value for "text-size" is >= 255. Reduce your "text-size".`):_.kind===`composite`&&((v=[128*m.compositeTextSizes[0].evaluate(s,{},h),128*m.compositeTextSizes[1].evaluate(s,{},h)])[0]>32640||v[1]>32640)&&C(e.layerIds[0]+`: Value for "text-size" is >= 255. Reduce your "text-size".`),e.addSymbols(e.text,g,v,c,o,s,u,t,l.lineStartIndex,l.lineLength,p,h);for(var y=0,b=d;y=0;o--)if(r.dist(a[o])0)&&(a.value.kind!==`constant`||a.value.value.length>0),l=s.value.kind!==`constant`||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get(`symbol-sort-key`);if(this.features=[],c||l){for(var d=t.iconDependencies,f=t.glyphDependencies,p=t.availableImages,m=new fi(this.zoom),h=0,g=e;h=0;for(var M=0,N=w.sections;M=0;s--)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=t[s-1].dist(t[s]));for(var c=0;c0},Sl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Sl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Sl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Sl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Sl.prototype.addIndicesForPlacedSymbol=function(e,t){for(var n=e.placedSymbolArray.get(t),r=n.vertexStartIndex+4*n.numGlyphs,i=n.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var n=0,r=this.symbolInstanceIndexes;n=0&&r.indexOf(e)===n&&t.addIndicesForPlacedSymbol(t.text,e)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Ur(`SymbolBucket`,Sl,{omit:[`layers`,`collisionBoxArray`,`features`,`compareText`]}),Sl.MAX_GLYPHS=65535,Sl.addDynamicAttributes=vl;var Cl=new Ei({"symbol-placement":new xi(W.layout_symbol[`symbol-placement`]),"symbol-spacing":new xi(W.layout_symbol[`symbol-spacing`]),"symbol-avoid-edges":new xi(W.layout_symbol[`symbol-avoid-edges`]),"symbol-sort-key":new Si(W.layout_symbol[`symbol-sort-key`]),"symbol-z-order":new xi(W.layout_symbol[`symbol-z-order`]),"icon-allow-overlap":new xi(W.layout_symbol[`icon-allow-overlap`]),"icon-ignore-placement":new xi(W.layout_symbol[`icon-ignore-placement`]),"icon-optional":new xi(W.layout_symbol[`icon-optional`]),"icon-rotation-alignment":new xi(W.layout_symbol[`icon-rotation-alignment`]),"icon-size":new Si(W.layout_symbol[`icon-size`]),"icon-text-fit":new xi(W.layout_symbol[`icon-text-fit`]),"icon-text-fit-padding":new xi(W.layout_symbol[`icon-text-fit-padding`]),"icon-image":new Si(W.layout_symbol[`icon-image`]),"icon-rotate":new Si(W.layout_symbol[`icon-rotate`]),"icon-padding":new xi(W.layout_symbol[`icon-padding`]),"icon-keep-upright":new xi(W.layout_symbol[`icon-keep-upright`]),"icon-offset":new Si(W.layout_symbol[`icon-offset`]),"icon-anchor":new Si(W.layout_symbol[`icon-anchor`]),"icon-pitch-alignment":new xi(W.layout_symbol[`icon-pitch-alignment`]),"text-pitch-alignment":new xi(W.layout_symbol[`text-pitch-alignment`]),"text-rotation-alignment":new xi(W.layout_symbol[`text-rotation-alignment`]),"text-field":new Si(W.layout_symbol[`text-field`]),"text-font":new Si(W.layout_symbol[`text-font`]),"text-size":new Si(W.layout_symbol[`text-size`]),"text-max-width":new Si(W.layout_symbol[`text-max-width`]),"text-line-height":new xi(W.layout_symbol[`text-line-height`]),"text-letter-spacing":new Si(W.layout_symbol[`text-letter-spacing`]),"text-justify":new Si(W.layout_symbol[`text-justify`]),"text-radial-offset":new Si(W.layout_symbol[`text-radial-offset`]),"text-variable-anchor":new xi(W.layout_symbol[`text-variable-anchor`]),"text-anchor":new Si(W.layout_symbol[`text-anchor`]),"text-max-angle":new xi(W.layout_symbol[`text-max-angle`]),"text-writing-mode":new xi(W.layout_symbol[`text-writing-mode`]),"text-rotate":new Si(W.layout_symbol[`text-rotate`]),"text-padding":new xi(W.layout_symbol[`text-padding`]),"text-keep-upright":new xi(W.layout_symbol[`text-keep-upright`]),"text-transform":new Si(W.layout_symbol[`text-transform`]),"text-offset":new Si(W.layout_symbol[`text-offset`]),"text-allow-overlap":new xi(W.layout_symbol[`text-allow-overlap`]),"text-ignore-placement":new xi(W.layout_symbol[`text-ignore-placement`]),"text-optional":new xi(W.layout_symbol[`text-optional`])}),wl={paint:new Ei({"icon-opacity":new Si(W.paint_symbol[`icon-opacity`]),"icon-color":new Si(W.paint_symbol[`icon-color`]),"icon-halo-color":new Si(W.paint_symbol[`icon-halo-color`]),"icon-halo-width":new Si(W.paint_symbol[`icon-halo-width`]),"icon-halo-blur":new Si(W.paint_symbol[`icon-halo-blur`]),"icon-translate":new xi(W.paint_symbol[`icon-translate`]),"icon-translate-anchor":new xi(W.paint_symbol[`icon-translate-anchor`]),"text-opacity":new Si(W.paint_symbol[`text-opacity`]),"text-color":new Si(W.paint_symbol[`text-color`],{runtimeType:Ye,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new Si(W.paint_symbol[`text-halo-color`]),"text-halo-width":new Si(W.paint_symbol[`text-halo-width`]),"text-halo-blur":new Si(W.paint_symbol[`text-halo-blur`]),"text-translate":new xi(W.paint_symbol[`text-translate`]),"text-translate-anchor":new xi(W.paint_symbol[`text-translate-anchor`])}),layout:Cl},Tl=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Ke,this.defaultValue=e};Tl.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},Tl.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},Tl.prototype.outputDefined=function(){return!1},Tl.prototype.serialize=function(){return null},Ur(`FormatSectionOverride`,Tl,{omit:[`defaultValue`]});var Y=function(e){function t(t){e.call(this,t,wl)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(t,n){if(e.prototype.recalculate.call(this,t,n),this.layout.get(`icon-rotation-alignment`)===`auto`&&(this.layout._values[`icon-rotation-alignment`]=this.layout.get(`symbol-placement`)===`point`?`viewport`:`map`),this.layout.get(`text-rotation-alignment`)===`auto`&&(this.layout._values[`text-rotation-alignment`]=this.layout.get(`symbol-placement`)===`point`?`viewport`:`map`),this.layout.get(`text-pitch-alignment`)===`auto`&&(this.layout._values[`text-pitch-alignment`]=this.layout.get(`text-rotation-alignment`)),this.layout.get(`icon-pitch-alignment`)===`auto`&&(this.layout._values[`icon-pitch-alignment`]=this.layout.get(`icon-rotation-alignment`)),this.layout.get(`symbol-placement`)===`point`){var r=this.layout.get(`text-writing-mode`);if(r){for(var i=[],a=0,o=r;a`,targetMapId:r,sourceMapId:a.mapId})}}},zl.prototype.receive=function(e){var t=e.data,n=t.id;if(n&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type===``){delete this.tasks[n];var r=this.cancelCallbacks[n];delete this.cancelCallbacks[n],r&&r()}else E()||t.mustQueue?(this.tasks[n]=t,this.taskQueue.push(n),this.invoker.trigger()):this.processTask(n,t)},zl.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},zl.prototype.processTask=function(e,t){var n=this;if(t.type===``){var r=this.callbacks[e];delete this.callbacks[e],r&&(t.error?r(Jr(t.error)):r(null,Jr(t.data)))}else{var i=!1,a=k(this.globalScope)?void 0:[],o=t.hasCallback?function(t,r){i=!0,delete n.cancelCallbacks[e],n.target.postMessage({id:e,type:``,sourceMapId:n.mapId,error:t?qr(t):null,data:qr(r,a)},a)}:function(e){i=!0},s=null,c=Jr(t.data);if(this.parent[t.type])s=this.parent[t.type](t.sourceMapId,c,o);else if(this.parent.getWorkerSource){var l=t.type.split(`.`);s=this.parent.getWorkerSource(t.sourceMapId,l[0],c.source)[l[1]](c,o)}else o(Error(`Could not find function `+t.type));!i&&s&&s.cancel&&(this.cancelCallbacks[e]=s.cancel)}},zl.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener(`message`,this.receive,!1)};var Vl=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};Vl.prototype.setNorthEast=function(e){return this._ne=e instanceof Hl?new Hl(e.lng,e.lat):Hl.convert(e),this},Vl.prototype.setSouthWest=function(e){return this._sw=e instanceof Hl?new Hl(e.lng,e.lat):Hl.convert(e),this},Vl.prototype.extend=function(e){var t,n,r=this._sw,i=this._ne;if(e instanceof Hl)t=e,n=e;else{if(!(e instanceof Vl))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(Vl.convert(e)):this.extend(Hl.convert(e)):this;if(n=e._ne,!(t=e._sw)||!n)return this}return r||i?(r.lng=Math.min(t.lng,r.lng),r.lat=Math.min(t.lat,r.lat),i.lng=Math.max(n.lng,i.lng),i.lat=Math.max(n.lat,i.lat)):(this._sw=new Hl(t.lng,t.lat),this._ne=new Hl(n.lng,n.lat)),this},Vl.prototype.getCenter=function(){return new Hl((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Vl.prototype.getSouthWest=function(){return this._sw},Vl.prototype.getNorthEast=function(){return this._ne},Vl.prototype.getNorthWest=function(){return new Hl(this.getWest(),this.getNorth())},Vl.prototype.getSouthEast=function(){return new Hl(this.getEast(),this.getSouth())},Vl.prototype.getWest=function(){return this._sw.lng},Vl.prototype.getSouth=function(){return this._sw.lat},Vl.prototype.getEast=function(){return this._ne.lng},Vl.prototype.getNorth=function(){return this._ne.lat},Vl.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Vl.prototype.toString=function(){return`LngLatBounds(`+this._sw.toString()+`, `+this._ne.toString()+`)`},Vl.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Vl.prototype.contains=function(e){var t=Hl.convert(e),n=t.lng,r=t.lat,i=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&i},Vl.convert=function(e){return!e||e instanceof Vl?e:new Vl(e)};var Hl=function(e,t){if(isNaN(e)||isNaN(t))throw Error(`Invalid LngLat object: (`+e+`, `+t+`)`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw Error(`Invalid LngLat latitude value: must be between -90 and 90`)};Hl.prototype.wrap=function(){return new Hl(d(this.lng,-180,180),this.lat)},Hl.prototype.toArray=function(){return[this.lng,this.lat]},Hl.prototype.toString=function(){return`LngLat(`+this.lng+`, `+this.lat+`)`},Hl.prototype.distanceTo=function(e){var t=Math.PI/180,n=this.lat*t,r=e.lat*t,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return 6371008.8*Math.acos(Math.min(i,1))},Hl.prototype.toBounds=function(e){e===void 0&&(e=0);var t=360*e/40075017,n=t/Math.cos(Math.PI/180*this.lat);return new Vl(new Hl(this.lng-n,this.lat-t),new Hl(this.lng+n,this.lat+t))},Hl.convert=function(e){if(e instanceof Hl)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Hl(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e==`object`&&e)return new Hl(Number(`lng`in e?e.lng:e.lon),Number(e.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Ul=2*Math.PI*6371008.8;function Wl(e){return Ul*Math.cos(e*Math.PI/180)}function Gl(e){return(180+e)/360}function Kl(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function ql(e,t){return e/Wl(t)}function Jl(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var Yl=function(e,t,n){n===void 0&&(n=0),this.x=+e,this.y=+t,this.z=+n};Yl.fromLngLat=function(e,t){t===void 0&&(t=0);var n=Hl.convert(e);return new Yl(Gl(n.lng),Kl(n.lat),ql(t,n.lat))},Yl.prototype.toLngLat=function(){return new Hl(360*this.x-180,Jl(this.y))},Yl.prototype.toAltitude=function(){return this.z*Wl(Jl(this.y))},Yl.prototype.meterInMercatorCoordinateUnits=function(){return 1/Ul*(e=Jl(this.y),1/Math.cos(e*Math.PI/180));var e};var Xl=function(e,t,n){this.z=e,this.x=t,this.y=n,this.key=$l(0,e,e,t,n)};Xl.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Xl.prototype.url=function(e,t){var n,r,i,a,o,s=(r=this.y,i=this.z,a=Bl(256*(n=this.x),256*(r=2**i-r-1),i),o=Bl(256*(n+1),256*(r+1),i),a[0]+`,`+a[1]+`,`+o[0]+`,`+o[1]),c=function(e,t,n){for(var r,i=``,a=e;a>0;a--)i+=(t&(r=1<this.canonical.z?new Ql(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ql(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},Ql.prototype.calculateScaledKey=function(e,t){var n=this.canonical.z-e;return e>this.canonical.z?$l(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):$l(this.wrap*+t,e,e,this.canonical.x>>n,this.canonical.y>>n)},Ql.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>t&&e.canonical.y===this.canonical.y>>t},Ql.prototype.children=function(e){if(this.overscaledZ>=e)return[new Ql(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,n=2*this.canonical.x,r=2*this.canonical.y;return[new Ql(t,this.wrap,t,n,r),new Ql(t,this.wrap,t,n+1,r),new Ql(t,this.wrap,t,n,r+1),new Ql(t,this.wrap,t,n+1,r+1)]},Ql.prototype.isLessThan=function(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y=this.dim+1||t<-1||t>=this.dim+1)throw RangeError(`out of range source coordinates for DEM data`);return(t+1)*this.stride+(e+1)},eu.prototype._unpackMapbox=function(e,t,n){return(256*e*256+256*t+n)/10-1e4},eu.prototype._unpackTerrarium=function(e,t,n){return 256*e+t+n/256-32768},eu.prototype.getPixels=function(){return new wo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},eu.prototype.backfillBorder=function(e,t,n){if(this.dim!==e.dim)throw Error(`dem dimension mismatch`);var r=t*this.dim,i=t*this.dim+this.dim,a=n*this.dim,o=n*this.dim+this.dim;switch(t){case-1:r=i-1;break;case 1:i=r+1}switch(n){case-1:a=o-1;break;case 1:o=a+1}for(var s=-t*this.dim,c=-n*this.dim,l=a;l=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},au.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ts.VectorTile(new tc(this.rawTileData)).layers,this.sourceLayerCoder=new tu(this.vtLayers?Object.keys(this.vtLayers).sort():[`_geojsonTileLayer`])),this.vtLayers},au.prototype.query=function(e,t,n,r){var a=this;this.loadVTLayers();for(var o=e.params||{},s=8192/e.tileSize/e.scale,c=mr(o.filter),l=e.queryGeometry,u=e.queryPadding*s,d=su(l),f=this.grid.query(d.minX-u,d.minY-u,d.maxX+u,d.maxY+u),p=su(e.cameraQueryGeometry),m=this.grid3D.query(p.minX-u,p.minY-u,p.maxX+u,p.maxY+u,(function(t,n,r,a){return function(e,t,n,r,a){for(var o=0,s=e;o=c.x&&a>=c.y)return!0}var l=[new i(t,n),new i(t,a),new i(r,a),new i(r,n)];if(e.length>2){for(var u=0,d=l;u=0)return!0;return!1}(a,d)){var p=this.sourceLayerCoder.decode(n),m=this.vtLayers[p].feature(r);if(i.needGeometry){var h=Ga(m,!0);if(!i.filter(new fi(this.tileID.overscaledZ),h,this.tileID.canonical))return}else if(!i.filter(new fi(this.tileID.overscaledZ),m))return;for(var g=this.getId(m,p),_=0;_r)i=!1;else if(t)if(this.expirationTimeH&&(e.getActor().send(`enforceCacheSizeLimit`,V),Ce=0)},e.clamp=u,e.clearTileCache=function(e){var t=o.caches.delete(`mapbox-tiles`);e&&t.catch(e).then((function(){return e()}))},e.clipLine=Zc,e.clone=function(e){var t=new uo(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.clone$1=x,e.clone$2=function(e){var t=new uo(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.collisionCircleLayout=Xs,e.config=ne,e.create=function(){var e=new uo(16);return uo!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.create$1=function(){var e=new uo(9);return uo!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},e.create$2=function(){var e=new uo(4);return uo!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},e.createCommonjsModule=t,e.createExpression=tr,e.createLayout=ji,e.createStyleLayer=function(e){return e.type===`custom`?new Al(e):new jl[e.type](e)},e.cross=function(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],c=n[2];return e[0]=i*c-a*s,e[1]=a*o-r*c,e[2]=r*s-i*o,e},e.deepEqual=function e(t,n){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var r=0;r0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e},e.number=Qt,e.offscreenCanvasSupported=we,e.ortho=function(e,t,n,r,i,a,o){var s=1/(t-n),c=1/(r-i),l=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*c,e[14]=(o+a)*l,e[15]=1,e},e.parseGlyphPBF=function(e){return new tc(e).readFields(yc,[])},e.pbf=tc,e.performSymbolLayout=function(e,t,n,r,i,a,o){e.createArrays(),e.tilePixelRatio=8192/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var s=e.layers[0].layout,c=e.layers[0]._unevaluatedLayout._values,l={};if(e.textSizeData.kind===`composite`){var u=e.textSizeData,d=u.maxZoom;l.compositeTextSizes=[c[`text-size`].possiblyEvaluate(new fi(u.minZoom),o),c[`text-size`].possiblyEvaluate(new fi(d),o)]}if(e.iconSizeData.kind===`composite`){var f=e.iconSizeData,p=f.maxZoom;l.compositeIconSizes=[c[`icon-size`].possiblyEvaluate(new fi(f.minZoom),o),c[`icon-size`].possiblyEvaluate(new fi(p),o)]}l.layoutTextSize=c[`text-size`].possiblyEvaluate(new fi(e.zoom+1),o),l.layoutIconSize=c[`icon-size`].possiblyEvaluate(new fi(e.zoom+1),o),l.textMaxSize=c[`text-size`].possiblyEvaluate(new fi(18));for(var m=24*s.get(`text-line-height`),h=s.get(`text-rotation-alignment`)===`map`&&s.get(`symbol-placement`)!==`point`,g=s.get(`text-keep-upright`),_=s.get(`text-size`),v=function(){var a=b[y],c=s.get(`text-font`).evaluate(a,{},o).join(`,`),u=_.evaluate(a,{},o),d=l.layoutTextSize.evaluate(a,{},o),f=l.layoutIconSize.evaluate(a,{},o),p={horizontal:{},vertical:void 0},v=a.text,x=[0,0];if(v){var S=v.toString(),w=24*s.get(`text-letter-spacing`).evaluate(a,{},o),T=function(e){for(var t=0,n=e;t=8192||d.y<0||d.y>=8192||function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,w,T){var E,D,O,k,A,j=e.addToLineVertexArray(t,n),M=0,N=0,P=0,ee=0,F=-1,I=-1,te={},ne=_a(``),re=0,ie=0;if(s._unevaluatedLayout.getValue(`text-radial-offset`)===void 0?(re=(E=s.layout.get(`text-offset`).evaluate(b,{},w).map((function(e){return 24*e})))[0],ie=E[1]):(re=24*s.layout.get(`text-radial-offset`).evaluate(b,{},w),ie=ll),e.allowVerticalPlacement&&r.vertical){var ae=s.layout.get(`text-rotate`).evaluate(b,{},w)+90;k=new rl(c,t,l,u,d,r.vertical,f,p,m,ae),o&&(A=new rl(c,t,l,u,d,o,g,_,m,ae))}if(i){var L=s.layout.get(`icon-rotate`).evaluate(b,{}),oe=s.layout.get(`icon-text-fit`)!==`none`,se=Qc(i,L,S,oe),ce=o?Qc(o,L,S,oe):void 0;O=new rl(c,t,l,u,d,i,g,_,!1,L),M=4*se.length;var le=e.iconSizeData,ue=null;le.kind===`source`?(ue=[128*s.layout.get(`icon-size`).evaluate(b,{})])[0]>32640&&C(e.layerIds[0]+`: Value for "icon-size" is >= 255. Reduce your "icon-size".`):le.kind===`composite`&&((ue=[128*x.compositeIconSizes[0].evaluate(b,{},w),128*x.compositeIconSizes[1].evaluate(b,{},w)])[0]>32640||ue[1]>32640)&&C(e.layerIds[0]+`: Value for "icon-size" is >= 255. Reduce your "icon-size".`),e.addSymbols(e.icon,se,ue,y,v,b,!1,t,j.lineStartIndex,j.lineLength,-1,w),F=e.icon.placedSymbolArray.length-1,ce&&(N=4*ce.length,e.addSymbols(e.icon,ce,ue,y,v,b,Ec.vertical,t,j.lineStartIndex,j.lineLength,-1,w),I=e.icon.placedSymbolArray.length-1)}for(var de in r.horizontal){var fe=r.horizontal[de];D||=(ne=_a(fe.text),new rl(c,t,l,u,d,fe,f,p,m,s.layout.get(`text-rotate`).evaluate(b,{},w)));var pe=fe.positionedLines.length===1;if(P+=fl(e,t,fe,a,s,m,b,h,j,r.vertical?Ec.horizontal:Ec.horizontalOnly,pe?Object.keys(r.horizontal):[de],te,F,x,w),pe)break}r.vertical&&(ee+=fl(e,t,r.vertical,a,s,m,b,h,j,Ec.vertical,[`vertical`],te,I,x,w));var me=D?D.boxStartIndex:e.collisionBoxArray.length,R=D?D.boxEndIndex:e.collisionBoxArray.length,z=k?k.boxStartIndex:e.collisionBoxArray.length,he=k?k.boxEndIndex:e.collisionBoxArray.length,ge=O?O.boxStartIndex:e.collisionBoxArray.length,_e=O?O.boxEndIndex:e.collisionBoxArray.length,ve=A?A.boxStartIndex:e.collisionBoxArray.length,B=A?A.boxEndIndex:e.collisionBoxArray.length,ye=-1,V=function(e,t){return e&&e.circleDiameter?Math.max(e.circleDiameter,t):t};ye=V(D,ye),ye=V(k,ye),ye=V(O,ye);var H=+((ye=V(A,ye))>-1);H&&(ye*=T/24),e.glyphOffsetArray.length>=Sl.MAX_GLYPHS&&C(`Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907`),b.sortKey!==void 0&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,te.right>=0?te.right:-1,te.center>=0?te.center:-1,te.left>=0?te.left:-1,te.vertical||-1,F,I,ne,me,R,z,he,ge,_e,ve,B,l,P,ee,M,N,H,0,f,re,ie,ye)}(e,d,s,n,r,i,f,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,_,x,T,c,y,S,E,m,t,a,l,u,o)};if(D===`line`)for(var j=0,M=Zc(t.geometry,0,0,8192,8192);j1){var re=Yc(ne,w,n.vertical||h,r,24,v);re&&A(ne,re)}}else if(t.type===`Polygon`)for(var ie=0,ae=cs(t.geometry,0);ie=O.maxzoom||O.visibility!==`none`&&(o(D,this.zoom,r),(h[O.id]=O.createBucket({index:u.bucketLayerIDs.length,layers:D,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(x,g,this.tileID.canonical),u.bucketLayerIDs.push(D.map((function(e){return e.id}))))}}}var k=e.mapObject(g.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(k).length?a.send(`getGlyphs`,{uid:this.uid,stacks:k},(function(e,t){d||(d=e,f=t,M.call(c))})):f={};var A=Object.keys(g.iconDependencies);A.length?a.send(`getImages`,{icons:A,source:this.source,tileID:this.tileID,type:`icons`},(function(e,t){d||(d=e,p=t,M.call(c))})):p={};var j=Object.keys(g.patternDependencies);function M(){if(d)return s(d);if(f&&p&&m){var t=new i(f),n=new e.ImageAtlas(p,m);for(var a in h){var c=h[a];c instanceof e.SymbolBucket?(o(c.layers,this.zoom,r),e.performSymbolLayout(c,f,t.positions,p,n.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):c.hasPattern&&(c instanceof e.LineBucket||c instanceof e.FillBucket||c instanceof e.FillExtrusionBucket)&&(o(c.layers,this.zoom,r),c.addFeatures(g,this.tileID.canonical,n.patternPositions))}this.status=`done`,s(null,{buckets:e.values(h).filter((function(e){return!e.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:n,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?t.positions:null})}}j.length?a.send(`getImages`,{icons:j,source:this.source,tileID:this.tileID,type:`patterns`},(function(e,t){d||(d=e,m=t,M.call(c))})):m={},M.call(this)};var c=function(e,t,n,r){this.actor=e,this.layerIndex=t,this.availableImages=n,this.loadVectorData=r||s,this.loading={},this.loaded={}};c.prototype.loadTile=function(t,n){var r=this,i=t.uid;this.loading||={};var o=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request),s=this.loading[i]=new a(t);s.abort=this.loadVectorData(t,(function(t,a){if(delete r.loading[i],t||!a)return s.status=`done`,r.loaded[i]=s,n(t);var c=a.rawData,l={};a.expires&&(l.expires=a.expires),a.cacheControl&&(l.cacheControl=a.cacheControl);var u={};if(o){var d=o.finish();d&&(u.resourceTiming=JSON.parse(JSON.stringify(d)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,r.layerIndex,r.availableImages,r.actor,(function(t,r){if(t||!r)return n(t);n(null,e.extend({rawTileData:c.slice(0)},r,l,u))})),r.loaded=r.loaded||{},r.loaded[i]=s}))},c.prototype.reloadTile=function(e,t){var n=this,r=this.loaded,i=e.uid,a=this;if(r&&r[i]){var o=r[i];o.showCollisionBoxes=e.showCollisionBoxes;var s=function(e,r){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,n.availableImages,a.actor,i)),t(e,r)};o.status===`parsing`?o.reloadCallback=s:o.status===`done`&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},c.prototype.abortTile=function(e,t){var n=this.loading,r=e.uid;n&&n[r]&&n[r].abort&&(n[r].abort(),delete n[r]),t()},c.prototype.removeTile=function(e,t){var n=this.loaded,r=e.uid;n&&n[r]&&delete n[r],t()};var l=e.window.ImageBitmap,u=function(){this.loaded={}};function d(e,t){if(e.length!==0){f(e[0],t);for(var n=1;n=Math.abs(s)?n-c+s:s-c+n,n=c}n+r>=0!=!!t&&e.reverse()}u.prototype.loadTile=function(t,n){var r=t.uid,i=t.encoding,a=t.rawImageData,o=l&&a instanceof l?this.getImageData(a):a,s=new e.DEMData(r,o,i);this.loaded=this.loaded||{},this.loaded[r]=s,n(null,s)},u.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext(`2d`)),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var n=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:n.width,height:n.height},n.data)},u.prototype.removeTile=function(e){var t=this.loaded,n=e.uid;t&&t[n]&&delete t[n]};var p=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,`id`in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};m.prototype.loadGeometry=function(){if(this._feature.type===1){for(var t=[],n=0,r=this._feature.geometry;n>31}function O(e,t){for(var n=e.loadGeometry(),r=e.type,i=0,a=0,o=n.length,s=0;s>1;(function e(t,n,r,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,c=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),d=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1);e(t,n,r,Math.max(i,Math.floor(r-c*u/s+d)),Math.min(a,Math.floor(r+(s-c)*u/s+d)),o)}var f=n[2*r+o],p=i,m=a;for(A(t,n,i,r),n[2*a+o]>f&&A(t,n,i,a);pf;)m--}n[2*i+o]===f?A(t,n,i,m):A(t,n,++m,a),m<=r&&(i=m+1),r<=m&&(a=m-1)}})(t,n,s,i,a,o%2),e(t,n,r,i,s-1,o+1),e(t,n,r,s+1,a,o+1)}})(o,s,r,0,o.length-1,0)};ee.prototype.range=function(e,t,n,r){return function(e,t,n,r,i,a,o){for(var s,c,l=[0,e.length-1,0],u=[];l.length;){var d=l.pop(),f=l.pop(),p=l.pop();if(f-p<=o)for(var m=p;m<=f;m++)c=t[2*m+1],(s=t[2*m])>=n&&s<=i&&c>=r&&c<=a&&u.push(e[m]);else{var h=Math.floor((p+f)/2);c=t[2*h+1],(s=t[2*h])>=n&&s<=i&&c>=r&&c<=a&&u.push(e[h]);var g=(d+1)%2;(d===0?n<=s:r<=c)&&(l.push(p),l.push(h-1),l.push(g)),(d===0?i>=s:a>=c)&&(l.push(h+1),l.push(f),l.push(g))}}return u}(this.ids,this.coords,e,t,n,r,this.nodeSize)},ee.prototype.within=function(e,t,n){return function(e,t,n,r,i,a){for(var o=[0,e.length-1,0],s=[],c=i*i;o.length;){var l=o.pop(),u=o.pop(),d=o.pop();if(u-d<=a)for(var f=d;f<=u;f++)M(t[2*f],t[2*f+1],n,r)<=c&&s.push(e[f]);else{var p=Math.floor((d+u)/2),m=t[2*p],h=t[2*p+1];M(m,h,n,r)<=c&&s.push(e[p]);var g=(l+1)%2;(l===0?n-i<=m:r-i<=h)&&(o.push(d),o.push(p-1),o.push(g)),(l===0?n+i>=m:r+i>=h)&&(o.push(p+1),o.push(u),o.push(g))}}return s}(this.ids,this.coords,e,t,n,this.nodeSize)};var F={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},I=function(e){this.options=oe(Object.create(F),e),this.trees=Array(this.options.maxZoom+1)};function te(e,t,n,r,i){return{x:e,y:t,zoom:1/0,id:n,parentId:-1,numPoints:r,properties:i}}function ne(e,t){var n=e.geometry.coordinates,r=n[1];return{x:ae(n[0]),y:L(r),zoom:1/0,index:t,parentId:-1}}function re(e){return{type:`Feature`,id:e.id,properties:ie(e),geometry:{type:`Point`,coordinates:[(r=e.x,360*(r-.5)),(t=e.y,n=(180-360*t)*Math.PI/180,360*Math.atan(Math.exp(n))/Math.PI-90)]}};var t,n,r}function ie(e){var t=e.numPoints,n=t>=1e4?Math.round(t/1e3)+`k`:t>=1e3?Math.round(t/100)/10+`k`:t;return oe(oe({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:n})}function ae(e){return e/360+.5}function L(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function oe(e,t){for(var n in t)e[n]=t[n];return e}function se(e){return e.x}function ce(e){return e.y}function le(e,t,n,r,i,a){var o=i-n,s=a-r;if(o!==0||s!==0){var c=((e-n)*o+(t-r)*s)/(o*o+s*s);c>1?(n=i,r=a):c>0&&(n+=o*c,r+=s*c)}return(o=e-n)*o+(s=t-r)*s}function ue(e,t,n,r){var i={id:e===void 0?null:e,type:t,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,n=e.type;if(n===`Point`||n===`MultiPoint`||n===`LineString`)de(e,t);else if(n===`Polygon`||n===`MultiLineString`)for(var r=0;r0&&(o+=r?(i*l-c*a)/2:Math.sqrt((c-i)**2+(l-a)**2)),i=c,a=l}var u=t.length-3;t[2]=1,function e(t,n,r,i){for(var a,o=i,s=r-n>>1,c=r-n,l=t[n],u=t[n+1],d=t[r],f=t[r+1],p=n+3;po)a=p,o=m;else if(m===o){var h=Math.abs(p-s);hi&&(a-n>3&&e(t,n,a,i),t[a+2]=o,r-a>3&&e(t,a,r,i))}(t,0,u,n),t[u+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function R(e,t,n,r){for(var i=0;i1?1:n}function ge(e,t,n,r,i,a,o,s){if(r/=t,a>=(n/=t)&&o=r)return null;for(var c=[],l=0;l=n&&m=r)){var h=[];if(f===`Point`||f===`MultiPoint`)_e(d,h,n,r,i);else if(f===`LineString`)ve(d,h,n,r,i,!1,s.lineMetrics);else if(f===`MultiLineString`)ye(d,h,n,r,i,!1);else if(f===`Polygon`)ye(d,h,n,r,i,!0);else if(f===`MultiPolygon`)for(var g=0;g=n&&o<=r&&(t.push(e[a]),t.push(e[a+1]),t.push(e[a+2]))}}function ve(e,t,n,r,i,a,o){for(var s,c,l=B(e),u=i===0?H:be,d=e.start,f=0;fn&&(c=u(l,p,m,g,_,n),o&&(l.start=d+s*c)):v>r?y=n&&(c=u(l,p,m,g,_,n),b=!0),y>r&&v<=r&&(c=u(l,p,m,g,_,r),b=!0),!a&&b&&(o&&(l.end=d+s*c),t.push(l),l=B(e)),o&&(d+=s)}var x=e.length-3;p=e[x],m=e[x+1],h=e[x+2],(v=i===0?p:m)>=n&&v<=r&&V(l,p,m,h),x=l.length-3,a&&x>=3&&(l[x]!==l[0]||l[x+1]!==l[1])&&V(l,l[0],l[1],l[2]),l.length&&t.push(l)}function B(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ye(e,t,n,r,i,a){for(var o=0;oo.maxX&&(o.maxX=u),d>o.maxY&&(o.maxY=d)}return o}function Ee(e,t,n,r){var i=t.geometry,a=t.type,o=[];if(a===`Point`||a===`MultiPoint`)for(var s=0;s0&&t.size<(i?o:r))n.numPoints+=t.length/3;else{for(var s=[],c=0;co)&&(n.numSimplified++,s.push(t[c]),s.push(t[c+1])),n.numPoints++;i&&function(e,t){for(var n=0,r=0,i=e.length,a=i-2;r0===t)for(r=0,i=e.length;r24)throw Error(`maxZoom should be in the 0-24 range`);if(t.promoteId&&t.generateId)throw Error(`promoteId and generateId cannot be used together.`);var r=function(e,t){var n=[];if(e.type===`FeatureCollection`)for(var r=0;r=r;l--){var u=+Date.now();s=this._cluster(s,l),this.trees[l]=new ee(s,se,ce,a,Float32Array),n&&console.log(`z%d: %d clusters in %dms`,l,s.length,+Date.now()-u)}return n&&console.timeEnd(`total time`),this},I.prototype.getClusters=function(e,t){var n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){var o=this.getClusters([n,r,180,a],t),s=this.getClusters([-180,r,i,a],t);return o.concat(s)}for(var c=this.trees[this._limitZoom(t)],l=[],u=0,d=c.range(ae(n),L(a),ae(i),L(r));ut&&(f+=h.numPoints||1)}if(f>=a){for(var g=c.x*d,_=c.y*d,v=i&&d>1?this._map(c,!0):null,y=(s<<5)+(t+1)+this.points.length,b=0,x=u;b1)for(var w=0,T=u;w>5},I.prototype._getOriginZoom=function(e){return(e-this.points.length)%32},I.prototype._map=function(e,t){if(e.numPoints)return t?oe({},e.properties):e.properties;var n=this.points[e.index].properties,r=this.options.map(n);return t&&r===n?oe({},r):r},Oe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Oe.prototype.splitTile=function(e,t,n,r,i,a,o){for(var s=[e,t,n,r],c=this.options,l=c.debug;s.length;){r=s.pop(),n=s.pop(),t=s.pop(),e=s.pop();var u=1<1&&console.time(`creation`),f=this.tiles[d]=Te(e,t,n,r,c),this.tileCoords.push({z:t,x:n,y:r}),l)){l>1&&(console.log(`tile z%d-%d-%d (features: %d, points: %d, simplified: %d)`,t,n,r,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd(`creation`));var p=`z`+t;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(f.source=e,i){if(t===c.maxZoom||t===i)continue;var m=1<1&&console.time(`clipping`);var h,g,_,v,y,b,x=.5*c.buffer/c.extent,S=.5-x,C=.5+x,w=1+x;h=g=_=v=null,y=ge(e,u,n-x,n+C,0,f.minX,f.maxX,c),b=ge(e,u,n+S,n+w,0,f.minX,f.maxX,c),e=null,y&&=(h=ge(y,u,r-x,r+C,1,f.minY,f.maxY,c),g=ge(y,u,r+S,r+w,1,f.minY,f.maxY,c),null),b&&=(_=ge(b,u,r-x,r+C,1,f.minY,f.maxY,c),v=ge(b,u,r+S,r+w,1,f.minY,f.maxY,c),null),l>1&&console.timeEnd(`clipping`),s.push(h||[],t+1,2*n,2*r),s.push(g||[],t+1,2*n,2*r+1),s.push(_||[],t+1,2*n+1,2*r),s.push(v||[],t+1,2*n+1,2*r+1)}}},Oe.prototype.getTile=function(e,t,n){var r=this.options,i=r.extent,a=r.debug;if(e<0||e>24)return null;var o=1<1&&console.log(`drilling down to z%d-%d-%d`,e,t,n);for(var c,l=e,u=t,d=n;!c&&l>0;)l--,u=Math.floor(u/2),d=Math.floor(d/2),c=this.tiles[ke(l,u,d)];return c&&c.source?(a>1&&console.log(`found parent tile z%d-%d-%d`,l,u,d),a>1&&console.time(`drilling down`),this.splitTile(c.source,l,u,d,e,t,n),a>1&&console.timeEnd(`drilling down`),this.tiles[s]?Ce(this.tiles[s],i):null):null};var je=function(t){function n(e,n,r,i){t.call(this,e,n,r,Ae),i&&(this.loadGeoJSON=i)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&this._state!==`Idle`?this._state=`NeedsLoadData`:(this._state=`Coalescing`,this._loadData())},n.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var n=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(r&&r.request&&r.request.collectResourceTiming)&&new e.RequestPerformance(r.request);this.loadGeoJSON(r,(function(a,o){if(a||!o)return n(a);if(typeof o!=`object`)return n(Error(`Input data given to '`+r.source+`' is not a valid GeoJSON object.`));(function e(t,n){var r,i=t&&t.type;if(i===`FeatureCollection`)for(r=0;r`u`||typeof document>`u`?`not a browser`:Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?`JSON`in window&&`parse`in JSON&&`stringify`in JSON?function(){if(!(`Worker`in window&&`Blob`in window&&`URL`in window))return!1;var e,t,n=new Blob([``],{type:`text/javascript`}),r=URL.createObjectURL(n);try{t=new Worker(r),e=!0}catch{e=!1}return t&&t.terminate(),URL.revokeObjectURL(r),e}()?`Uint8ClampedArray`in window?ArrayBuffer.isView?function(){var e=document.createElement(`canvas`);e.width=e.height=1;var t=e.getContext(`2d`);if(!t)return!1;var n=t.getImageData(0,0,1,1);return n&&n.width===e.width}()?(r[n=e&&e.failIfMajorPerformanceCaveat]===void 0&&(r[n]=function(e){var n=function(e){var n=document.createElement(`canvas`),r=Object.create(t.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=e,n.probablySupportsContext?n.probablySupportsContext(`webgl`,r)||n.probablySupportsContext(`experimental-webgl`,r):n.supportsContext?n.supportsContext(`webgl`,r)||n.supportsContext(`experimental-webgl`,r):n.getContext(`webgl`,r)||n.getContext(`experimental-webgl`,r)}(e);if(!n)return!1;var r=n.createShader(n.VERTEX_SHADER);return!(!r||n.isContextLost())&&(n.shaderSource(r,`void main() {}`),n.compileShader(r),!0===n.getShaderParameter(r,n.COMPILE_STATUS))}(n)),r[n]?void 0:`insufficient WebGL support`):`insufficient Canvas/getImageData support`:`insufficient ArrayBuffer support`:`insufficient Uint8ClampedArray support`:`insufficient worker support`:`insufficient JSON support`:`insufficient Object support`:`insufficient Function support`:`insufficent Array support`;var n}e.exports?e.exports=t:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=t,window.mapboxgl.notSupportedReason=n);var r={};t.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),n={create:function(t,n,r){var i=e.window.document.createElement(t);return n!==void 0&&(i.className=n),r&&r.appendChild(i),i},createNS:function(t,n){return e.window.document.createElementNS(t,n)}},r=e.window.document&&e.window.document.documentElement.style;function i(e){if(!r)return e[0];for(var t=0;t=0?0:t.button},n.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var f=function(t){function n(){t.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.isLoaded=function(){return this.loaded},n.prototype.setLoaded=function(e){if(this.loaded!==e&&(this.loaded=e,e)){for(var t=0,n=this.requestors;t=0?1.2:1))}function _(e,t,n,r,i,a,o){for(var s=0;s65535)t(Error(`glyphs > 65535 not supported`));else if(a.ranges[s])t(null,{stack:n,id:i,glyph:o});else{var c=a.requests[s];c||(c=a.requests[s]=[],y.loadGlyphRange(n,s,r.url,r.requestManager,(function(e,t){if(t){for(var n in t)r._doesCharSupportLocalGlyph(+n)||(a.glyphs[+n]=t[+n]);a.ranges[s]=!0}for(var i=0,o=c;i1&&(s=e[++o]);var l=Math.abs(c-s.left),u=Math.abs(c-s.right),d=Math.min(l,u),f=void 0,p=i/n*(r+1);if(s.isDash){var m=r-Math.abs(p);f=Math.sqrt(d*d+m*m)}else f=r-Math.sqrt(d*d+p*p);this.data[a+c]=Math.max(0,Math.min(255,f+128))}},C.prototype.addRegularDash=function(e){for(var t=e.length-1;t>=0;--t){var n=e[t],r=e[t+1];n.zeroLength?e.splice(t,1):r&&r.isDash===n.isDash&&(r.left=n.left,e.splice(t,1))}var i=e[0],a=e[e.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,c=e[s],l=0;l1&&(c=e[++s]);var u=Math.abs(l-c.left),d=Math.abs(l-c.right),f=Math.min(u,d);this.data[o+l]=Math.max(0,Math.min(255,(c.isDash?f:-f)+128))}},C.prototype.addDash=function(t,n){var r=n?7:0,i=2*r+1;if(this.nextRow+i>this.height)return e.warnOnce(`LineAtlas out of space`),null;for(var a=0,o=0;o=r&&t.x=i&&t.y0&&(c[new e.OverscaledTileID(t.overscaledZ,a,n.z,i,n.y-1).key]={backfilled:!1},c[new e.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},c[new e.OverscaledTileID(t.overscaledZ,s,n.z,o,n.y-1).key]={backfilled:!1}),n.y+10&&(r.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new e.Event(`data`,r))}}))},n.prototype.onAdd=function(e){this.map=e,this.load()},n.prototype.setData=function(t){var n=this;return this._data=t,this.fire(new e.Event(`dataloading`,{dataType:`source`})),this._updateWorkerData((function(t){if(t)n.fire(new e.ErrorEvent(t));else{var r={dataType:`source`,sourceDataType:`content`};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(r.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new e.Event(`data`,r))}})),this},n.prototype.getClusterExpansionZoom=function(e,t){return this.actor.send(`geojson.getClusterExpansionZoom`,{clusterId:e,source:this.id},t),this},n.prototype.getClusterChildren=function(e,t){return this.actor.send(`geojson.getClusterChildren`,{clusterId:e,source:this.id},t),this},n.prototype.getClusterLeaves=function(e,t,n,r){return this.actor.send(`geojson.getClusterLeaves`,{source:this.id,clusterId:e,limit:t,offset:n},r),this},n.prototype._updateWorkerData=function(t){var n=this;this._loaded=!1;var r=e.extend({},this.workerOptions),i=this._data;typeof i==`string`?(r.request=this.map._requestManager.transformRequest(e.browser.resolveURL(i),e.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(i),this.actor.send(this.type+`.loadData`,r,(function(e,i){n._removed||i&&i.abandoned||(n._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[n.id]&&(n._resourceTiming=i.resourceTiming[n.id].slice(0)),n.actor.send(n.type+`.coalesce`,{source:r.source},null),t(e))}))},n.prototype.loaded=function(){return this._loaded},n.prototype.loadTile=function(t,n){var r=this,i=t.actor?`reloadTile`:`loadTile`;t.actor=this.actor,t.request=this.actor.send(i,{type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(e,a){return delete t.request,t.unloadVectorData(),t.aborted?n(null):e?n(e):(t.loadVectorData(a,r.map.painter,i===`reloadTile`),n(null))}))},n.prototype.abortTile=function(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0},n.prototype.unloadTile=function(e){e.unloadVectorData(),this.actor.send(`removeTile`,{uid:e.uid,type:this.type,source:this.id})},n.prototype.onRemove=function(){this._removed=!0,this.actor.send(`removeSource`,{type:this.type,source:this.id})},n.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},n.prototype.hasTransition=function(){return!1},n}(e.Evented),j=e.createLayout([{name:`a_pos`,type:`Int16`,components:2},{name:`a_texture_pos`,type:`Int16`,components:2}]),M=function(t){function n(e,n,r,i){t.call(this),this.id=e,this.dispatcher=r,this.coordinates=n.coordinates,this.type=`image`,this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=n}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.load=function(t,n){var r=this;this._loaded=!1,this.fire(new e.Event(`dataloading`,{dataType:`source`})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),(function(i,a){r._loaded=!0,i?r.fire(new e.ErrorEvent(i)):a&&(r.image=a,t&&(r.coordinates=t),n&&n(),r._finishLoading())}))},n.prototype.loaded=function(){return this._loaded},n.prototype.updateImage=function(e){var t=this;return this.image&&e.url?(this.options.url=e.url,this.load(e.coordinates,(function(){t.texture=null})),this):this},n.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event(`data`,{dataType:`source`,sourceDataType:`metadata`})))},n.prototype.onAdd=function(e){this.map=e,this.load()},n.prototype.setCoordinates=function(t){var n=this;this.coordinates=t;var r=t.map(e.MercatorCoordinate.fromLngLat);this.tileID=function(t){for(var n=1/0,r=1/0,i=-1/0,a=-1/0,o=0,s=t;on.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError(`sources.`+this.id,null,`Playback for this video can be set only between the `+n.start(0)+` and `+n.end(0)+`-second mark.`))):this.video.currentTime=t}},n.prototype.getVideo=function(){return this.video},n.prototype.onAdd=function(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},n.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var t=this.map.painter.context,n=t.gl;for(var r in this.boundsBuffer||=t.createVertexBuffer(this._boundsArray,j.members),this.boundsSegments||=e.SegmentVector.simpleSegment(0,0,4,2),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[r];i.state!==`loaded`&&(i.state=`loaded`,i.texture=this.texture)}}},n.prototype.serialize=function(){return{type:`video`,urls:this.urls,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this.video&&!this.video.paused},n}(M),image:M,canvas:function(t){function n(n,r,i,a){t.call(this,n,r,i,a),r.coordinates?Array.isArray(r.coordinates)&&r.coordinates.length===4&&!r.coordinates.some((function(e){return!Array.isArray(e)||e.length!==2||e.some((function(e){return typeof e!=`number`}))}))||this.fire(new e.ErrorEvent(new e.ValidationError(`sources.`+n,null,`"coordinates" property must be an array of 4 longitude/latitude array pairs`))):this.fire(new e.ErrorEvent(new e.ValidationError(`sources.`+n,null,`missing required property "coordinates"`))),r.animate&&typeof r.animate!=`boolean`&&this.fire(new e.ErrorEvent(new e.ValidationError(`sources.`+n,null,`optional "animate" property must be a boolean value`))),r.canvas?typeof r.canvas==`string`||r.canvas instanceof e.window.HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError(`sources.`+n,null,`"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance`))):this.fire(new e.ErrorEvent(new e.ValidationError(`sources.`+n,null,`missing required property "canvas"`))),this.options=r,this.animate=r.animate===void 0||r.animate}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.load=function(){this._loaded=!0,this.canvas||=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.ErrorEvent(Error(`Canvas dimensions cannot be less than or equal to zero.`))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&=(this.prepare(),!1)},this._finishLoading())},n.prototype.getCanvas=function(){return this.canvas},n.prototype.onAdd=function(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()},n.prototype.onRemove=function(){this.pause()},n.prototype.prepare=function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var n=this.map.painter.context,r=n.gl;for(var i in this.boundsBuffer||=n.createVertexBuffer(this._boundsArray,j.members),this.boundsSegments||=e.SegmentVector.simpleSegment(0,0,4,2),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(n,this.canvas,r.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];a.state!==`loaded`&&(a.state=`loaded`,a.texture=this.texture)}}},n.prototype.serialize=function(){return{type:`canvas`,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this._playing},n.prototype._hasInvalidDimensions=function(){for(var e=0,t=[this.canvas.width,this.canvas.height];ethis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},I.prototype.has=function(e){return e.wrapped().key in this.data},I.prototype.getAndRemove=function(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null},I.prototype._getAndRemoveByKey=function(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value},I.prototype.getByKey=function(e){var t=this.data[e];return t?t[0].value:null},I.prototype.get=function(e){return this.has(e)?this.data[e.wrapped().key][0].value:null},I.prototype.remove=function(e,t){if(!this.has(e))return this;var n=e.wrapped().key,r=t===void 0?0:this.data[n].indexOf(t),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(i.value),this.order.splice(this.order.indexOf(n),1),this},I.prototype.setMaxSize=function(e){for(this.max=e;this.order.length>this.max;){var t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this},I.prototype.filter=function(e){var t=[];for(var n in this.data)for(var r=0,i=this.data[n];r1||(Math.abs(n)>1&&(Math.abs(n+i)===1?n+=i:Math.abs(n-i)===1&&(n-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,n,r),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}},n.prototype.getTile=function(e){return this.getTileByID(e.key)},n.prototype.getTileByID=function(e){return this._tiles[e]},n.prototype._retainLoadedChildren=function(e,t,n,r){for(var i in this._tiles){var a=this._tiles[i];if(!(r[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>n)){for(var o=a.tileID;a&&a.tileID.overscaledZ>t+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var c=o;c.overscaledZ>t;)if(e[(c=c.scaledTo(c.overscaledZ-1)).key]){r[o.key]=o;break}}}},n.prototype.findLoadedParent=function(e,t){if(e.key in this._loadedParentTiles){var n=this._loadedParentTiles[e.key];return n&&n.tileID.overscaledZ>=t?n:null}for(var r=e.overscaledZ-1;r>=t;r--){var i=e.scaledTo(r),a=this._getLoadedTile(i);if(a)return a}},n.prototype._getLoadedTile=function(e){var t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)},n.prototype.updateCacheSize=function(e){var t=Math.ceil(e.width/this._source.tileSize)+1,n=Math.ceil(e.height/this._source.tileSize)+1,r=Math.floor(t*n*5),i=typeof this._maxTileCacheSize==`number`?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(i)},n.prototype.handleWrapJump=function(e){var t=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,t){var n={};for(var r in this._tiles){var i=this._tiles[r];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),n[i.tileID.key]=i}for(var a in this._tiles=n,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var o in this._tiles)this._setTileReloadTimer(o,this._tiles[o])}},n.prototype.update=function(t){var r=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(t){return new e.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)})):(i=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(e){return r._source.hasTile(e)})))):i=[];var a=t.coveringZoomLevel(this._source),o=Math.max(a-n.maxOverzooming,this._source.minzoom),s=Math.max(a+n.maxUnderzooming,this._source.minzoom),c=this._updateRetainedTiles(i,a);if(ze(this._source.type)){for(var l={},u={},d=0,f=Object.keys(c);dthis._source.maxzoom){var g=m.children(this._source.maxzoom)[0],_=this.getTile(g);if(_&&_.hasData()){r[g.key]=g;continue}}else{var v=m.children(this._source.maxzoom);if(r[v[0].key]&&r[v[1].key]&&r[v[2].key]&&r[v[3].key])continue}for(var y=h.wasRequested(),b=m.overscaledZ-1;b>=a;--b){var x=m.scaledTo(b);if(i[x.key]||(i[x.key]=!0,!(h=this.getTile(x))&&y&&(h=this._addTile(x)),h&&(r[x.key]=x,y=h.wasRequested(),h.hasData())))break}}}return r},n.prototype._updateLoadedParentTileCache=function(){for(var e in this._loadedParentTiles={},this._tiles){for(var t=[],n=void 0,r=this._tiles[e].tileID;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){n=this._loadedParentTiles[r.key];break}t.push(r.key);var i=r.scaledTo(r.overscaledZ-1);if(n=this._getLoadedTile(i))break;r=i}for(var a=0,o=t;a0||(t.hasData()&&t.state!==`reloading`?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))},n.prototype.clearTiles=function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(e);this._cache.reset()},n.prototype.tilesIn=function(t,n,r){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=r?o.getCameraQueryGeometry(t):t,c=t.map((function(e){return o.pointCoordinate(e)})),l=s.map((function(e){return o.pointCoordinate(e)})),u=this.getIds(),d=1/0,f=1/0,p=-1/0,m=-1/0,h=0,g=l;h=0&&_[1].y+g>=0){var v=c.map((function(e){return s.getTilePoint(e)})),y=l.map((function(e){return s.getTilePoint(e)}));a.push({tile:r,tileID:s,queryGeometry:v,cameraQueryGeometry:y,scale:h})}}},y=0;y=e.browser.now())return!0}return!1},n.prototype.setFeatureState=function(e,t,n){this._state.updateState(e||=`_geojsonTileLayer`,t,n)},n.prototype.removeFeatureState=function(e,t,n){this._state.removeFeatureState(e||=`_geojsonTileLayer`,t,n)},n.prototype.getFeatureState=function(e,t){return this._state.getState(e||=`_geojsonTileLayer`,t)},n.prototype.setDependencies=function(e,t,n){var r=this._tiles[e];r&&r.setDependencies(t,n)},n.prototype.reloadTilesForDependencies=function(e,t){for(var n in this._tiles)this._tiles[n].hasDependency(e,t)&&this._reloadTile(n,`reloading`);this._cache.filter((function(n){return!n.hasDependency(e,t)}))},n}(e.Evented);function W(e,t){var n=Math.abs(2*e.wrap)-+(e.wrap<0),r=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||r-n||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function ze(e){return e===`raster`||e===`image`||e===`video`}function Be(){return new e.window.Worker(Qi.workerUrl)}Re.maxOverzooming=10,Re.maxUnderzooming=3;var Ve=`mapboxgl_preloaded_worker_pool`,He=function(){this.active={}};He.prototype.acquire=function(e){if(!this.workers)for(this.workers=[];this.workers.length0?(i-o)/s:0;return this.points[a].mult(1-c).add(this.points[n].mult(c))};var nt=function(e,t,n){var r=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/n),this.yCellCount=Math.ceil(t/n);for(var a=0;a=-t[0]&&n<=t[0]&&r>=-t[1]&&r<=t[1]}function ct(t,n,r,i,a,o,s,c){var l=i?t.textSizeData:t.iconSizeData,u=e.evaluateSizeForZoom(l,r.transform.zoom),d=[256/r.width*2+1,256/r.height*2+1],f=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;f.clear();for(var p=t.lineVertexArray,m=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,h=r.transform.width/r.transform.height,g=!1,_=0;_Math.abs(r.x-n.x)*i?{useVertical:!0}:(t===e.WritingMode.vertical?n.yr.x)?{needsFlipping:!0}:null}function dt(t,n,r,i,a,o,s,c,l,u,d,f,p,m){var h,g=n/24,_=t.lineOffsetX*g,v=t.lineOffsetY*g;if(t.numGlyphs>1){var y=t.glyphStartIndex+t.numGlyphs,b=t.lineStartIndex,x=t.lineStartIndex+t.lineLength,S=lt(g,c,_,v,r,d,f,t,l,o,p);if(!S)return{notEnoughRoom:!0};var C=at(S.first.point,s).point,w=at(S.last.point,s).point;if(i&&!r){var T=ut(t.writingMode,C,w,m);if(T)return T}h=[S.first];for(var E=t.glyphStartIndex+1;E0?A.point:ft(f,k,D,1,a),M=ut(t.writingMode,D,j,m);if(M)return M}var N=pt(g*c.getoffsetX(t.glyphStartIndex),_,v,r,d,f,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,l,o,p);if(!N)return{notEnoughRoom:!0};h=[N]}for(var P=0,ee=h;P0?1:-1,h=0;i&&(m*=-1,h=Math.PI),m<0&&(h+=Math.PI);for(var g=m>0?c+s:c+s+1,_=a,v=a,y=0,b=0,x=Math.abs(p),S=[];y+b<=x;){if((g+=m)=l)return null;if(v=_,S.push(_),(_=f[g])===void 0){var C=new e.Point(u.getx(g),u.gety(g)),w=at(C,d);if(w.signedDistanceFromCamera>0)_=f[g]=w.point;else{var T=g-m;_=ft(y===0?o:new e.Point(u.getx(T),u.gety(T)),C,v,x-y+1,d)}}y+=b,b=v.dist(_)}var E=(x-y)/b,D=_.sub(v),O=D.mult(E)._add(v);O._add(D._unit()._perp()._mult(r*m));var k=h+Math.atan2(_.y-v.y,_.x-v.x);return S.push(O),{point:O,angle:k,path:S}}nt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},nt.prototype.insert=function(e,t,n,r,i){this._forEachCell(t,n,r,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)},nt.prototype.insertCircle=function(e,t,n,r){this._forEachCell(t-r,n-r,t+r,n+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(n),this.circles.push(r)},nt.prototype._insertBoxCell=function(e,t,n,r,i,a){this.boxCells[i].push(a)},nt.prototype._insertCircleCell=function(e,t,n,r,i,a){this.circleCells[i].push(a)},nt.prototype._query=function(e,t,n,r,i,a){if(n<0||e>this.width||r<0||t>this.height)return!i&&[];var o=[];if(e<=0&&t<=0&&this.width<=n&&this.height<=r){if(i)return!0;for(var s=0;s0:o},nt.prototype._queryCircle=function(e,t,n,r,i){var a=e-n,o=e+n,s=t-n,c=t+n;if(o<0||a>this.width||c<0||s>this.height)return!r&&[];var l=[];return this._forEachCell(a,s,o,c,this._queryCellCircle,l,{hitTest:r,circle:{x:e,y:t,radius:n},seenUids:{box:{},circle:{}}},i),r?l.length>0:l},nt.prototype.query=function(e,t,n,r,i){return this._query(e,t,n,r,!1,i)},nt.prototype.hitTest=function(e,t,n,r,i){return this._query(e,t,n,r,!0,i)},nt.prototype.hitTestCircle=function(e,t,n,r){return this._queryCircle(e,t,n,!0,r)},nt.prototype._queryCell=function(e,t,n,r,i,a,o,s){var c=o.seenUids,l=this.boxCells[i];if(l!==null)for(var u=this.bboxes,d=0,f=l;d=u[m+0]&&r>=u[m+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:u[m],y1:u[m+1],x2:u[m+2],y2:u[m+3]})}}}var h=this.circleCells[i];if(h!==null)for(var g=this.circles,_=0,v=h;_o*o+s*s},nt.prototype._circleAndRectCollide=function(e,t,n,r,i,a,o){var s=(a-r)/2,c=Math.abs(e-(r+s));if(c>s+n)return!1;var l=(o-i)/2,u=Math.abs(t-(i+l));if(u>l+n)return!1;if(c<=s||u<=l)return!0;var d=c-s,f=u-l;return d*d+f*f<=n*n};var mt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ht(e,t){for(var n=0;n=1;j--)A.push(O.path[j]);for(var M=1;M0){for(var F=A[0].clone(),I=A[0].clone(),te=1;te=T.x&&I.x<=E.x&&F.y>=T.y&&I.y<=E.y?[A]:I.xE.x||I.yE.y?[]:e.clipLine([A],T.x,T.y,E.x,E.y)}for(var ne=0,re=ee;ne=this.screenRightBoundary||r<100||t>this.screenBottomBoundary},_t.prototype.isInsideGrid=function(e,t,n,r){return n>=0&&e=0&&t0?(this.prevPlacement&&this.prevPlacement.variableOffsets[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID].text&&(h=this.prevPlacement.variableOffsets[d.crossTileID].anchor),this.variableOffsets[d.crossTileID]={textOffset:g,width:n,height:r,anchor:e,textBoxScale:i,prevAnchor:h},this.markUsedJustification(f,e,d,p),f.allowVerticalPlacement&&(this.markUsedOrientation(f,p,d),this.placedOrientations[d.crossTileID]=p),{shift:_,placedGlyphBoxes:v}):void 0},Dt.prototype.placeLayerBucketPart=function(t,n,r){var i=this,a=t.parameters,o=a.bucket,s=a.layout,c=a.posMatrix,l=a.textLabelPlaneMatrix,u=a.labelToScreenMatrix,d=a.textPixelRatio,f=a.holdingForFade,p=a.collisionBoxArray,m=a.partiallyEvaluatedTextSize,h=a.collisionGroup,g=s.get(`text-optional`),_=s.get(`icon-optional`),v=s.get(`text-allow-overlap`),y=s.get(`icon-allow-overlap`),b=s.get(`text-rotation-alignment`)===`map`,x=s.get(`text-pitch-alignment`)===`map`,S=s.get(`icon-text-fit`)!==`none`,C=s.get(`symbol-z-order`)===`viewport-y`,w=v&&(y||!o.hasIconData()||_),T=y&&(v||!o.hasTextData()||g);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);var E=function(t,a){if(!n[t.crossTileID])if(f)i.placements[t.crossTileID]=new xt(!1,!1,!1);else{var p,C=!1,E=!1,D=!0,O=null,k={box:null,offscreen:null},A={box:null,offscreen:null},j=null,M=null,N=0,P=0,ee=0;a.textFeatureIndex?N=a.textFeatureIndex:t.useRuntimeCollisionCircles&&(N=t.featureIndex),a.verticalTextFeatureIndex&&(P=a.verticalTextFeatureIndex);var F=a.textBox;if(F){var I=function(n){var r=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!n&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[t.crossTileID];a&&(i.placedOrientations[t.crossTileID]=a,i.markUsedOrientation(o,r=a,t))}return r},te=function(n,r){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i0&&(ne=ne.filter((function(e){return e!==re.anchor}))).unshift(re.anchor)}var ie=function(e,n,r){for(var a=e.x2-e.x1,s=e.y2-e.y1,l=t.textBoxScale,u=S&&!y?n:null,f={box:[],offscreen:!1},p=v?2*ne.length:ne.length,m=0;m=ne.length,t,o,r,u);if(g&&(f=g.placedGlyphBoxes)&&f.box&&f.box.length){C=!0,O=g.shift;break}}return f};te((function(){return ie(F,a.iconBox,e.WritingMode.horizontal)}),(function(){var n=a.verticalTextBox;return o.allowVerticalPlacement&&!(k&&k.box&&k.box.length)&&t.numVerticalGlyphVertices>0&&n?ie(n,a.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}})),k&&(C=k.box,D=k.offscreen);var ae=I(k&&k.box);if(!C&&i.prevPlacement){var L=i.prevPlacement.variableOffsets[t.crossTileID];L&&(i.variableOffsets[t.crossTileID]=L,i.markUsedJustification(o,L.anchor,t,ae))}}else{var oe=function(e,n){var r=i.collisionIndex.placeCollisionBox(e,v,d,c,h.predicate);return r&&r.box&&r.box.length&&(i.markUsedOrientation(o,n,t),i.placedOrientations[t.crossTileID]=n),r};te((function(){return oe(F,e.WritingMode.horizontal)}),(function(){var n=a.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&n?oe(n,e.WritingMode.vertical):{box:null,offscreen:null}})),I(k&&k.box&&k.box.length)}}if(C=(p=k)&&p.box&&p.box.length>0,D=p&&p.offscreen,t.useRuntimeCollisionCircles){var se=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),ce=e.evaluateSizeForFeature(o.textSizeData,m,se),le=s.get(`text-padding`);j=i.collisionIndex.placeCollisionCircles(v,se,o.lineVertexArray,o.glyphOffsetArray,ce,c,l,u,r,x,h.predicate,t.collisionCircleDiameter,le),C=v||j.circles.length>0&&!j.collisionDetected,D&&=j.offscreen}if(a.iconFeatureIndex&&(ee=a.iconFeatureIndex),a.iconBox){var ue=function(e){var t=S&&O?Et(e,O.x,O.y,b,x,i.transform.angle):e;return i.collisionIndex.placeCollisionBox(t,y,d,c,h.predicate)};E=A&&A.box&&A.box.length&&a.verticalIconBox?(M=ue(a.verticalIconBox)).box.length>0:(M=ue(a.iconBox)).box.length>0,D&&=M.offscreen}var de=g||t.numHorizontalGlyphVertices===0&&t.numVerticalGlyphVertices===0,fe=_||t.numIconVertices===0;if(de||fe?fe?de||(E&&=C):C=E&&C:E=C=E&&C,C&&p&&p.box&&i.collisionIndex.insertCollisionBox(p.box,s.get(`text-ignore-placement`),o.bucketInstanceId,A&&A.box&&P?P:N,h.ID),E&&M&&i.collisionIndex.insertCollisionBox(M.box,s.get(`icon-ignore-placement`),o.bucketInstanceId,ee,h.ID),j&&(C&&i.collisionIndex.insertCollisionCircles(j.circles,s.get(`text-ignore-placement`),o.bucketInstanceId,N,h.ID),r)){var pe=o.bucketInstanceId,me=i.collisionCircleArrays[pe];me===void 0&&(me=i.collisionCircleArrays[pe]=new St);for(var R=0;R=0;--O){var k=D[O];E(o.symbolInstances.get(k),o.collisionArrays[k])}else for(var A=t.symbolInstanceStart;A=0&&(t.text.placedSymbolArray.get(c).crossTileID=a>=0&&c!==a?0:r.crossTileID)}},Dt.prototype.markUsedOrientation=function(t,n,r){for(var i=n===e.WritingMode.horizontal||n===e.WritingMode.horizontalOnly?n:0,a=n===e.WritingMode.vertical?n:0,o=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];o0,v=i.placedOrientations[a.crossTileID],y=v===e.WritingMode.vertical,b=v===e.WritingMode.horizontal||v===e.WritingMode.horizontalOnly;if(s>0||c>0){var x=It(g.text);m(t.text,s,y?Lt:x),m(t.text,c,b?Lt:x);var S=g.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=S||y?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=S||b?1:0);var C=i.variableOffsets[a.crossTileID];C&&i.markUsedJustification(t,C.anchor,a,v);var w=i.placedOrientations[a.crossTileID];w&&(i.markUsedJustification(t,`left`,a,w),i.markUsedOrientation(t,w,a))}if(_){var T=It(g.icon),E=!(f&&a.verticalPlacedIconSymbolIndex&&y);a.placedIconSymbolIndex>=0&&(m(t.icon,a.numIconVertices,E?T:Lt),t.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=g.icon.isHidden()),a.verticalPlacedIconSymbolIndex>=0&&(m(t.icon,a.numVerticalIconVertices,E?Lt:T),t.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var D=t.collisionArrays[r];if(D){var O=new e.Point(0,0);if(D.textBox||D.verticalTextBox){var k=!0;if(l){var A=i.variableOffsets[h];A?(O=Tt(A.anchor,A.width,A.height,A.textOffset,A.textBoxScale),u&&O._rotate(d?i.transform.angle:-i.transform.angle)):k=!1}D.textBox&&Ot(t.textCollisionBox.collisionVertexArray,g.text.placed,!k||y,O.x,O.y),D.verticalTextBox&&Ot(t.textCollisionBox.collisionVertexArray,g.text.placed,!k||b,O.x,O.y)}var j=!!(!b&&D.verticalIconBox);D.iconBox&&Ot(t.iconCollisionBox.collisionVertexArray,g.icon.placed,j,f?O.x:0,f?O.y:0),D.verticalIconBox&&Ot(t.iconCollisionBox.collisionVertexArray,g.icon.placed,!j,f?O.x:0,f?O.y:0)}}},g=0;ge},Dt.prototype.setStale=function(){this.stale=!0};var kt=2**25,At=2**24,jt=2**17,Mt=2**16,Nt=2**9,Pt=2**8,Ft=2**1;function It(e){if(e.opacity===0&&!e.placed)return 0;if(e.opacity===1&&e.placed)return 4294967295;var t=+!!e.placed,n=Math.floor(127*e.opacity);return n*kt+t*At+n*jt+t*Mt+n*Nt+t*Pt+n*Ft+t}var Lt=0,Rt=function(e){this._sortAcrossTiles=e.layout.get(`symbol-z-order`)!==`viewport-y`&&e.layout.get(`symbol-sort-key`).constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Rt.prototype.continuePlacement=function(e,t,n,r,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=n[t[this._currentPlacementIndex]],c=this.placement.collisionIndex.transform.zoom;if(s.type===`symbol`&&(!s.minzoom||s.minzoom<=c)&&(!s.maxzoom||s.maxzoom>c)){if(this._inProgressLayer||=new Rt(s),this._inProgressLayer.continuePlacement(r[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},zt.prototype.commit=function(e){return this.placement.commit(e),this.placement};var Bt=512/e.EXTENT/2,Vt=function(e,t,n){this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var r=0;re.overscaledZ)for(var s in o){var c=o[s];c.tileID.isChildOf(e)&&c.findMatches(t.symbolInstances,e,i)}else{var l=o[e.scaledTo(Number(a)).key];l&&l.findMatches(t.symbolInstances,e,i)}}for(var u=0;u1?`@2x`:``,c=e.getJSON(n.transformRequest(n.normalizeSpriteURL(t,s,`.json`),e.ResourceType.SpriteJSON),(function(e,t){c=null,o||(o=e,i=t,u())})),l=e.getImage(n.transformRequest(n.normalizeSpriteURL(t,s,`.png`),e.ResourceType.SpriteImage),(function(e,t){l=null,o||(o=e,a=t,u())}));function u(){if(o)r(o);else if(i&&a){var t=e.browser.getImageData(a),n={};for(var s in i){var c=i[s],l=c.width,u=c.height,d=c.x,f=c.y,p=c.sdf,m=c.pixelRatio,h=c.stretchX,g=c.stretchY,_=c.content,v=new e.RGBAImage({width:l,height:u});e.RGBAImage.copy(t,v,{x:d,y:f},{x:0,y:0},{width:l,height:u}),n[s]={data:v,pixelRatio:m,sdf:p,stretchX:h,stretchY:g,content:_}}r(null,n)}}return{cancel:function(){c&&=(c.cancel(),null),l&&=(l.cancel(),null)}}}(t,this.map._requestManager,(function(t,r){if(n._spriteRequest=null,t)n.fire(new e.ErrorEvent(t));else if(r)for(var i in r)n.imageManager.addImage(i,r[i]);n.imageManager.setLoaded(!0),n._availableImages=n.imageManager.listImages(),n.dispatcher.broadcast(`setImages`,n._availableImages),n.fire(new e.Event(`data`,{dataType:`style`}))}))},n.prototype._validateLayer=function(t){var n=this.sourceCaches[t.source];if(n){var r=t.sourceLayer;if(r){var i=n.getSource();(i.type===`geojson`||i.vectorLayerIds&&i.vectorLayerIds.indexOf(r)===-1)&&this.fire(new e.ErrorEvent(Error(`Source layer "`+r+`" does not exist on source "`+i.id+`" as specified by style layer "`+t.id+`"`)))}}},n.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()},n.prototype._serializeLayers=function(e){for(var t=[],n=0,r=e;n0)throw Error(`Unimplemented: `+i.map((function(e){return e.command})).join(`, `)+`.`);return r.forEach((function(e){e.command!==`setTransition`&&n[e.command].apply(n,e.args)})),this.stylesheet=t,!0},n.prototype.addImage=function(t,n){if(this.getImage(t))return this.fire(new e.ErrorEvent(Error(`An image with this name already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)},n.prototype.updateImage=function(e,t){this.imageManager.updateImage(e,t)},n.prototype.getImage=function(e){return this.imageManager.getImage(e)},n.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(Error(`No image with this name exists.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)},n.prototype._afterImageUpdated=function(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast(`setImages`,this._availableImages),this.fire(new e.Event(`data`,{dataType:`style`}))},n.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},n.prototype.addSource=function(t,n,r){var i=this;if(r===void 0&&(r={}),this._checkLoaded(),this.sourceCaches[t]!==void 0)throw Error(`There is already a source with this ID`);if(!n.type)throw Error(`The type property must be defined, but only the following properties were given: `+Object.keys(n).join(`, `)+`.`);if(!([`vector`,`raster`,`geojson`,`video`,`image`].indexOf(n.type)>=0&&this._validate(e.validateStyle.source,`sources.`+t,n,null,r))){this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);var a=this.sourceCaches[t]=new Re(t,n,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:t}})),a.onAdd(this.map),this._changed=!0}},n.prototype.removeSource=function(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw Error(`There is no source with this ID`);for(var n in this._layers)if(this._layers[n].source===t)return this.fire(new e.ErrorEvent(Error(`Source "`+t+`" cannot be removed while layer "`+n+`" is using it.`)));var r=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],r.fire(new e.Event(`data`,{sourceDataType:`metadata`,dataType:`source`,sourceId:t})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.onRemove(this.map),this._changed=!0},n.prototype.setGeoJSONSourceData=function(e,t){this._checkLoaded(),this.sourceCaches[e].getSource().setData(t),this._changed=!0},n.prototype.getSource=function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()},n.prototype.addLayer=function(t,n,r){r===void 0&&(r={}),this._checkLoaded();var i=t.id;if(this.getLayer(i))this.fire(new e.ErrorEvent(Error(`Layer with id "`+i+`" already exists on this map`)));else{var a;if(t.type===`custom`){if(Gt(this,e.validateCustomStyleLayer(t)))return;a=e.createStyleLayer(t)}else{if(typeof t.source==`object`&&(this.addSource(i,t.source),t=e.clone$1(t),t=e.extend(t,{source:i})),this._validate(e.validateStyle.layer,`layers.`+i,t,{arrayIndex:-1},r))return;a=e.createStyleLayer(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=n?this._order.indexOf(n):this._order.length;if(n&&o===-1)this.fire(new e.ErrorEvent(Error(`Layer with id "`+n+`" does not exist on this map.`)));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&a.type!==`custom`){var s=this._removedLayers[i];delete this._removedLayers[i],s.type===a.type?(this._updatedSources[a.source]=`reload`,this.sourceCaches[a.source].pause()):this._updatedSources[a.source]=`clear`}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},n.prototype.moveLayer=function(t,n){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==n){var r=this._order.indexOf(t);this._order.splice(r,1);var i=n?this._order.indexOf(n):this._order.length;n&&i===-1?this.fire(new e.ErrorEvent(Error(`Layer with id "`+n+`" does not exist on this map.`))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}}else this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style and cannot be moved.`)))},n.prototype.removeLayer=function(t){this._checkLoaded();var n=this._layers[t];if(n){n.setEventedParent(null);var r=this._order.indexOf(t);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}else this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style and cannot be removed.`)))},n.prototype.getLayer=function(e){return this._layers[e]},n.prototype.hasLayer=function(e){return e in this._layers},n.prototype.setLayerZoomRange=function(t,n,r){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===n&&i.maxzoom===r||(n!=null&&(i.minzoom=n),r!=null&&(i.maxzoom=r),this._updateLayer(i)):this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style and cannot have zoom extent.`)))},n.prototype.setFilter=function(t,n,r){r===void 0&&(r={}),this._checkLoaded();var i=this.getLayer(t);if(i){if(!e.deepEqual(i.filter,n))return n==null?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(e.validateStyle.filter,`layers.`+i.id+`.filter`,n,null,r)||(i.filter=e.clone$1(n),this._updateLayer(i)))}else this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style and cannot be filtered.`)))},n.prototype.getFilter=function(t){return e.clone$1(this.getLayer(t).filter)},n.prototype.setLayoutProperty=function(t,n,r,i){i===void 0&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getLayoutProperty(n),r)||(a.setLayoutProperty(n,r,i),this._updateLayer(a)):this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style and cannot be styled.`)))},n.prototype.getLayoutProperty=function(t,n){var r=this.getLayer(t);if(r)return r.getLayoutProperty(n);this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style.`)))},n.prototype.setPaintProperty=function(t,n,r,i){i===void 0&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getPaintProperty(n),r)||(a.setPaintProperty(n,r,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new e.ErrorEvent(Error(`The layer '`+t+`' does not exist in the map's style and cannot be styled.`)))},n.prototype.getPaintProperty=function(e,t){return this.getLayer(e).getPaintProperty(t)},n.prototype.setFeatureState=function(t,n){this._checkLoaded();var r=t.source,i=t.sourceLayer,a=this.sourceCaches[r];if(a!==void 0){var o=a.getSource().type;o===`geojson`&&i?this.fire(new e.ErrorEvent(Error(`GeoJSON sources cannot have a sourceLayer parameter.`))):o!==`vector`||i?(t.id===void 0&&this.fire(new e.ErrorEvent(Error(`The feature id parameter must be provided.`))),a.setFeatureState(i,t.id,n)):this.fire(new e.ErrorEvent(Error(`The sourceLayer parameter must be provided for vector source types.`)))}else this.fire(new e.ErrorEvent(Error(`The source '`+r+`' does not exist in the map's style.`)))},n.prototype.removeFeatureState=function(t,n){this._checkLoaded();var r=t.source,i=this.sourceCaches[r];if(i!==void 0){var a=i.getSource().type,o=a===`vector`?t.sourceLayer:void 0;a!==`vector`||o?n&&typeof t.id!=`string`&&typeof t.id!=`number`?this.fire(new e.ErrorEvent(Error(`A feature id is required to remove its specific state property.`))):i.removeFeatureState(o,t.id,n):this.fire(new e.ErrorEvent(Error(`The sourceLayer parameter must be provided for vector source types.`)))}else this.fire(new e.ErrorEvent(Error(`The source '`+r+`' does not exist in the map's style.`)))},n.prototype.getFeatureState=function(t){this._checkLoaded();var n=t.source,r=t.sourceLayer,i=this.sourceCaches[n];if(i!==void 0){if(i.getSource().type!==`vector`||r)return t.id===void 0&&this.fire(new e.ErrorEvent(Error(`The feature id parameter must be provided.`))),i.getFeatureState(r,t.id);this.fire(new e.ErrorEvent(Error(`The sourceLayer parameter must be provided for vector source types.`)))}else this.fire(new e.ErrorEvent(Error(`The source '`+n+`' does not exist in the map's style.`)))},n.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},n.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,(function(e){return e.serialize()})),layers:this._serializeLayers(this._order)},(function(e){return e!==void 0}))},n.prototype._updateLayer=function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.sourceCaches[e.source].getSource().type!==`raster`&&(this._updatedSources[e.source]=`reload`,this.sourceCaches[e.source].pause()),this._changed=!0},n.prototype._flattenAndSortRenderedFeatures=function(e){for(var t=this,n=function(e){return t._layers[e].type===`fill-extrusion`},r={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(n(o)){r[o]=a;for(var s=0,c=e;s=0;p--){var m=this._order[p];if(n(m))for(var h=i.length-1;h>=0;h--){var g=i[h].feature;if(r[g.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}`,`attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),on=wn(`varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}`,`attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}`),sn=wn(`uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}`,`attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}`),cn=wn(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_FragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);}`),ln=wn(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),un=wn(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),dn=wn(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fn=wn(`varying vec4 v_color;void main() {gl_FragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color; +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),pn=wn(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 +? a_pos +: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),mn=wn(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}`),hn=wn(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; +#define PI 3.141592653589793 +void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}`),gn=wn(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),_n=wn(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),vn=wn(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),yn=wn(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),bn=wn(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),xn=wn(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),Sn=wn(`#define SDF_PX 8.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),Cn=wn(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function wn(e,t){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=t.match(/attribute ([\w]+) ([\w]+)/g),i=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:e=e.replace(n,(function(e,t,n,r,i){return s[i]=!0,t===`define`?` +#ifndef HAS_UNIFORM_u_`+i+` +varying `+n+` `+r+` `+i+`; +#else +uniform `+n+` `+r+` u_`+i+`; +#endif +`:` +#ifdef HAS_UNIFORM_u_`+i+` + `+n+` `+r+` `+i+` = u_`+i+`; +#endif +`})),vertexSource:t=t.replace(n,(function(e,t,n,r,i){var a=r===`float`?`vec2`:`vec4`,o=i.match(/color/)?`color`:a;return s[i]?t===`define`?` +#ifndef HAS_UNIFORM_u_`+i+` +uniform lowp float u_`+i+`_t; +attribute `+n+` `+a+` a_`+i+`; +varying `+n+` `+r+` `+i+`; +#else +uniform `+n+` `+r+` u_`+i+`; +#endif +`:o===`vec4`?` +#ifndef HAS_UNIFORM_u_`+i+` + `+i+` = a_`+i+`; +#else + `+n+` `+r+` `+i+` = u_`+i+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+i+` + `+i+` = unpack_mix_`+o+`(a_`+i+`, u_`+i+`_t); +#else + `+n+` `+r+` `+i+` = u_`+i+`; +#endif +`:t===`define`?` +#ifndef HAS_UNIFORM_u_`+i+` +uniform lowp float u_`+i+`_t; +attribute `+n+` `+a+` a_`+i+`; +#else +uniform `+n+` `+r+` u_`+i+`; +#endif +`:o===`vec4`?` +#ifndef HAS_UNIFORM_u_`+i+` + `+n+` `+r+` `+i+` = a_`+i+`; +#else + `+n+` `+r+` `+i+` = u_`+i+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+i+` + `+n+` `+r+` `+i+` = unpack_mix_`+o+`(a_`+i+`, u_`+i+`_t); +#else + `+n+` `+r+` `+i+` = u_`+i+`; +#endif +`})),staticAttributes:r,staticUniforms:o}}var Tn=Object.freeze({__proto__:null,prelude:Zt,background:Qt,backgroundPattern:$t,circle:en,clippingMask:tn,heatmap:nn,heatmapTexture:rn,collisionBox:an,collisionCircle:on,debug:sn,fill:cn,fillOutline:ln,fillOutlinePattern:un,fillPattern:dn,fillExtrusion:fn,fillExtrusionPattern:pn,hillshadePrepare:mn,hillshade:hn,line:gn,lineGradient:_n,linePattern:vn,lineSDF:yn,raster:bn,symbolIcon:xn,symbolSDF:Sn,symbolTextAndIcon:Cn}),En=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function Dn(e){for(var t=[],n=0;n>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}On.prototype.draw=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g,_=e.gl;if(!this.failedToCreate){for(var v in e.program.set(this.program),e.setDepthMode(n),e.setStencilMode(r),e.setColorMode(i),e.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);p&&p.setUniforms(e,this.binderUniforms,d,{zoom:f});for(var y=(g={},g[_.LINES]=2,g[_.TRIANGLES]=3,g[_.LINE_STRIP]=1,g)[t],b=0,x=u.get();b0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get(`raster-contrast`),a>0?1/(1-a):1+a),u_spin_weights:Yn(i.paint.get(`raster-hue-rotate`))};var a,o};function Yn(e){e*=Math.PI/180;var t=Math.sin(e),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}var Xn,Zn=function(e,t,n,r,i,a,o,s,c,l){var u=i.transform;return{u_is_size_zoom_constant:+(e===`constant`||e===`source`),u_is_size_feature_constant:+(e===`constant`||e===`camera`),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:u.width/u.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+c,u_pitch_with_map:+r,u_texsize:l,u_texture:0}},Qn=function(t,n,r,i,a,o,s,c,l,u,d){var f=a.transform;return e.extend(Zn(t,n,r,i,a,o,s,c,l,u),{u_gamma_scale:i?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+d})},$n=function(t,n,r,i,a,o,s,c,l,u){return e.extend(Qn(t,n,r,i,a,o,s,c,!0,l,!0),{u_texsize_icon:u,u_texture_icon:1})},er=function(e,t,n){return{u_matrix:e,u_opacity:t,u_color:n}},tr=function(t,n,r,i,a,o){return e.extend(function(e,t,n,r){var i=n.imageManager.getPattern(e.from.toString()),a=n.imageManager.getPattern(e.to.toString()),o=n.imageManager.getPixelSize(),s=o.width,c=o.height,l=2**r.tileID.overscaledZ,u=r.tileSize*2**n.transform.tileZoom/l,d=u*(r.tileID.canonical.x+r.tileID.wrap*l),f=u*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,c],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/vt(r,1,n.transform.tileZoom),u_pixel_coord_upper:[d>>16,f>>16],u_pixel_coord_lower:[65535&d,65535&f]}}(i,o,r,a),{u_matrix:t,u_opacity:n})},nr={fillExtrusion:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_lightpos:new e.Uniform3f(t,n.u_lightpos),u_lightintensity:new e.Uniform1f(t,n.u_lightintensity),u_lightcolor:new e.Uniform3f(t,n.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,n.u_vertical_gradient),u_opacity:new e.Uniform1f(t,n.u_opacity)}},fillExtrusionPattern:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_lightpos:new e.Uniform3f(t,n.u_lightpos),u_lightintensity:new e.Uniform1f(t,n.u_lightintensity),u_lightcolor:new e.Uniform3f(t,n.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,n.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,n.u_height_factor),u_image:new e.Uniform1i(t,n.u_image),u_texsize:new e.Uniform2f(t,n.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade),u_opacity:new e.Uniform1f(t,n.u_opacity)}},fill:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}},fillPattern:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_image:new e.Uniform1i(t,n.u_image),u_texsize:new e.Uniform2f(t,n.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade)}},fillOutline:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_world:new e.Uniform2f(t,n.u_world)}},fillOutlinePattern:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_world:new e.Uniform2f(t,n.u_world),u_image:new e.Uniform1i(t,n.u_image),u_texsize:new e.Uniform2f(t,n.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade)}},circle:function(t,n){return{u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,n.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,n.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}},collisionBox:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(t,n.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(t,n.u_extrude_scale),u_overscale_factor:new e.Uniform1f(t,n.u_overscale_factor)}},collisionCircle:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_inv_matrix:new e.UniformMatrix4f(t,n.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(t,n.u_viewport_size)}},debug:function(t,n){return{u_color:new e.UniformColor(t,n.u_color),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_overlay:new e.Uniform1i(t,n.u_overlay),u_overlay_scale:new e.Uniform1f(t,n.u_overlay_scale)}},clippingMask:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}},heatmap:function(t,n){return{u_extrude_scale:new e.Uniform1f(t,n.u_extrude_scale),u_intensity:new e.Uniform1f(t,n.u_intensity),u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}},heatmapTexture:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_world:new e.Uniform2f(t,n.u_world),u_image:new e.Uniform1i(t,n.u_image),u_color_ramp:new e.Uniform1i(t,n.u_color_ramp),u_opacity:new e.Uniform1f(t,n.u_opacity)}},hillshade:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_image:new e.Uniform1i(t,n.u_image),u_latrange:new e.Uniform2f(t,n.u_latrange),u_light:new e.Uniform2f(t,n.u_light),u_shadow:new e.UniformColor(t,n.u_shadow),u_highlight:new e.UniformColor(t,n.u_highlight),u_accent:new e.UniformColor(t,n.u_accent)}},hillshadePrepare:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_image:new e.Uniform1i(t,n.u_image),u_dimension:new e.Uniform2f(t,n.u_dimension),u_zoom:new e.Uniform1f(t,n.u_zoom),u_unpack:new e.Uniform4f(t,n.u_unpack)}},line:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_ratio:new e.Uniform1f(t,n.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,n.u_units_to_pixels)}},lineGradient:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_ratio:new e.Uniform1f(t,n.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,n.u_units_to_pixels),u_image:new e.Uniform1i(t,n.u_image),u_image_height:new e.Uniform1f(t,n.u_image_height)}},linePattern:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_texsize:new e.Uniform2f(t,n.u_texsize),u_ratio:new e.Uniform1f(t,n.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_image:new e.Uniform1i(t,n.u_image),u_units_to_pixels:new e.Uniform2f(t,n.u_units_to_pixels),u_scale:new e.Uniform3f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade)}},lineSDF:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_ratio:new e.Uniform1f(t,n.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,n.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,n.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,n.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,n.u_sdfgamma),u_image:new e.Uniform1i(t,n.u_image),u_tex_y_a:new e.Uniform1f(t,n.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,n.u_tex_y_b),u_mix:new e.Uniform1f(t,n.u_mix)}},raster:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_tl_parent:new e.Uniform2f(t,n.u_tl_parent),u_scale_parent:new e.Uniform1f(t,n.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,n.u_buffer_scale),u_fade_t:new e.Uniform1f(t,n.u_fade_t),u_opacity:new e.Uniform1f(t,n.u_opacity),u_image0:new e.Uniform1i(t,n.u_image0),u_image1:new e.Uniform1i(t,n.u_image1),u_brightness_low:new e.Uniform1f(t,n.u_brightness_low),u_brightness_high:new e.Uniform1f(t,n.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,n.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,n.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,n.u_spin_weights)}},symbolIcon:function(t,n){return{u_is_size_zoom_constant:new e.Uniform1i(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,n.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,n.u_size_t),u_size:new e.Uniform1f(t,n.u_size),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,n.u_pitch),u_rotate_symbol:new e.Uniform1i(t,n.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,n.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,n.u_fade_change),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,n.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,n.u_coord_matrix),u_is_text:new e.Uniform1i(t,n.u_is_text),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_texsize:new e.Uniform2f(t,n.u_texsize),u_texture:new e.Uniform1i(t,n.u_texture)}},symbolSDF:function(t,n){return{u_is_size_zoom_constant:new e.Uniform1i(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,n.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,n.u_size_t),u_size:new e.Uniform1f(t,n.u_size),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,n.u_pitch),u_rotate_symbol:new e.Uniform1i(t,n.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,n.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,n.u_fade_change),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,n.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,n.u_coord_matrix),u_is_text:new e.Uniform1i(t,n.u_is_text),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_texsize:new e.Uniform2f(t,n.u_texsize),u_texture:new e.Uniform1i(t,n.u_texture),u_gamma_scale:new e.Uniform1f(t,n.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,n.u_is_halo)}},symbolTextAndIcon:function(t,n){return{u_is_size_zoom_constant:new e.Uniform1i(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,n.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,n.u_size_t),u_size:new e.Uniform1f(t,n.u_size),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,n.u_pitch),u_rotate_symbol:new e.Uniform1i(t,n.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,n.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,n.u_fade_change),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,n.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,n.u_coord_matrix),u_is_text:new e.Uniform1i(t,n.u_is_text),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_texsize:new e.Uniform2f(t,n.u_texsize),u_texsize_icon:new e.Uniform2f(t,n.u_texsize_icon),u_texture:new e.Uniform1i(t,n.u_texture),u_texture_icon:new e.Uniform1i(t,n.u_texture_icon),u_gamma_scale:new e.Uniform1f(t,n.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,n.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,n.u_is_halo)}},background:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_opacity:new e.Uniform1f(t,n.u_opacity),u_color:new e.UniformColor(t,n.u_color)}},backgroundPattern:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_opacity:new e.Uniform1f(t,n.u_opacity),u_image:new e.Uniform1i(t,n.u_image),u_pattern_tl_a:new e.Uniform2f(t,n.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,n.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,n.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,n.u_pattern_br_b),u_texsize:new e.Uniform2f(t,n.u_texsize),u_mix:new e.Uniform1f(t,n.u_mix),u_pattern_size_a:new e.Uniform2f(t,n.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,n.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,n.u_scale_a),u_scale_b:new e.Uniform1f(t,n.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,n.u_tile_units_to_pixels)}}};function rr(t,n,r,i,a,o,s){for(var c=t.context,l=c.gl,u=t.useProgram(`collisionBox`),d=[],f=0,p=0,m=0;m0){var x=e.create(),S=v;e.mul(x,_.placementInvProjMatrix,t.transform.glCoordMatrix),e.mul(x,x,_.placementViewportMatrix),d.push({circleArray:b,circleOffset:p,transform:S,invTransform:x}),p=f+=b.length/4}y&&u.draw(c,l.LINES,Pe.disabled,Fe.disabled,t.colorModeForRenderPass(),Ie.disabled,Ln(v,t.transform,g),r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,t.transform.zoom,null,null,y.collisionVertexBuffer)}}if(s&&d.length){var C=t.useProgram(`collisionCircle`),w=new e.StructArrayLayout2f1f2i16;w.resize(4*f),w._trim();for(var T=0,E=0,D=d;E=0&&(h[_.associatedIconIndex]={shiftedAnchor:w,angle:T})}else ht(_.numGlyphs,p)}if(d){m.clear();for(var D=t.icon.placedSymbolArray,O=0;O0){var s=e.browser.now(),c=(s-t.timeAdded)/o,l=n?(s-n.timeAdded)/o:-1,u=r.getSource(),d=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),f=!n||Math.abs(n.tileID.overscaledZ-d)>Math.abs(t.tileID.overscaledZ-d),p=f&&t.refreshedUponExpiration?1:e.clamp(f?c:1-l,0,1);return t.refreshedUponExpiration&&c>=1&&(t.refreshedUponExpiration=!1),n?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var hr=new e.Color(1,0,0,1),gr=new e.Color(0,1,0,1),_r=new e.Color(0,0,1,1),vr=new e.Color(1,0,1,1),yr=new e.Color(0,1,1,1);function br(e,t,n,r){Sr(e,0,t+n/2,e.transform.width,n,r)}function xr(e,t,n,r){Sr(e,t-n/2,0,n,e.transform.height,r)}function Sr(t,n,r,i,a,o){var s=t.context,c=s.gl;c.enable(c.SCISSOR_TEST),c.scissor(n*e.browser.devicePixelRatio,r*e.browser.devicePixelRatio,i*e.browser.devicePixelRatio,a*e.browser.devicePixelRatio),s.clear({color:o}),c.disable(c.SCISSOR_TEST)}function Cr(t,n,r){var i=t.context,a=i.gl,o=r.posMatrix,s=t.useProgram(`debug`),c=Pe.disabled,l=Fe.disabled,u=t.colorModeForRenderPass();i.activeTexture.set(a.TEXTURE0),t.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,c,l,u,Ie.disabled,zn(o,e.Color.red),`$debug`,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments);var d=n.getTileByID(r.key).latestRawTileData,f=Math.floor((d&&d.byteLength||0)/1024),p=n.getTile(r).tileSize,m=512/Math.min(p,512)*(r.overscaledZ/t.transform.zoom)*.5,h=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(h+=` => `+r.overscaledZ),function(e,t){e.initDebugOverlayCanvas();var n=e.debugOverlayCanvas,r=e.context.gl,i=e.debugOverlayCanvas.getContext(`2d`);i.clearRect(0,0,n.width,n.height),i.shadowColor=`white`,i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle=`white`,i.textBaseline=`top`,i.font=`bold 36px Open Sans, sans-serif`,i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(n),e.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,h+` `+f+`kb`),s.draw(i,a.TRIANGLES,c,l,U.alphaBlended,Ie.disabled,zn(o,e.Color.transparent,m),`$debug`,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments)}var wr={symbol:function(t,n,r,i,a){if(t.renderPass===`translucent`){var o=Fe.disabled,s=t.colorModeForRenderPass();r.layout.get(`text-variable-anchor`)&&function(t,n,r,i,a,o,s){for(var c=n.transform,l=a===`map`,u=o===`map`,d=0,f=t;d256&&this.clearStencil(),n.setColorMode(U.disabled),n.setDepthMode(Pe.disabled);var i=this.useProgram(`clippingMask`);this._tileClippingMaskIDs={};for(var a=0,o=t;a256&&this.clearStencil();var e=this.nextStencilID++,t=this.context.gl;return new Fe({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)},Tr.prototype.stencilModeForClipping=function(e){var t=this.context.gl;return new Fe({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)},Tr.prototype.stencilConfigForOverlap=function(e){var t,n=this.context.gl,r=e.sort((function(e,t){return t.overscaledZ-e.overscaledZ})),i=r[r.length-1].overscaledZ,a=r[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var b=this.style._layers[i[this.currentLayer]],x=a[b.source],S=u[b.source];this._renderTileClippingMasks(b,S),this.renderLayer(this,x,b,S)}for(this.renderPass=`translucent`,this.currentLayer=0;this.currentLayer0?t.pop():null},Tr.prototype.isPatternMissing=function(e){if(!e)return!1;if(!e.from||!e.to)return!0;var t=this.imageManager.getPattern(e.from.toString()),n=this.imageManager.getPattern(e.to.toString());return!t||!n},Tr.prototype.useProgram=function(e,t){this.cache=this.cache||{};var n=``+e+(t?t.cacheKey:``)+(this._showOverdrawInspector?`/overdraw`:``);return this.cache[n]||(this.cache[n]=new On(this.context,e,Tn[e],t,nr[e],this._showOverdrawInspector)),this.cache[n]},Tr.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Tr.prototype.setBaseState=function(){var e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)},Tr.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas??(this.debugOverlayCanvas=e.window.document.createElement(`canvas`),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},Tr.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Er=function(e,t){this.points=e,this.planes=t};Er.fromInvProjectionMatrix=function(t,n,r){var i=2**r,a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(n){return e.transformMat4([],n,t)})).map((function(t){return e.scale$1([],t,1/t[3]/n*i)}));return new Er(a,[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var n=e.sub([],a[t[0]],a[t[1]]),r=e.sub([],a[t[2]],a[t[1]]),i=e.normalize([],e.cross([],n,r)),o=-e.dot(i,a[t[1]]);return i.concat(o)})))};var Dr=function(t,n){this.min=t,this.max=n,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};Dr.prototype.quadrant=function(t){for(var n=[t%2==0,t<2],r=e.clone$2(this.min),i=e.clone$2(this.max),a=0;a=0;if(o===0)return 0;o!==n.length&&(r=!1)}if(r)return 2;for(var c=0;c<3;c++){for(var l=Number.MAX_VALUE,u=-Number.MAX_VALUE,d=0;dthis.max[c]-this.min[c])return 0}return 1};var Or=function(e,t,n,r){if(e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0),isNaN(e)||e<0||isNaN(t)||t<0||isNaN(n)||n<0||isNaN(r)||r<0)throw Error(`Invalid value for edge-insets, top, bottom, left and right must all be numbers`);this.top=e,this.bottom=t,this.left=n,this.right=r};Or.prototype.interpolate=function(t,n,r){return n.top!=null&&t.top!=null&&(this.top=e.number(t.top,n.top,r)),n.bottom!=null&&t.bottom!=null&&(this.bottom=e.number(t.bottom,n.bottom,r)),n.left!=null&&t.left!=null&&(this.left=e.number(t.left,n.left,r)),n.right!=null&&t.right!=null&&(this.right=e.number(t.right,n.right,r)),this},Or.prototype.getCenter=function(t,n){var r=e.clamp((this.left+t-this.right)/2,0,t),i=e.clamp((this.top+n-this.bottom)/2,0,n);return new e.Point(r,i)},Or.prototype.equals=function(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right},Or.prototype.clone=function(){return new Or(this.top,this.bottom,this.left,this.right)},Or.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var K=function(t,n,r,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=a===void 0||a,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=r??0,this._maxPitch=i??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Or,this._posMatrixCache={},this._alignedPosMatrixCache={}},kr={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};K.prototype.clone=function(){var e=new K(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._calcMatrices(),e},kr.minZoom.get=function(){return this._minZoom},kr.minZoom.set=function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))},kr.maxZoom.get=function(){return this._maxZoom},kr.maxZoom.set=function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))},kr.minPitch.get=function(){return this._minPitch},kr.minPitch.set=function(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))},kr.maxPitch.get=function(){return this._maxPitch},kr.maxPitch.set=function(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))},kr.renderWorldCopies.get=function(){return this._renderWorldCopies},kr.renderWorldCopies.set=function(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e},kr.worldSize.get=function(){return this.tileSize*this.scale},kr.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},kr.size.get=function(){return new e.Point(this.width,this.height)},kr.bearing.get=function(){return-this.angle/Math.PI*180},kr.bearing.set=function(t){var n=-e.wrap(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},kr.pitch.get=function(){return this._pitch/Math.PI*180},kr.pitch.set=function(t){var n=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())},kr.fov.get=function(){return this._fov/Math.PI*180},kr.fov.set=function(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())},kr.zoom.get=function(){return this._zoom},kr.zoom.set=function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())},kr.center.get=function(){return this._center},kr.center.set=function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())},kr.padding.get=function(){return this._edgeInsets.toJSON()},kr.padding.set=function(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())},kr.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},K.prototype.isPaddingEqual=function(e){return this._edgeInsets.equals(e)},K.prototype.interpolatePadding=function(e,t,n){this._unmodified=!1,this._edgeInsets.interpolate(e,t,n),this._constrain(),this._calcMatrices()},K.prototype.coveringZoomLevel=function(e){var t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)},K.prototype.getVisibleUnwrappedCoordinates=function(t){var n=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new e.Point(0,0)),i=this.pointCoordinate(new e.Point(this.width,0)),a=this.pointCoordinate(new e.Point(this.width,this.height)),o=this.pointCoordinate(new e.Point(0,this.height)),s=Math.floor(Math.min(r.x,i.x,a.x,o.x)),c=Math.floor(Math.max(r.x,i.x,a.x,o.x)),l=s-1;l<=c+1;l++)l!==0&&n.push(new e.UnwrappedTileID(l,t));return n},K.prototype.coveringTiles=function(t){var n=this.coveringZoomLevel(t),r=n;if(t.minzoom!==void 0&&nt.maxzoom&&(n=t.maxzoom);var i=e.MercatorCoordinate.fromLngLat(this.center),a=2**n,o=[a*i.x,a*i.y,0],s=Er.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n),c=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(c=n);var l=function(e){return{aabb:new Dr([e*a,0,0],[(e+1)*a,a,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}},u=[],d=[],f=n,p=t.reparseOverscaled?r:n;if(this._renderWorldCopies)for(var m=1;m<=3;m++)u.push(l(-m)),u.push(l(m));for(u.push(l(0));u.length>0;){var h=u.pop(),g=h.x,_=h.y,v=h.fullyVisible;if(!v){var y=h.aabb.intersects(s);if(y===0)continue;v=y===2}var b=h.aabb.distanceX(o),x=h.aabb.distanceY(o),S=Math.max(Math.abs(b),Math.abs(x));if(h.zoom===f||S>3+(1<=c)d.push({tileID:new e.OverscaledTileID(h.zoom===f?p:h.zoom,h.wrap,h.zoom,g,_),distanceSq:e.sqrLen([o[0]-.5-g,o[1]-.5-_])});else for(var C=0;C<4;C++){var w=(g<<1)+C%2,T=(_<<1)+(C>>1);u.push({aabb:h.aabb.quadrant(C),zoom:h.zoom+1,x:w,y:T,wrap:h.wrap,fullyVisible:v})}}return d.sort((function(e,t){return e.distanceSq-t.distanceSq})).map((function(e){return e.tileID}))},K.prototype.resize=function(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()},kr.unmodified.get=function(){return this._unmodified},K.prototype.zoomScale=function(e){return 2**e},K.prototype.scaleZoom=function(e){return Math.log(e)/Math.LN2},K.prototype.project=function(t){var n=e.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(t.lng)*this.worldSize,e.mercatorYfromLat(n)*this.worldSize)},K.prototype.unproject=function(t){return new e.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},kr.point.get=function(){return this.project(this.center)},K.prototype.setLocationAtPoint=function(t,n){var r=this.pointCoordinate(n),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.MercatorCoordinate(a.x-(r.x-i.x),a.y-(r.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},K.prototype.locationPoint=function(e){return this.coordinatePoint(this.locationCoordinate(e))},K.prototype.pointLocation=function(e){return this.coordinateLocation(this.pointCoordinate(e))},K.prototype.locationCoordinate=function(t){return e.MercatorCoordinate.fromLngLat(t)},K.prototype.coordinateLocation=function(e){return e.toLngLat()},K.prototype.pointCoordinate=function(t){var n=[t.x,t.y,0,1],r=[t.x,t.y,1,1];e.transformMat4(n,n,this.pixelMatrixInverse),e.transformMat4(r,r,this.pixelMatrixInverse);var i=n[3],a=r[3],o=n[1]/i,s=r[1]/a,c=n[2]/i,l=r[2]/a,u=c===l?0:(0-c)/(l-c);return new e.MercatorCoordinate(e.number(n[0]/i,r[0]/a,u)/this.worldSize,e.number(o,s,u)/this.worldSize)},K.prototype.coordinatePoint=function(t){var n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(n,n,this.pixelMatrix),new e.Point(n[0]/n[3],n[1]/n[3])},K.prototype.getBounds=function(){return new e.LngLatBounds().extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},K.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},K.prototype.setMaxBounds=function(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},K.prototype.calculatePosMatrix=function(t,n){n===void 0&&(n=!1);var r=t.key,i=n?this._alignedPosMatrixCache:this._posMatrixCache;if(i[r])return i[r];var a=t.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+2**a.z*t.wrap,c=e.identity(new Float64Array(16));return e.translate(c,c,[s*o,a.y*o,0]),e.scale(c,c,[o/e.EXTENT,o/e.EXTENT,1]),e.multiply(c,n?this.alignedProjMatrix:this.projMatrix,c),i[r]=new Float32Array(c),i[r]},K.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},K.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,n,r,i,a=-90,o=90,s=-180,c=180,l=this.size,u=this._unmodified;if(this.latRange){var d=this.latRange;a=e.mercatorYfromLat(d[1])*this.worldSize,t=(o=e.mercatorYfromLat(d[0])*this.worldSize)-ao&&(i=o-g)}if(this.lngRange){var _=p.x,v=l.x/2;_-vc&&(r=c-v)}r===void 0&&i===void 0||(this.center=this.unproject(new e.Point(r===void 0?p.x:r,i===void 0?p.y:i))),this._unmodified=u,this._constraining=!1}},K.prototype._calcMatrices=function(){if(this.height){var t=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var n=Math.PI/2+this._pitch,r=this._fov*(.5+t.y/this.height),i=Math.sin(r)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-n-r,.01,Math.PI-.01)),a=this.point,o=a.x,s=a.y,c=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),l=this.height/50,u=new Float64Array(16);e.perspective(u,this._fov,this.width/this.height,l,c),u[8]=2*-t.x/this.width,u[9]=2*t.y/this.height,e.scale(u,u,[1,-1,1]),e.translate(u,u,[0,0,-this.cameraToCenterDistance]),e.rotateX(u,u,this._pitch),e.rotateZ(u,u,this.angle),e.translate(u,u,[-o,-s,0]),this.mercatorMatrix=e.scale([],u,[this.worldSize,this.worldSize,this.worldSize]),e.scale(u,u,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=u,this.invProjMatrix=e.invert([],this.projMatrix);var d=this.width%2/2,f=this.height%2/2,p=Math.cos(this.angle),m=Math.sin(this.angle),h=o-Math.round(o)+p*d+m*f,g=s-Math.round(s)+p*f+m*d,_=new Float64Array(u);if(e.translate(_,_,[h>.5?h-1:h,g>.5?g-1:g,0]),this.alignedProjMatrix=_,u=e.create(),e.scale(u,u,[this.width/2,-this.height/2,1]),e.translate(u,u,[1,-1,0]),this.labelPlaneMatrix=u,u=e.create(),e.scale(u,u,[1,-1,1]),e.translate(u,u,[-1,-1,0]),e.scale(u,u,[2/this.width,2/this.height,1]),this.glCoordMatrix=u,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(u=e.invert(new Float64Array(16),this.pixelMatrix)))throw Error(`failed to invert matrix`);this.pixelMatrixInverse=u,this._posMatrixCache={},this._alignedPosMatrixCache={}}},K.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new e.Point(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance},K.prototype.getCameraPoint=function(){var t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,t))},K.prototype.getCameraQueryGeometry=function(t){var n=this.getCameraPoint();if(t.length===1)return[t[0],n];for(var r=n.x,i=n.y,a=n.x,o=n.y,s=0,c=t;s=3&&!e.some((function(e){return isNaN(e)}))){var t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},Ar.prototype._updateHashUnthrottled=function(){var t=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,t)}catch{}};var jr={linearity:.3,easing:e.bezier(0,0,.3,1)},Mr=e.extend({deceleration:2500,maxSpeed:1400},jr),Nr=e.extend({deceleration:20,maxSpeed:1400},jr),Pr=e.extend({deceleration:1e3,maxSpeed:360},jr),Fr=e.extend({deceleration:1e3,maxSpeed:90},jr),Ir=function(e){this._map=e,this.clear()};function Lr(e,t){(!e.duration||e.duration0&&n-t[0].time>160;)t.shift()},Ir.prototype._onMoveEnd=function(t){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var n={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},r=0,i=this._inertiaBuffer;r=this._clickTolerance||this._map.fire(new J(e.type,this._map,e))},Br.prototype.dblclick=function(e){return this._firePreventable(new J(e.type,this._map,e))},Br.prototype.mouseover=function(e){this._map.fire(new J(e.type,this._map,e))},Br.prototype.mouseout=function(e){this._map.fire(new J(e.type,this._map,e))},Br.prototype.touchstart=function(e){return this._firePreventable(new Rr(e.type,this._map,e))},Br.prototype.touchmove=function(e){this._map.fire(new Rr(e.type,this._map,e))},Br.prototype.touchend=function(e){this._map.fire(new Rr(e.type,this._map,e))},Br.prototype.touchcancel=function(e){this._map.fire(new Rr(e.type,this._map,e))},Br.prototype._firePreventable=function(e){if(this._map.fire(e),e.defaultPrevented)return{}},Br.prototype.isEnabled=function(){return!0},Br.prototype.isActive=function(){return!1},Br.prototype.enable=function(){},Br.prototype.disable=function(){};var Vr=function(e){this._map=e};Vr.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Vr.prototype.mousemove=function(e){this._map.fire(new J(e.type,this._map,e))},Vr.prototype.mousedown=function(){this._delayContextMenu=!0},Vr.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new J(`contextmenu`,this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Vr.prototype.contextmenu=function(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new J(e.type,this._map,e)),this._map.listens(`contextmenu`)&&e.preventDefault()},Vr.prototype.isEnabled=function(){return!0},Vr.prototype.isActive=function(){return!1},Vr.prototype.enable=function(){},Vr.prototype.disable=function(){};var Hr=function(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1};function Ur(e,t){for(var n={},r=0;rthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){for(var n=new e.Point(0,0),r=0,i=t;r30)&&(this.aborted=!0)}}},Wr.prototype.touchend=function(e,t,n){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){var r=!this.aborted&&this.centroid;if(this.reset(),r)return r}};var Gr=function(e){this.singleTap=new Wr(e),this.numTaps=e.numTaps,this.reset()};Gr.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Gr.prototype.touchstart=function(e,t,n){this.singleTap.touchstart(e,t,n)},Gr.prototype.touchmove=function(e,t,n){this.singleTap.touchmove(e,t,n)},Gr.prototype.touchend=function(e,t,n){var r=this.singleTap.touchend(e,t,n);if(r){var i=e.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(r)<30;if(i&&a||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}};var Kr=function(){this._zoomIn=new Gr({numTouches:1,numTaps:2}),this._zoomOut=new Gr({numTouches:2,numTaps:1}),this.reset()};Kr.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Kr.prototype.touchstart=function(e,t,n){this._zoomIn.touchstart(e,t,n),this._zoomOut.touchstart(e,t,n)},Kr.prototype.touchmove=function(e,t,n){this._zoomIn.touchmove(e,t,n),this._zoomOut.touchmove(e,t,n)},Kr.prototype.touchend=function(e,t,n){var r=this,i=this._zoomIn.touchend(e,t,n),a=this._zoomOut.touchend(e,t,n);return i?(this._active=!0,e.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(i)},{originalEvent:e})}}):a?(this._active=!0,e.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(a)},{originalEvent:e})}}):void 0},Kr.prototype.touchcancel=function(){this.reset()},Kr.prototype.enable=function(){this._enabled=!0},Kr.prototype.disable=function(){this._enabled=!1,this.reset()},Kr.prototype.isEnabled=function(){return this._enabled},Kr.prototype.isActive=function(){return this._active};var qr={0:1,2:2},Jr=function(e){this.reset(),this._clickTolerance=e.clickTolerance||1};Jr.prototype.blur=function(){this.reset()},Jr.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Jr.prototype._correctButton=function(e,t){return!1},Jr.prototype._move=function(e,t){return{}},Jr.prototype.mousedown=function(e,t){if(!this._lastPoint){var r=n.mouseButton(e);this._correctButton(e,r)&&(this._lastPoint=t,this._eventButton=r)}},Jr.prototype.mousemoveWindow=function(e,t){var n=this._lastPoint;if(n){if(e.preventDefault(),function(e,t){var n=qr[t];return e.buttons===void 0||(e.buttons&n)!==n}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(n)0&&(this._active=!0);var i=Ur(r,n),a=new e.Point(0,0),o=new e.Point(0,0),s=0;for(var c in i){var l=i[c],u=this._touches[c];u&&(a._add(l),o._add(l.sub(u)),s++,i[c]=l)}if(this._touches=i,!(sMath.abs(e.x)}var oi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},t.prototype._start=function(e){this._lastPoints=e,ai(e[0].sub(e[1]))&&(this._valid=!1)},t.prototype._move=function(e,t,n){var r=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,i,n.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(r.y+i.y)/2*-.5}},t.prototype.gestureBeginsVertically=function(e,t,n){if(this._valid!==void 0)return this._valid;var r=e.mag()>=2,i=t.mag()>=2;if(r||i){if(!r||!i)return this._firstMove===void 0&&(this._firstMove=n),n-this._firstMove<100&&void 0;var a=e.y>0==t.y>0;return ai(e)&&ai(t)&&a}},t}($r),si={panStep:100,bearingStep:15,pitchStep:10},ci=function(){var e=si;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1};function li(e){return e*(2-e)}ci.prototype.blur=function(){this.reset()},ci.prototype.reset=function(){this._active=!1},ci.prototype.keydown=function(e){var t=this;if(!(e.altKey||e.ctrlKey||e.metaKey)){var n=0,r=0,i=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:function(s){var c=s.getZoom();s.easeTo({duration:300,easeId:`keyboardHandler`,easing:li,zoom:n?Math.round(c)+n*(e.shiftKey?2:1):c,bearing:s.getBearing()+r*t._bearingStep,pitch:s.getPitch()+i*t._pitchStep,offset:[-a*t._panStep,-o*t._panStep],center:s.getCenter()},{originalEvent:e})}}}},ci.prototype.enable=function(){this._enabled=!0},ci.prototype.disable=function(){this._enabled=!1,this.reset()},ci.prototype.isEnabled=function(){return this._enabled},ci.prototype.isActive=function(){return this._active},ci.prototype.disableRotation=function(){this._rotationDisabled=!0},ci.prototype.enableRotation=function(){this._rotationDisabled=!1};var ui=function(t,n){this._map=t,this._el=t.getCanvasContainer(),this._handler=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,e.bindAll([`_onTimeout`],this)};ui.prototype.setZoomRate=function(e){this._defaultZoomRate=e},ui.prototype.setWheelZoomRate=function(e){this._wheelZoomRate=e},ui.prototype.isEnabled=function(){return!!this._enabled},ui.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},ui.prototype.isZooming=function(){return!!this._zooming},ui.prototype.enable=function(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=e&&e.around===`center`)},ui.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ui.prototype.wheel=function(t){if(this.isEnabled()){var n=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,r=e.browser.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,n!==0&&n%4.000244140625==0?this._type=`wheel`:n!==0&&Math.abs(n)<4?this._type=`trackpad`:i>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*n)<200?`trackpad`:`wheel`,this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}},ui.prototype._onTimeout=function(e){this._type=`wheel`,this._delta-=this._lastValue,this._active||this._start(e)},ui.prototype._start=function(t){if(this._delta){this._frameId&&=null,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var r=n.mousePos(this._el,t);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ui.prototype.renderFrame=function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var n=this._map.transform;if(this._delta!==0){var r=this._type===`wheel`&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&i!==0&&(i=1/i);var a=typeof this._targetZoom==`number`?n.zoomScale(this._targetZoom):n.scale;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(a*i))),this._type===`wheel`&&(this._startZoom=n.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s=typeof this._targetZoom==`number`?this._targetZoom:n.zoom,c=this._startZoom,l=this._easing,u=!1;if(this._type===`wheel`&&c&&l){var d=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),f=l(d);o=e.number(c,s,f),d<1?this._frameId||=!0:u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-n.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ui.prototype._smoothOutEasing=function(t){var n=e.ease;if(this._prevEase){var r=this._prevEase,i=(e.browser.now()-r.start)/r.duration,a=r.easing(i+.01)-r.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);n=e.bezier(o,s,.25,1)}return this._prevEase={start:e.browser.now(),duration:t,easing:n},n},ui.prototype.blur=function(){this.reset()},ui.prototype.reset=function(){this._active=!1};var di=function(e,t){this._clickZoom=e,this._tapZoom=t};di.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},di.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},di.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},di.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var fi=function(){this.reset()};fi.prototype.reset=function(){this._active=!1},fi.prototype.blur=function(){this.reset()},fi.prototype.dblclick=function(e,t){return e.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(e.shiftKey?-1:1),around:n.unproject(t)},{originalEvent:e})}}},fi.prototype.enable=function(){this._enabled=!0},fi.prototype.disable=function(){this._enabled=!1,this.reset()},fi.prototype.isEnabled=function(){return this._enabled},fi.prototype.isActive=function(){return this._active};var pi=function(){this._tap=new Gr({numTouches:1,numTaps:1}),this.reset()};pi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},pi.prototype.touchstart=function(e,t,n){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=t[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(e,t,n))},pi.prototype.touchmove=function(e,t,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var r=t[0],i=r.y-this._swipePoint.y;return this._swipePoint=r,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,n)},pi.prototype.touchend=function(e,t,n){this._tapTime?this._swipePoint&&n.length===0&&this.reset():this._tap.touchend(e,t,n)&&(this._tapTime=e.timeStamp)},pi.prototype.touchcancel=function(){this.reset()},pi.prototype.enable=function(){this._enabled=!0},pi.prototype.disable=function(){this._enabled=!1,this.reset()},pi.prototype.isEnabled=function(){return this._enabled},pi.prototype.isActive=function(){return this._active};var mi=function(e,t,n){this._el=e,this._mousePan=t,this._touchPan=n};mi.prototype.enable=function(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add(`mapboxgl-touch-drag-pan`)},mi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove(`mapboxgl-touch-drag-pan`)},mi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},mi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var hi=function(e,t,n){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=n};hi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},hi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},hi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},hi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var gi=function(e,t,n,r){this._el=e,this._touchZoom=t,this._touchRotate=n,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0};gi.prototype.enable=function(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add(`mapboxgl-touch-zoom-rotate`)},gi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove(`mapboxgl-touch-zoom-rotate`)},gi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},gi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},gi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},gi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var _i=function(e){return e.zoom||e.drag||e.pitch||e.rotate},vi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(e.Event);function yi(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}var bi=function(t,r){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ir(t),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r),e.bindAll([`handleEvent`,`handleWindowEvent`],this);var i=this._el;this._listeners=[[i,`touchstart`,{passive:!0}],[i,`touchmove`,{passive:!1}],[i,`touchend`,void 0],[i,`touchcancel`,void 0],[i,`mousedown`,void 0],[i,`mousemove`,void 0],[i,`mouseup`,void 0],[e.window.document,`mousemove`,{capture:!0}],[e.window.document,`mouseup`,void 0],[i,`mouseover`,void 0],[i,`mouseout`,void 0],[i,`dblclick`,void 0],[i,`click`,void 0],[i,`keydown`,{capture:!1}],[i,`keyup`,void 0],[i,`wheel`,{passive:!1}],[i,`contextmenu`,void 0],[e.window,`blur`,void 0]];for(var a=0,o=this._listeners;aa?Math.min(2,x):Math.max(.5,x))**(1-t),S=i.unproject(y.add(b.mult(t*g)).mult(h));i.setLocationAtPoint(i.renderWorldCopies?S.wrap():S,m)}r._fireMoveEvents(n)}),(function(e){r._afterEase(n,e)}),t),this},n.prototype._prepareEase=function(t,n,r){r===void 0&&(r={}),this._moving=!0,n||r.moving||this.fire(new e.Event(`movestart`,t)),this._zooming&&!r.zooming&&this.fire(new e.Event(`zoomstart`,t)),this._rotating&&!r.rotating&&this.fire(new e.Event(`rotatestart`,t)),this._pitching&&!r.pitching&&this.fire(new e.Event(`pitchstart`,t))},n.prototype._fireMoveEvents=function(t){this.fire(new e.Event(`move`,t)),this._zooming&&this.fire(new e.Event(`zoom`,t)),this._rotating&&this.fire(new e.Event(`rotate`,t)),this._pitching&&this.fire(new e.Event(`pitch`,t))},n.prototype._afterEase=function(t,n){if(!this._easeId||!n||this._easeId!==n){delete this._easeId;var r=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,r&&this.fire(new e.Event(`zoomend`,t)),i&&this.fire(new e.Event(`rotateend`,t)),a&&this.fire(new e.Event(`pitchend`,t)),this.fire(new e.Event(`moveend`,t))}},n.prototype.flyTo=function(t,n){var r=this;if(!t.essential&&e.browser.prefersReducedMotion){var i=e.pick(t,[`center`,`zoom`,`bearing`,`pitch`,`around`]);return this.jumpTo(i,n)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);var a=this.transform,o=this.getZoom(),s=this.getBearing(),c=this.getPitch(),l=this.getPadding(),u=`zoom`in t?e.clamp(+t.zoom,a.minZoom,a.maxZoom):o,d=`bearing`in t?this._normalizeBearing(t.bearing,s):s,f=`pitch`in t?+t.pitch:c,p=`padding`in t?t.padding:a.padding,m=a.zoomScale(u-o),h=e.Point.convert(t.offset),g=a.centerPoint.add(h),_=a.pointLocation(g),v=e.LngLat.convert(t.center||_);this._normalizeCenter(v);var y=a.project(_),b=a.project(v).sub(y),x=t.curve,S=Math.max(a.width,a.height),C=S/m,w=b.mag();if(`minZoom`in t){var T=e.clamp(Math.min(t.minZoom,o,u),a.minZoom,a.maxZoom),E=S/a.zoomScale(T-o);x=Math.sqrt(E/w*2)}var D=x*x;function O(e){var t=(C*C-S*S+(e?-1:1)*D*D*w*w)/(2*(e?C:S)*D*w);return Math.log(Math.sqrt(t*t+1)-t)}function k(e){return(Math.exp(e)-Math.exp(-e))/2}function A(e){return(Math.exp(e)+Math.exp(-e))/2}var j=O(0),M=function(e){return A(j)/A(j+x*e)},N=function(e){return S*((A(j)*(k(t=j+x*e)/A(t))-k(j))/D)/w;var t},P=(O(1)-j)/x;if(Math.abs(w)<1e-6||!isFinite(P)){if(Math.abs(S-C)<1e-6)return this.easeTo(t,n);var ee=Ct.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==d,this._pitching=f!==c,this._padding=!a.isPaddingEqual(p),this._prepareEase(n,!1),this._ease((function(t){var i=t*P,m=1/M(i);a.zoom=t===1?u:o+a.scaleZoom(m),r._rotating&&(a.bearing=e.number(s,d,t)),r._pitching&&(a.pitch=e.number(c,f,t)),r._padding&&(a.interpolatePadding(l,p,t),g=a.centerPoint.add(h));var _=t===1?v:a.unproject(y.add(b.mult(N(i))).mult(m));a.setLocationAtPoint(a.renderWorldCopies?_.wrap():_,g),r._fireMoveEvents(n)}),(function(){return r._afterEase(n)}),t),this},n.prototype.isEasing=function(){return!!this._easeFrameId},n.prototype.stop=function(){return this._stop()},n.prototype._stop=function(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var n=this._onEaseEnd;delete this._onEaseEnd,n.call(this,t)}if(!e){var r=this.handlers;r&&r.stop(!1)}return this},n.prototype._ease=function(t,n,r){!1===r.animate||r.duration===0?(t(1),n()):(this._easeStart=e.browser.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},n.prototype._renderFrameCallback=function(){var t=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},n.prototype._normalizeBearing=function(t,n){t=e.wrap(t,-180,180);var r=Math.abs(t-n);return Math.abs(t-360-n)180?-360:n<-180?360:0}},n}(e.Evented),Si=function(t){t===void 0&&(t={}),this.options=t,e.bindAll([`_toggleAttribution`,`_updateEditLink`,`_updateData`,`_updateCompact`],this)};Si.prototype.getDefaultPosition=function(){return`bottom-right`},Si.prototype.onAdd=function(e){var t=this.options&&this.options.compact;return this._map=e,this._container=n.create(`div`,`mapboxgl-ctrl mapboxgl-ctrl-attrib`),this._compactButton=n.create(`button`,`mapboxgl-ctrl-attrib-button`,this._container),this._compactButton.addEventListener(`click`,this._toggleAttribution),this._setElementTitle(this._compactButton,`ToggleAttribution`),this._innerContainer=n.create(`div`,`mapboxgl-ctrl-attrib-inner`,this._container),this._innerContainer.setAttribute(`role`,`list`),t&&this._container.classList.add(`mapboxgl-compact`),this._updateAttributions(),this._updateEditLink(),this._map.on(`styledata`,this._updateData),this._map.on(`sourcedata`,this._updateData),this._map.on(`moveend`,this._updateEditLink),t===void 0&&(this._map.on(`resize`,this._updateCompact),this._updateCompact()),this._container},Si.prototype.onRemove=function(){n.remove(this._container),this._map.off(`styledata`,this._updateData),this._map.off(`sourcedata`,this._updateData),this._map.off(`moveend`,this._updateEditLink),this._map.off(`resize`,this._updateCompact),this._map=void 0,this._attribHTML=void 0},Si.prototype._setElementTitle=function(e,t){var n=this._map._getUIString(`AttributionControl.`+t);e.title=n,e.setAttribute(`aria-label`,n)},Si.prototype._toggleAttribution=function(){this._container.classList.contains(`mapboxgl-compact-show`)?(this._container.classList.remove(`mapboxgl-compact-show`),this._compactButton.setAttribute(`aria-pressed`,`false`)):(this._container.classList.add(`mapboxgl-compact-show`),this._compactButton.setAttribute(`aria-pressed`,`true`))},Si.prototype._updateEditLink=function(){var t=this._editLink;t||=this._editLink=this._container.querySelector(`.mapbox-improve-map`);var n=[{key:`owner`,value:this.styleOwner},{key:`id`,value:this.styleId},{key:`access_token`,value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(t){var r=n.reduce((function(e,t,r){return t.value&&(e+=t.key+`=`+t.value+(r=0)return!1;return!0}))).join(` | `);o!==this._attribHTML&&(this._attribHTML=o,e.length?(this._innerContainer.innerHTML=o,this._container.classList.remove(`mapboxgl-attrib-empty`)):this._container.classList.add(`mapboxgl-attrib-empty`),this._editLink=null)}},Si.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add(`mapboxgl-compact`):this._container.classList.remove(`mapboxgl-compact`,`mapboxgl-compact-show`)};var Ci=function(){e.bindAll([`_updateLogo`],this),e.bindAll([`_updateCompact`],this)};Ci.prototype.onAdd=function(e){this._map=e,this._container=n.create(`div`,`mapboxgl-ctrl`);var t=n.create(`a`,`mapboxgl-ctrl-logo`);return t.target=`_blank`,t.rel=`noopener nofollow`,t.href=`https://www.mapbox.com/`,t.setAttribute(`aria-label`,this._map._getUIString(`LogoControl.Title`)),t.setAttribute(`rel`,`noopener nofollow`),this._container.appendChild(t),this._container.style.display=`none`,this._map.on(`sourcedata`,this._updateLogo),this._updateLogo(),this._map.on(`resize`,this._updateCompact),this._updateCompact(),this._container},Ci.prototype.onRemove=function(){n.remove(this._container),this._map.off(`sourcedata`,this._updateLogo),this._map.off(`resize`,this._updateCompact)},Ci.prototype.getDefaultPosition=function(){return`bottom-left`},Ci.prototype._updateLogo=function(e){e&&e.sourceDataType!==`metadata`||(this._container.style.display=this._logoRequired()?`block`:`none`)},Ci.prototype._logoRequired=function(){if(this._map.style){var e=this._map.style.sourceCaches;for(var t in e)if(e[t].getSource().mapbox_logo)return!0;return!1}},Ci.prototype._updateCompact=function(){var e=this._container.children;if(e.length){var t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add(`mapboxgl-compact`):t.classList.remove(`mapboxgl-compact`)}};var wi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};wi.prototype.add=function(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t},wi.prototype.remove=function(e){for(var t=this._currentlyRunning,n=0,r=t?this._queue.concat(t):this._queue;nt.maxZoom)throw Error(`maxZoom must be greater than or equal to minZoom`);if(t.minPitch!=null&&t.maxPitch!=null&&t.minPitch>t.maxPitch)throw Error(`maxPitch must be greater than or equal to minPitch`);if(t.minPitch!=null&&t.minPitch<0)throw Error(`minPitch must be greater than or equal to 0`);if(t.maxPitch!=null&&t.maxPitch>60)throw Error(`maxPitch must be less than or equal to 60`);var i=new K(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies);if(r.call(this,i,t),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new wi,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Ti,t.locale),this._clickTolerance=t.clickTolerance,this._requestManager=new e.RequestManager(t.transformRequest,t.accessToken),typeof t.container==`string`){if(this._container=e.window.document.getElementById(t.container),!this._container)throw Error(`Container '`+t.container+`' not found.`)}else{if(!(t.container instanceof Di))throw Error(`Invalid type: 'container' must be a String or HTMLElement.`);this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll([`_onWindowOnline`,`_onWindowResize`,`_onMapScroll`,`_contextLost`,`_contextRestored`],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw Error(`Failed to initialize WebGL.`);this.on(`move`,(function(){return n._update(!1)})),this.on(`moveend`,(function(){return n._update(!1)})),this.on(`zoom`,(function(){return n._update(!0)})),e.window!==void 0&&(e.window.addEventListener(`online`,this._onWindowOnline,!1),e.window.addEventListener(`resize`,this._onWindowResize,!1),e.window.addEventListener(`orientationchange`,this._onWindowResize,!1)),this.handlers=new bi(this,t),this._hash=t.hash&&new Ar(typeof t.hash==`string`&&t.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new Si({customAttribution:t.customAttribution})),this.addControl(new Ci,t.logoPosition),this.on(`style.load`,(function(){n.transform.unmodified&&n.jumpTo(n.style.stylesheet)})),this.on(`data`,(function(t){n._update(t.dataType===`style`),n.fire(new e.Event(t.dataType+`data`,t))})),this.on(`dataloading`,(function(t){n.fire(new e.Event(t.dataType+`dataloading`,t))}))}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(t,n){if(n===void 0&&(n=t.getDefaultPosition?t.getDefaultPosition():`top-right`),!t||!t.onAdd)return this.fire(new e.ErrorEvent(Error(`Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.`)));var r=t.onAdd(this);this._controls.push(t);var i=this._controlPositions[n];return n.indexOf(`bottom`)===-1?i.appendChild(r):i.insertBefore(r,i.firstChild),this},i.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(Error(`Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.`)));var n=this._controls.indexOf(t);return n>-1&&this._controls.splice(n,1),t.onRemove(this),this},i.prototype.hasControl=function(e){return this._controls.indexOf(e)>-1},i.prototype.resize=function(t){var n=this._containerDimensions(),r=n[0],i=n[1];if(r===this.transform.width&&i===this.transform.height)return this;this._resizeCanvas(r,i),this.transform.resize(r,i),this.painter.resize(r,i);var a=!this._moving;return a&&this.fire(new e.Event(`movestart`,t)).fire(new e.Event(`move`,t)),this.fire(new e.Event(`resize`,t)),a&&this.fire(new e.Event(`moveend`,t)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()},i.prototype.setMinZoom=function(e){if((e??=-2)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw Error(`maxZoom must be greater than the current minZoom`)},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(e){if((e??=0)<0)throw Error(`minPitch must be greater than or equal to 0`);if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()60)throw Error(`maxPitch must be less than or equal to 60`);if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw Error(`maxPitch must be greater than the current minPitch`)},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(e){return this.transform.renderWorldCopies=e,this._update()},i.prototype.project=function(t){return this.transform.locationPoint(e.LngLat.convert(t))},i.prototype.unproject=function(t){return this.transform.pointLocation(e.Point.convert(t))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(e,t,n){var r,i=this;if(e===`mouseenter`||e===`mouseover`){var a=!1;return{layer:t,listener:n,delegates:{mousemove:function(r){var o=i.getLayer(t)?i.queryRenderedFeatures(r.point,{layers:[t]}):[];o.length?a||(a=!0,n.call(i,new J(e,i,r.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if(e===`mouseleave`||e===`mouseout`){var o=!1;return{layer:t,listener:n,delegates:{mousemove:function(r){(i.getLayer(t)?i.queryRenderedFeatures(r.point,{layers:[t]}):[]).length?o=!0:o&&(o=!1,n.call(i,new J(e,i,r.originalEvent)))},mouseout:function(t){o&&(o=!1,n.call(i,new J(e,i,t.originalEvent)))}}}}return{layer:t,listener:n,delegates:(r={},r[e]=function(e){var r=i.getLayer(t)?i.queryRenderedFeatures(e.point,{layers:[t]}):[];r.length&&(e.features=r,n.call(i,e),delete e.features)},r)}},i.prototype.on=function(e,t,n){if(n===void 0)return r.prototype.on.call(this,e,t);var i=this._createDelegatedListener(e,t,n);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(e,t,n){if(n===void 0)return r.prototype.once.call(this,e,t);var i=this._createDelegatedListener(e,t,n);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(e,t,n){var i=this;return n===void 0?r.prototype.off.call(this,e,t):(this._delegatedListeners&&this._delegatedListeners[e]&&function(r){for(var a=r[e],o=0;o180;){var s=r.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}Pi.prototype.down=function(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),n.disableDrag()},Pi.prototype.move=function(e,t){var n=this.map,r=this.mouseRotate.mousemoveWindow(e,t);if(r&&r.bearingDelta&&n.setBearing(n.getBearing()+r.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(e,t);i&&i.pitchDelta&&n.setPitch(n.getPitch()+i.pitchDelta)}},Pi.prototype.off=function(){var e=this.element;n.removeEventListener(e,`mousedown`,this.mousedown),n.removeEventListener(e,`touchstart`,this.touchstart,{passive:!1}),n.removeEventListener(e,`touchmove`,this.touchmove),n.removeEventListener(e,`touchend`,this.touchend),n.removeEventListener(e,`touchcancel`,this.reset),this.offTemp()},Pi.prototype.offTemp=function(){n.enableDrag(),n.removeEventListener(e.window,`mousemove`,this.mousemove),n.removeEventListener(e.window,`mouseup`,this.mouseup)},Pi.prototype.mousedown=function(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),n.mousePos(this.element,t)),n.addEventListener(e.window,`mousemove`,this.mousemove),n.addEventListener(e.window,`mouseup`,this.mouseup)},Pi.prototype.mousemove=function(e){this.move(e,n.mousePos(this.element,e))},Pi.prototype.mouseup=function(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()},Pi.prototype.touchstart=function(e){e.targetTouches.length===1?(this._startPos=this._lastPos=n.touchPos(this.element,e.targetTouches)[0],this.down({type:`mousedown`,button:0,ctrlKey:!0,preventDefault:function(){return e.preventDefault()}},this._startPos)):this.reset()},Pi.prototype.touchmove=function(e){e.targetTouches.length===1?(this._lastPos=n.touchPos(this.element,e.targetTouches)[0],this.move({preventDefault:function(){return e.preventDefault()}},this._lastPos)):this.reset()},Pi.prototype.touchend=function(e){e.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=n}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents=`none`,this._state===`pending`&&(this._state=`active`,this.fire(new e.Event(`dragstart`))),this.fire(new e.Event(`drag`)))},r.prototype._onUp=function(){this._element.style.pointerEvents=`auto`,this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off(`mousemove`,this._onMove),this._map.off(`touchmove`,this._onMove),this._state===`active`&&this.fire(new e.Event(`dragend`)),this._state=`inactive`},r.prototype._addDragHandler=function(e){this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.point,this._state=`pending`,this._map.on(`mousemove`,this._onMove),this._map.on(`touchmove`,this._onMove),this._map.once(`mouseup`,this._onUp),this._map.once(`touchend`,this._onUp))},r.prototype.setDraggable=function(e){return this._draggable=!!e,this._map&&(e?(this._map.on(`mousedown`,this._addDragHandler),this._map.on(`touchstart`,this._addDragHandler)):(this._map.off(`mousedown`,this._addDragHandler),this._map.off(`touchstart`,this._addDragHandler))),this},r.prototype.isDraggable=function(){return this._draggable},r.prototype.setRotation=function(e){return this._rotation=e||0,this._update(),this},r.prototype.getRotation=function(){return this._rotation},r.prototype.setRotationAlignment=function(e){return this._rotationAlignment=e||`auto`,this._update(),this},r.prototype.getRotationAlignment=function(){return this._rotationAlignment},r.prototype.setPitchAlignment=function(e){return this._pitchAlignment=e&&e!==`auto`?e:this._rotationAlignment,this._update(),this},r.prototype.getPitchAlignment=function(){return this._pitchAlignment},r}(e.Evented),Bi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Vi=0,Hi=!1,Ui=function(t){function r(n){t.call(this),this.options=e.extend({},Bi,n),e.bindAll([`_onSuccess`,`_onError`,`_onZoom`,`_finish`,`_setupUI`,`_updateCamera`,`_updateMarker`],this)}return t&&(r.__proto__=t),(r.prototype=Object.create(t&&t.prototype)).constructor=r,r.prototype.onAdd=function(t){var r;return this._map=t,this._container=n.create(`div`,`mapboxgl-ctrl mapboxgl-ctrl-group`),r=this._setupUI,Ri===void 0?e.window.navigator.permissions===void 0?r(Ri=!!e.window.navigator.geolocation):e.window.navigator.permissions.query({name:`geolocation`}).then((function(e){r(Ri=e.state!==`denied`)})):r(Ri),this._container},r.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),n.remove(this._container),this._map.off(`zoom`,this._onZoom),this._map=void 0,Vi=0,Hi=!1},r.prototype._isOutOfMapMaxBounds=function(e){var t=this._map.getMaxBounds(),n=e.coords;return t&&(n.longitudet.getEast()||n.latitudet.getNorth())},r.prototype._setErrorState=function(){switch(this._watchState){case`WAITING_ACTIVE`:this._watchState=`ACTIVE_ERROR`,this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-active`),this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-active-error`);break;case`ACTIVE_LOCK`:this._watchState=`ACTIVE_ERROR`,this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-active`),this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-active-error`),this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-waiting`);break;case`BACKGROUND`:this._watchState=`BACKGROUND_ERROR`,this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-background`),this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-background-error`),this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-waiting`)}},r.prototype._onSuccess=function(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event(`outofmaxbounds`,t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case`WAITING_ACTIVE`:case`ACTIVE_LOCK`:case`ACTIVE_ERROR`:this._watchState=`ACTIVE_LOCK`,this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-waiting`),this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-active-error`),this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-active`);break;case`BACKGROUND`:case`BACKGROUND_ERROR`:this._watchState=`BACKGROUND`,this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-waiting`),this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-background-error`),this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-background`)}this.options.showUserLocation&&this._watchState!==`OFF`&&this._updateMarker(t),this.options.trackUserLocation&&this._watchState!==`ACTIVE_LOCK`||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove(`mapboxgl-user-location-dot-stale`),this.fire(new e.Event(`geolocate`,t)),this._finish()}},r.prototype._updateCamera=function(t){var n=new e.LngLat(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,i=this._map.getBearing(),a=e.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(r),a,{geolocateSource:!0})},r.prototype._updateMarker=function(t){if(t){var n=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},r.prototype._updateCircleRadius=function(){var e=this._map._container.clientHeight/2,t=this._map.unproject([0,e]),n=this._map.unproject([1,e]),r=t.distanceTo(n),i=Math.ceil(2*this._accuracy/r);this._circleElement.style.width=i+`px`,this._circleElement.style.height=i+`px`},r.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},r.prototype._onError=function(t){if(this._map){if(this.options.trackUserLocation)if(t.code===1){this._watchState=`OFF`,this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-waiting`),this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-active`),this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-active-error`),this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-background`),this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-background-error`),this._geolocateButton.disabled=!0;var n=this._map._getUIString(`GeolocateControl.LocationNotAvailable`);this._geolocateButton.title=n,this._geolocateButton.setAttribute(`aria-label`,n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&Hi)return;this._setErrorState()}this._watchState!==`OFF`&&this.options.showUserLocation&&this._dotElement.classList.add(`mapboxgl-user-location-dot-stale`),this.fire(new e.Event(`error`,t)),this._finish()}},r.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},r.prototype._setupUI=function(t){var r=this;if(this._container.addEventListener(`contextmenu`,(function(e){return e.preventDefault()})),this._geolocateButton=n.create(`button`,`mapboxgl-ctrl-geolocate`,this._container),n.create(`span`,`mapboxgl-ctrl-icon`,this._geolocateButton).setAttribute(`aria-hidden`,!0),this._geolocateButton.type=`button`,!1===t){e.warnOnce(`Geolocation support is not available so the GeolocateControl will be disabled.`);var i=this._map._getUIString(`GeolocateControl.LocationNotAvailable`);this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute(`aria-label`,i)}else{var a=this._map._getUIString(`GeolocateControl.FindMyLocation`);this._geolocateButton.title=a,this._geolocateButton.setAttribute(`aria-label`,a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute(`aria-pressed`,`false`),this._watchState=`OFF`),this.options.showUserLocation&&(this._dotElement=n.create(`div`,`mapboxgl-user-location-dot`),this._userLocationDotMarker=new zi(this._dotElement),this._circleElement=n.create(`div`,`mapboxgl-user-location-accuracy-circle`),this._accuracyCircleMarker=new zi({element:this._circleElement,pitchAlignment:`map`}),this.options.trackUserLocation&&(this._watchState=`OFF`),this._map.on(`zoom`,this._onZoom)),this._geolocateButton.addEventListener(`click`,this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on(`movestart`,(function(t){t.geolocateSource||r._watchState!==`ACTIVE_LOCK`||t.originalEvent&&t.originalEvent.type===`resize`||(r._watchState=`BACKGROUND`,r._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-background`),r._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-active`),r.fire(new e.Event(`trackuserlocationend`)))}))},r.prototype.trigger=function(){if(!this._setup)return e.warnOnce(`Geolocate control triggered before added to a map`),!1;if(this.options.trackUserLocation){switch(this._watchState){case`OFF`:this._watchState=`WAITING_ACTIVE`,this.fire(new e.Event(`trackuserlocationstart`));break;case`WAITING_ACTIVE`:case`ACTIVE_LOCK`:case`ACTIVE_ERROR`:case`BACKGROUND_ERROR`:Vi--,Hi=!1,this._watchState=`OFF`,this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-waiting`),this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-active`),this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-active-error`),this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-background`),this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-background-error`),this.fire(new e.Event(`trackuserlocationend`));break;case`BACKGROUND`:this._watchState=`ACTIVE_LOCK`,this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-background`),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event(`trackuserlocationstart`))}switch(this._watchState){case`WAITING_ACTIVE`:this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-waiting`),this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-active`);break;case`ACTIVE_LOCK`:this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-active`);break;case`ACTIVE_ERROR`:this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-waiting`),this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-active-error`);break;case`BACKGROUND`:this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-background`);break;case`BACKGROUND_ERROR`:this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-waiting`),this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-background-error`)}if(this._watchState===`OFF`&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var t;this._geolocateButton.classList.add(`mapboxgl-ctrl-geolocate-waiting`),this._geolocateButton.setAttribute(`aria-pressed`,`true`),++Vi>1?(t={maximumAge:6e5,timeout:0},Hi=!0):(t=this.options.positionOptions,Hi=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},r.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove(`mapboxgl-ctrl-geolocate-waiting`),this._geolocateButton.setAttribute(`aria-pressed`,`false`),this.options.showUserLocation&&this._updateMarker(null)},r}(e.Evented),Wi={maxWidth:100,unit:`metric`},Gi=function(t){this.options=e.extend({},Wi,t),e.bindAll([`_onMove`,`setUnit`],this)};function Ki(e,t,n){var r=n&&n.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),o=e.unproject([r,i]),s=a.distanceTo(o);if(n&&n.unit===`imperial`){var c=3.2808*s;c>5280?qi(t,r,c/5280,e._getUIString(`ScaleControl.Miles`)):qi(t,r,c,e._getUIString(`ScaleControl.Feet`))}else n&&n.unit===`nautical`?qi(t,r,s/1852,e._getUIString(`ScaleControl.NauticalMiles`)):s>=1e3?qi(t,r,s/1e3,e._getUIString(`ScaleControl.Kilometers`)):qi(t,r,s,e._getUIString(`ScaleControl.Meters`))}function qi(e,t,n,r){var i,a,o,s=(i=n,(a=10**((``+Math.floor(i)).length-1))*(o=(o=i/a)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(e){var t=10**Math.ceil(-Math.log(e)/Math.LN10);return Math.round(e*t)/t}(o)));e.style.width=s/n*t+`px`,e.innerHTML=s+` `+r}Gi.prototype.getDefaultPosition=function(){return`bottom-left`},Gi.prototype._onMove=function(){Ki(this._map,this._container,this.options)},Gi.prototype.onAdd=function(e){return this._map=e,this._container=n.create(`div`,`mapboxgl-ctrl mapboxgl-ctrl-scale`,e.getContainer()),this._map.on(`move`,this._onMove),this._onMove(),this._container},Gi.prototype.onRemove=function(){n.remove(this._container),this._map.off(`move`,this._onMove),this._map=void 0},Gi.prototype.setUnit=function(e){this.options.unit=e,Ki(this._map,this._container,this.options)};var Ji=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.window.HTMLElement?this._container=t.container:e.warnOnce(`Full screen control 'container' must be a DOM element.`)),e.bindAll([`_onClickFullscreen`,`_changeIcon`],this),`onfullscreenchange`in e.window.document?this._fullscreenchange=`fullscreenchange`:`onmozfullscreenchange`in e.window.document?this._fullscreenchange=`mozfullscreenchange`:`onwebkitfullscreenchange`in e.window.document?this._fullscreenchange=`webkitfullscreenchange`:`onmsfullscreenchange`in e.window.document&&(this._fullscreenchange=`MSFullscreenChange`)};Ji.prototype.onAdd=function(t){return this._map=t,this._container||=this._map.getContainer(),this._controlContainer=n.create(`div`,`mapboxgl-ctrl mapboxgl-ctrl-group`),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display=`none`,e.warnOnce(`This device does not support fullscreen mode.`)),this._controlContainer},Ji.prototype.onRemove=function(){n.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ji.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},Ji.prototype._setupUI=function(){var t=this._fullscreenButton=n.create(`button`,`mapboxgl-ctrl-fullscreen`,this._controlContainer);n.create(`span`,`mapboxgl-ctrl-icon`,t).setAttribute(`aria-hidden`,!0),t.type=`button`,this._updateTitle(),this._fullscreenButton.addEventListener(`click`,this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Ji.prototype._updateTitle=function(){var e=this._getTitle();this._fullscreenButton.setAttribute(`aria-label`,e),this._fullscreenButton.title=e},Ji.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?`FullscreenControl.Exit`:`FullscreenControl.Enter`)},Ji.prototype._isFullscreen=function(){return this._fullscreen},Ji.prototype._changeIcon=function(){(e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(`mapboxgl-ctrl-shrink`),this._fullscreenButton.classList.toggle(`mapboxgl-ctrl-fullscreen`),this._updateTitle())},Ji.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Yi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:``,maxWidth:`240px`},Xi=[`a[href]`,`[tabindex]:not([tabindex='-1'])`,`[contenteditable]:not([contenteditable='false'])`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`].join(`, `),Zi=function(t){function r(n){t.call(this),this.options=e.extend(Object.create(Yi),n),e.bindAll([`_update`,`_onClose`,`remove`,`_onMouseMove`,`_onMouseUp`,`_onDrag`],this)}return t&&(r.__proto__=t),(r.prototype=Object.create(t&&t.prototype)).constructor=r,r.prototype.addTo=function(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on(`click`,this._onClose),this.options.closeOnMove&&this._map.on(`move`,this._onClose),this._map.on(`remove`,this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on(`mousemove`,this._onMouseMove),this._map.on(`mouseup`,this._onMouseUp),this._container&&this._container.classList.add(`mapboxgl-popup-track-pointer`),this._map._canvasContainer.classList.add(`mapboxgl-track-pointer`)):this._map.on(`move`,this._update),this.fire(new e.Event(`open`)),this},r.prototype.isOpen=function(){return!!this._map},r.prototype.remove=function(){return this._content&&n.remove(this._content),this._container&&(n.remove(this._container),delete this._container),this._map&&(this._map.off(`move`,this._update),this._map.off(`move`,this._onClose),this._map.off(`click`,this._onClose),this._map.off(`remove`,this.remove),this._map.off(`mousemove`,this._onMouseMove),this._map.off(`mouseup`,this._onMouseUp),this._map.off(`drag`,this._onDrag),delete this._map),this.fire(new e.Event(`close`)),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on(`move`,this._update),this._map.off(`mousemove`,this._onMouseMove),this._container&&this._container.classList.remove(`mapboxgl-popup-track-pointer`),this._map._canvasContainer.classList.remove(`mapboxgl-track-pointer`)),this},r.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off(`move`,this._update),this._map.on(`mousemove`,this._onMouseMove),this._map.on(`drag`,this._onDrag),this._container&&this._container.classList.add(`mapboxgl-popup-track-pointer`),this._map._canvasContainer.classList.add(`mapboxgl-track-pointer`)),this},r.prototype.getElement=function(){return this._container},r.prototype.setText=function(t){return this.setDOMContent(e.window.document.createTextNode(t))},r.prototype.setHTML=function(t){var n,r=e.window.document.createDocumentFragment(),i=e.window.document.createElement(`body`);for(i.innerHTML=t;n=i.firstChild;)r.appendChild(n);return this.setDOMContent(r)},r.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},r.prototype.setMaxWidth=function(e){return this.options.maxWidth=e,this._update(),this},r.prototype.setDOMContent=function(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=n.create(`div`,`mapboxgl-popup-content`,this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this},r.prototype.addClassName=function(e){this._container&&this._container.classList.add(e)},r.prototype.removeClassName=function(e){this._container&&this._container.classList.remove(e)},r.prototype.setOffset=function(e){return this.options.offset=e,this._update(),this},r.prototype.toggleClassName=function(e){if(this._container)return this._container.classList.toggle(e)},r.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=n.create(`button`,`mapboxgl-popup-close-button`,this._content),this._closeButton.type=`button`,this._closeButton.setAttribute(`aria-label`,`Close popup`),this._closeButton.innerHTML=`×`,this._closeButton.addEventListener(`click`,this._onClose))},r.prototype._onMouseUp=function(e){this._update(e.point)},r.prototype._onMouseMove=function(e){this._update(e.point)},r.prototype._onDrag=function(e){this._update(e.point)},r.prototype._update=function(t){var r=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=n.create(`div`,`mapboxgl-popup`,this._map.getContainer()),this._tip=n.create(`div`,`mapboxgl-popup-tip`,this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(` `).forEach((function(e){return r._container.classList.add(e)})),this._trackPointer&&this._container.classList.add(`mapboxgl-popup-track-pointer`)),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Fi(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||t)){var i=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),a=this.options.anchor,o=function t(n){if(n){if(typeof n==`number`){var r=Math.round(Math.sqrt(.5*n**2));return{center:new e.Point(0,0),top:new e.Point(0,n),"top-left":new e.Point(r,r),"top-right":new e.Point(-r,r),bottom:new e.Point(0,-n),"bottom-left":new e.Point(r,-r),"bottom-right":new e.Point(-r,-r),left:new e.Point(n,0),right:new e.Point(-n,0)}}if(n instanceof e.Point||Array.isArray(n)){var i=e.Point.convert(n);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:e.Point.convert(n.center||[0,0]),top:e.Point.convert(n.top||[0,0]),"top-left":e.Point.convert(n[`top-left`]||[0,0]),"top-right":e.Point.convert(n[`top-right`]||[0,0]),bottom:e.Point.convert(n.bottom||[0,0]),"bottom-left":e.Point.convert(n[`bottom-left`]||[0,0]),"bottom-right":e.Point.convert(n[`bottom-right`]||[0,0]),left:e.Point.convert(n.left||[0,0]),right:e.Point.convert(n.right||[0,0])}}return t(new e.Point(0,0))}(this.options.offset);if(!a){var s,c=this._container.offsetWidth,l=this._container.offsetHeight;s=i.y+o.bottom.ythis._map.transform.height-l?[`bottom`]:[],i.xthis._map.transform.width-c/2&&s.push(`right`),a=s.length===0?`bottom`:s.join(`-`)}var u=i.add(o[a]).round();n.setTransform(this._container,Ii[a]+` translate(`+u.x+`px,`+u.y+`px)`),Li(this._container,a,`popup`)}},r.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var e=this._container.querySelector(Xi);e&&e.focus()}},r.prototype._onClose=function(){this.remove()},r}(e.Evented),Qi={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:Ai,NavigationControl:Ni,GeolocateControl:Ui,AttributionControl:Si,ScaleControl:Gi,FullscreenControl:Ji,Popup:Zi,Marker:zi,Style:Yt,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:function(){Ge().acquire(Ve)},clearPrewarmedResources:function(){var e=Ue;e&&(e.isPreloaded()&&e.numActive()===1?(e.release(Ve),Ue=null):console.warn(`Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()`))},get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return He.workerCount},set workerCount(e){He.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){e.clearTileCache(t)},workerUrl:``};return Qi})),n}))}))()),SO=1e-7;function CO(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function wO(e,t){if(e===t)return!0;if(CO(e)&&CO(t)){if(e.length!==t.length)return!1;for(var n=0;n0,"`scale` must be a positive number");var i=this._state,a=i.startZoom,o=i.startZoomLngLat;Number.isFinite(a)||(a=this._viewportProps.zoom,o=this._unproject(n)||this._unproject(t)),DO(o,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var s=this._calculateNewZoom({scale:r,startZoom:a||0}),c=re(new ZD(Object.assign({},this._viewportProps,{zoom:s})).getMapCenterByLngLatPosition({lngLat:o,pos:t}),2),l=c[0],u=c[1];return this._getUpdatedMapState({zoom:s,longitude:l,latitude:u})}},{key:`zoomEnd`,value:function(){return this._getUpdatedMapState({startZoomLngLat:null,startZoom:null})}},{key:`_getUpdatedMapState`,value:function(t){return new e(Object.assign({},this._viewportProps,this._state,t))}},{key:`_applyConstraints`,value:function(e){var t=e.maxZoom,n=e.minZoom,r=e.zoom;e.zoom=TO(r,n,t);var i=e.maxPitch,a=e.minPitch,o=e.pitch;return e.pitch=TO(o,a,i),Object.assign(e,$D(e)),e}},{key:`_unproject`,value:function(e){var t=new ZD(this._viewportProps);return e&&t.unproject(e)}},{key:`_calculateNewLngLat`,value:function(e){var t=e.startPanLngLat,n=e.pos;return new ZD(this._viewportProps).getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:`_calculateNewZoom`,value:function(e){var t=e.scale,n=e.startZoom,r=this._viewportProps,i=r.maxZoom,a=r.minZoom;return TO(n+Math.log2(t),a,i)}},{key:`_calculateNewPitchAndBearing`,value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,r=e.startBearing,i=e.startPitch;n=TO(n,-1,1);var a=this._viewportProps,o=a.minPitch,s=a.maxPitch,c=r+180*t,l=i;return n>0?l=i+n*(s-i):n<0&&(l=i-n*(o-i)),{pitch:l,bearing:c}}},{key:`_getRotationParams`,value:function(e,t){var n=e[0]-t[0],r=e[1]-t[1],i=e[1],a=t[1],o=this._viewportProps,s=o.width,c=o.height,l=n/s,u=0;return r>0?Math.abs(c-a)>MO&&(u=r/(a-c)*NO):r<0&&a>MO&&(u=1-i/a),u=Math.min(1,Math.max(-1,u)),{deltaScaleX:l,deltaScaleY:u}}}]),e}();function FO(e){return e[0].toLowerCase()+e.slice(1)}function IO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:AO;for(var n in t){var r=n.slice(0,3),i=FO(n.slice(3));if(r===`min`&&e[i]t[n])return!1}return!0}function LO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function RO(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},r=e.current&&e.current.getMap();return r&&r.queryRenderedFeatures(t,n)}}}var tk=(0,X.forwardRef)(function(e,t){var n=re((0,X.useState)(!0),2),r=n[0],i=n[1],a=re((0,X.useState)({width:0,height:0}),2),o=a[0],s=a[1],c=(0,X.useRef)(null),l=(0,X.useRef)(null),u=(0,X.useRef)(null),d=(0,X.useRef)(null),f=(0,X.useContext)(zO);HO(function(){if(tk.supported()){var t=new bO(WO(WO(WO({},e),o),{},{mapboxgl:xO.default,container:l.current,onError:function(t){(t.error&&t.error.status||t.status)===YO&&r&&(console.error(KO),i(!1)),e.onError(t)}}));c.current=t,f&&f.setMap&&f.setMap(t.getMap());var n=new ne(function(t){if(t[0].contentRect){var n=t[0].contentRect,r=n.width,i=n.height;s({width:r,height:i}),e.onResize({width:r,height:i})}});return n.observe(u.current),function(){t.finalize(),c.current=null,n.disconnect()}}},[]),HO(function(){c.current&&c.current.setProps(WO(WO({},e),o))});var p=c.current&&c.current.getMap();(0,X.useImperativeHandle)(t,function(){return ek(c)},[]);var m=(0,X.useCallback)(function(e){var t=e.target;t===d.current&&t.scrollTo(0,0)},[]),h=p&&X.createElement(BO,{value:WO(WO({},f),{},{viewport:f.viewport||JO(WO({map:p,props:e},o)),map:p,container:f.container||u.current})},X.createElement(`div`,{key:`map-overlays`,className:`overlays`,ref:d,style:XO,onScroll:m},e.children)),g=e.className,_=e.width,v=e.height,y=e.style,b=e.visibilityConstraints,x=Object.assign({position:`relative`},y,{width:_,height:v}),S=e.visible&&IO(e.viewState||e,b),C=Object.assign({},XO,{visibility:S?`inherit`:`hidden`});return X.createElement(`div`,{key:`map-container`,ref:u,style:x},X.createElement(`div`,{key:`map-mapbox`,ref:l,style:C,className:g}),h,!r&&!e.disableTokenWarning&&X.createElement($O,null))});tk.supported=function(){return xO.default&&xO.default.supported()},tk.propTypes=ZO,tk.defaultProps=QO;function nk(e,t){var n;if(typeof Symbol>`u`||e[Symbol.iterator]==null){if(Array.isArray(e)||(n=rk(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(o)throw s}}}}function rk(e,t){if(e){if(typeof e==`string`)return ik(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ik(e,t)}}function ik(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n180&&(n=n<0?n+360:n-360),n}function uk(e,t){var n;if(typeof Symbol>`u`||e[Symbol.iterator]==null){if(Array.isArray(e)||(n=dk(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(o)throw s}}}}function dk(e,t){if(e){if(typeof e==`string`)return fk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fk(e,t)}}function fk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var hk=[`longitude`,`latitude`,`zoom`,`bearing`,`pitch`],gk=[`latitude`,`longitude`,`zoom`,`width`,`height`],_k=[`bearing`,`pitch`],vk={speed:1.2,curve:1.414};(function(e){oe(n,e);var t=pk(n);function n(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ie(this,n),e=t.call(this),C(ce(e),`propNames`,hk),e.props=Object.assign({},vk,r),e}return ae(n,[{key:`initializeProps`,value:function(e,t){var n={},r={},i=uk(gk),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=e[o],c=t[o];DO(sk(s)&&sk(c),`${o} must be supplied for transition`),n[o]=s,r[o]=lk(o,s,c)}}catch(e){i.e(e)}finally{i.f()}var l=uk(_k),u;try{for(l.s();!(u=l.n()).done;){var d=u.value,f=e[d]||0,p=t[d]||0;n[d]=f,r[d]=lk(d,f,p)}}catch(e){l.e(e)}finally{l.f()}return{start:n,end:r}}},{key:`interpolateProps`,value:function(e,t,n){var r=rO(e,t,n,this.props),i=uk(_k),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;r[o]=EO(e[o],t[o],n)}}catch(e){i.e(e)}finally{i.f()}return r}},{key:`getDuration`,value:function(e,t){var n=t.transitionDuration;return n===`auto`&&(n=iO(e,t,this.props)),n}}]),n})(ak);function yk(e,t){var n;if(typeof Symbol>`u`||e[Symbol.iterator]==null){if(Array.isArray(e)||(n=bk(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(o)throw s}}}}function bk(e,t){if(e){if(typeof e==`string`)return xk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xk(e,t)}}function xk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var wk=[`longitude`,`latitude`,`zoom`,`bearing`,`pitch`],Tk=function(e){oe(n,e);var t=Sk(n);function n(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ie(this,n),e=t.call(this),Array.isArray(r)&&(r={transitionProps:r}),e.propNames=r.transitionProps||wk,r.around&&(e.around=r.around),e}return ae(n,[{key:`initializeProps`,value:function(e,t){var n={},r={};if(this.around){n.around=this.around;var i=new ZD(e).unproject(this.around);Object.assign(r,t,{around:new ZD(t).project(i),aroundLngLat:i})}var a=yk(this.propNames),o;try{for(a.s();!(o=a.n()).done;){var s=o.value,c=e[s],l=t[s];DO(sk(c)&&sk(l),`${s} must be supplied for transition`),n[s]=c,r[s]=lk(s,c,l)}}catch(e){a.e(e)}finally{a.f()}return{start:n,end:r}}},{key:`interpolateProps`,value:function(e,t,n){var r={},i=yk(this.propNames),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;r[o]=EO(e[o],t[o],n)}}catch(e){i.e(e)}finally{i.f()}if(t.around){var s=re(new ZD(Object.assign({},t,r)).getMapCenterByLngLatPosition({lngLat:t.aroundLngLat,pos:EO(e.around,t.around,n)}),2),c=s[0],l=s[1];r.longitude=c,r.latitude=l}return r}}]),n}(ak),Ek=function(){};function Dk(e,t){var n=e(t);return function(r){return 1/(1-n)*(e(r*(1-t)+t)-n)}}var Ok={BREAK:1,SNAP_TO_END:2,IGNORE:3,UPDATE:4},kk={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new Tk,transitionInterruption:Ok.BREAK,onTransitionStart:Ek,onTransitionInterrupt:Ek,onTransitionEnd:Ek},Ak=function(){function e(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ie(this,e),C(this,`_animationFrame`,null),C(this,`_onTransitionFrame`,function(){t._animationFrame=requestAnimationFrame(t._onTransitionFrame),t._updateViewport()}),this.props=null,this.onViewportChange=n.onViewportChange||Ek,this.onStateChange=n.onStateChange||Ek,this.time=n.getTime||Date.now}return ae(e,[{key:`getViewportInTransition`,value:function(){return this._animationFrame?this.state.propsInTransition:null}},{key:`processViewportChange`,value:function(e){var t=this.props;if(this.props=e,!t||this._shouldIgnoreViewportChange(t,e))return!1;if(this._isTransitionEnabled(e)){var n=Object.assign({},t),r=Object.assign({},e);if(this._isTransitionInProgress()&&(t.onTransitionInterrupt(),this.state.interruption===Ok.SNAP_TO_END?Object.assign(n,this.state.endProps):Object.assign(n,this.state.propsInTransition),this.state.interruption===Ok.UPDATE)){var i=this.time(),a=(i-this.state.startTime)/this.state.duration;r.transitionDuration=this.state.duration-(i-this.state.startTime),r.transitionEasing=Dk(this.state.easing,a),r.transitionInterpolator=n.transitionInterpolator}return r.onTransitionStart(),this._triggerTransition(n,r),!0}return this._isTransitionInProgress()&&(t.onTransitionInterrupt(),this._endTransition()),!1}},{key:`_isTransitionInProgress`,value:function(){return!!this._animationFrame}},{key:`_isTransitionEnabled`,value:function(e){var t=e.transitionDuration,n=e.transitionInterpolator;return(t>0||t===`auto`)&&!!n}},{key:`_isUpdateDueToCurrentTransition`,value:function(e){return this.state.propsInTransition?this.state.interpolator.arePropsEqual(e,this.state.propsInTransition):!1}},{key:`_shouldIgnoreViewportChange`,value:function(e,t){return e?this._isTransitionInProgress()?this.state.interruption===Ok.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t):!0}},{key:`_triggerTransition`,value:function(e,t){DO(this._isTransitionEnabled(t)),this._animationFrame&&cancelAnimationFrame(this._animationFrame);var n=t.transitionInterpolator,r=n.getDuration?n.getDuration(e,t):t.transitionDuration;if(r!==0){var i=t.transitionInterpolator.initializeProps(e,t),a={inTransition:!0,isZooming:e.zoom!==t.zoom,isPanning:e.longitude!==t.longitude||e.latitude!==t.latitude,isRotating:e.bearing!==t.bearing||e.pitch!==t.pitch};this.state={duration:r,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startTime:this.time(),startProps:i.start,endProps:i.end,animation:null,propsInTransition:{}},this._onTransitionFrame(),this.onStateChange(a)}}},{key:`_endTransition`,value:function(){this._animationFrame&&=(cancelAnimationFrame(this._animationFrame),null),this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1})}},{key:`_updateViewport`,value:function(){var e=this.time(),t=this.state,n=t.startTime,r=t.duration,i=t.easing,a=t.interpolator,o=t.startProps,s=t.endProps,c=!1,l=(e-n)/r;l>=1&&(l=1,c=!0),l=i(l);var u=a.interpolateProps(o,s,l),d=new PO(Object.assign({},this.props,u));this.state.propsInTransition=d.getViewportProps(),this.onViewportChange(this.state.propsInTransition,this.props),c&&(this._endTransition(),this.props.onTransitionEnd())}}]),e}();C(Ak,`defaultProps`,kk);var jk=t(r(((e,t)=>{(function(e,n,r,i){var a=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],o=n.createElement(`div`),s=`function`,c=Math.round,l=Math.abs,u=Date.now;function d(e,t,n){return setTimeout(y(e,n),t)}function f(e,t,n){return Array.isArray(e)?(p(e,n[t],n),!0):!1}function p(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r\s*\(/gm,`{anonymous}()@`):`Unknown Stack Trace`,a=e.console&&(e.console.warn||e.console.log);return a&&a.call(e.console,i,r),t.apply(this,arguments)}}var h=typeof Object.assign==`function`?Object.assign:function(e){if(e===i||e===null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n-1}function E(e){return e.trim().split(/\s+/g)}function D(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;rn[t]}):r.sort()),r}function A(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),s=0;s1&&!n.firstMultiple?n.firstMultiple=be(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=xe(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Te(s,c),t.distance=we(s,c),V(n,t),t.offsetDirection=Ce(t.deltaX,t.deltaY);var d=Se(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=l(d.x)>l(d.y)?d.x:d.y,t.scale=o?De(o.pointers,r):1,t.rotation=o?Ee(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,H(n,t);var f=e.element;w(t.srcEvent.target,f)&&(f=t.srcEvent.target),t.target=f}function V(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===L||a.eventType===se)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function H(e,t){var n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,a,o,s,c;if(t.eventType!=ce&&(r>ae||n.velocity===i)){var u=t.deltaX-n.deltaX,d=t.deltaY-n.deltaY,f=Se(r,u,d);o=f.x,s=f.y,a=l(f.x)>l(f.y)?f.x:f.y,c=Ce(u,d),e.lastInterval=t}else a=n.velocity,o=n.velocityX,s=n.velocityY,c=n.direction;t.velocity=a,t.velocityX=o,t.velocityY=s,t.direction=c}function be(e){for(var t=[],n=0;n=l(t)?e<0?ue:de:t<0?fe:pe}function we(e,t,n){n||=he;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Te(e,t,n){n||=he;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function Ee(e,t){return Te(t[1],t[0],ge)+Te(e[1],e[0],ge)}function De(e,t){return we(t[0],t[1],ge)/we(e[0],e[1],ge)}var Oe={mousedown:L,mousemove:oe,mouseup:se},ke=`mousedown`,Ae=`mousemove mouseup`;function je(){this.evEl=ke,this.evWin=Ae,this.pressed=!1,_e.apply(this,arguments)}v(je,_e,{handler:function(e){var t=Oe[e.type];t&L&&e.button===0&&(this.pressed=!0),t&oe&&e.which!==1&&(t=se),this.pressed&&(t&se&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:re,srcEvent:e}))}});var Me={pointerdown:L,pointermove:oe,pointerup:se,pointercancel:ce,pointerout:ce},Ne={2:te,3:ne,4:re,5:ie},Pe=`pointerdown`,Fe=`pointermove pointerup pointercancel`;e.MSPointerEvent&&!e.PointerEvent&&(Pe=`MSPointerDown`,Fe=`MSPointerMove MSPointerUp MSPointerCancel`);function U(){this.evEl=Pe,this.evWin=Fe,_e.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}v(U,_e,{handler:function(e){var t=this.store,n=!1,r=Me[e.type.toLowerCase().replace(`ms`,``)],i=Ne[e.pointerType]||e.pointerType,a=i==te,o=D(t,e.pointerId,`pointerId`);r&L&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&(se|ce)&&(n=!0),!(o<0)&&(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))}});var Ie={touchstart:L,touchmove:oe,touchend:se,touchcancel:ce},Le=`touchstart`,Re=`touchstart touchmove touchend touchcancel`;function W(){this.evTarget=Le,this.evWin=Re,this.started=!1,_e.apply(this,arguments)}v(W,_e,{handler:function(e){var t=Ie[e.type];if(t===L&&(this.started=!0),this.started){var n=ze.call(this,e,t);t&(se|ce)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:te,srcEvent:e})}}});function ze(e,t){var n=O(e.touches),r=O(e.changedTouches);return t&(se|ce)&&(n=k(n.concat(r),`identifier`,!0)),[n,r]}var Be={touchstart:L,touchmove:oe,touchend:se,touchcancel:ce},Ve=`touchstart touchmove touchend touchcancel`;function He(){this.evTarget=Ve,this.targetIds={},_e.apply(this,arguments)}v(He,_e,{handler:function(e){var t=Be[e.type],n=Ue.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:te,srcEvent:e})}});function Ue(e,t){var n=O(e.touches),r=this.targetIds;if(t&(L|oe)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=O(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return w(e.target,c)}),t===L)for(i=0;i-1&&r.splice(e,1)},We)}}function Je(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n=ut&&r(t.options.event+ht(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=pt},canEmit:function(){for(var e=0;et.threshold&&i&t.direction},attrTest:function(e){return vt.prototype.attrTest.call(this,e)&&(this.state&ct||!(this.state&ct)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=gt(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}});function bt(){vt.apply(this,arguments)}v(bt,vt,{defaults:{event:`pinch`,threshold:0,pointers:2},getTouchAction:function(){return[et]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&ct)},emit:function(e){if(e.scale!==1){var t=e.scale<1?`in`:`out`;e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}});function xt(){mt.apply(this,arguments),this._timer=null,this._input=null}v(xt,mt,{defaults:{event:`press`,pointers:1,time:251,threshold:9},getTouchAction:function(){return[Qe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distancet.time;if(this._input=e,!r||!n||e.eventType&(se|ce)&&!i)this.reset();else if(e.eventType&L)this.reset(),this._timer=d(function(){this.state=dt,this.tryEmit()},t.time,this);else if(e.eventType&se)return dt;return pt},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===dt&&(e&&e.eventType&se?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function St(){vt.apply(this,arguments)}v(St,vt,{defaults:{event:`rotate`,threshold:0,pointers:2},getTouchAction:function(){return[et]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&ct)}});function Ct(){vt.apply(this,arguments)}v(Ct,vt,{defaults:{event:`swipe`,threshold:10,velocity:.3,direction:me|R,pointers:1},getTouchAction:function(){return yt.prototype.getTouchAction.call(this)},attrTest:function(e){var t=this.options.direction,n;return t&(me|R)?n=e.overallVelocity:t&me?n=e.overallVelocityX:t&R&&(n=e.overallVelocityY),this._super.attrTest.call(this,e)&&t&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&l(n)>this.options.velocity&&e.eventType&se},emit:function(e){var t=gt(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}});function wt(){mt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}v(wt,mt,{defaults:{event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[$e]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance0&&e.type===`pointerdown`&&(Ik(n,t=>t.pointerId===e.pointerId)||n.push(e)),t.call(this,e)}}function Rk(e){e.prototype.handler=function(e){let t=Fk[e.type];t&Mk&&e.button>=0&&(this.pressed=!0),t&Nk&&e.buttons===0&&(t=Pk),this.pressed&&(t&Pk&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:`mouse`,srcEvent:e}))}}Lk(jk.PointerEventInput),Rk(jk.MouseInput);var zk=jk.Manager,Bk=jk,Vk=class{constructor(e,t,n){this.element=e,this.callback=t,this.options={enable:!0,...n}}},Hk=Bk?[[Bk.Pan,{event:`tripan`,pointers:3,threshold:0,enable:!1}],[Bk.Rotate,{enable:!1}],[Bk.Pinch,{enable:!1}],[Bk.Swipe,{enable:!1}],[Bk.Pan,{threshold:0,enable:!1}],[Bk.Press,{enable:!1}],[Bk.Tap,{event:`doubletap`,taps:2,enable:!1}],[Bk.Tap,{event:`anytap`,enable:!1}],[Bk.Tap,{enable:!1}]]:null,Uk={tripan:[`rotate`,`pinch`,`pan`],rotate:[`pinch`],pinch:[`pan`],pan:[`press`,`doubletap`,`anytap`,`tap`],doubletap:[`anytap`],anytap:[`tap`]},Wk={doubletap:[`tap`]},Gk={pointerdown:`pointerdown`,pointermove:`pointermove`,pointerup:`pointerup`,touchstart:`pointerdown`,touchmove:`pointermove`,touchend:`pointerup`,mousedown:`pointerdown`,mousemove:`pointermove`,mouseup:`pointerup`},Kk={KEY_EVENTS:[`keydown`,`keyup`],MOUSE_EVENTS:[`mousedown`,`mousemove`,`mouseup`,`mouseover`,`mouseout`,`mouseleave`],WHEEL_EVENTS:[`wheel`,`mousewheel`]},qk={tap:`tap`,anytap:`anytap`,doubletap:`doubletap`,press:`press`,pinch:`pinch`,pinchin:`pinch`,pinchout:`pinch`,pinchstart:`pinch`,pinchmove:`pinch`,pinchend:`pinch`,pinchcancel:`pinch`,rotate:`rotate`,rotatestart:`rotate`,rotatemove:`rotate`,rotateend:`rotate`,rotatecancel:`rotate`,tripan:`tripan`,tripanstart:`tripan`,tripanmove:`tripan`,tripanup:`tripan`,tripandown:`tripan`,tripanleft:`tripan`,tripanright:`tripan`,tripanend:`tripan`,tripancancel:`tripan`,pan:`pan`,panstart:`pan`,panmove:`pan`,panup:`pan`,pandown:`pan`,panleft:`pan`,panright:`pan`,panend:`pan`,pancancel:`pan`,swipe:`swipe`,swipeleft:`swipe`,swiperight:`swipe`,swipeup:`swipe`,swipedown:`swipe`},Jk={click:`tap`,anyclick:`anytap`,dblclick:`doubletap`,mousedown:`pointerdown`,mousemove:`pointermove`,mouseup:`pointerup`,mouseover:`pointerover`,mouseout:`pointerout`,mouseleave:`pointerleave`},Yk=typeof navigator<`u`&&navigator.userAgent?navigator.userAgent.toLowerCase():``,Xk=typeof window<`u`?window:global,Zk=!1;try{Xk.addEventListener(`test`,null,{get passive(){return Zk=!0,!0}}),Xk.removeEventListener(`test`,null)}catch{Zk=!1}var Qk=Yk.indexOf(`firefox`)!==-1,{WHEEL_EVENTS:$k}=Kk,eA=`wheel`,tA=4.000244140625,nA=40,rA=.25,iA=class extends Vk{constructor(e,t,n){super(e,t,n),this.handleEvent=e=>{if(!this.options.enable)return;let t=e.deltaY;Xk.WheelEvent&&(Qk&&e.deltaMode===Xk.WheelEvent.DOM_DELTA_PIXEL&&(t/=Xk.devicePixelRatio),e.deltaMode===Xk.WheelEvent.DOM_DELTA_LINE&&(t*=nA)),t!==0&&t%tA===0&&(t=Math.floor(t/tA)),e.shiftKey&&t&&(t*=rA),this.callback({type:eA,center:{x:e.clientX,y:e.clientY},delta:-t,srcEvent:e,pointerType:`mouse`,target:e.target})},this.events=(this.options.events||[]).concat($k),this.events.forEach(t=>e.addEventListener(t,this.handleEvent,Zk?{passive:!1}:!1))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===eA&&(this.options.enable=t)}},{MOUSE_EVENTS:aA}=Kk,oA=`pointermove`,sA=`pointerover`,cA=`pointerout`,lA=`pointerenter`,uA=`pointerleave`,dA=class extends Vk{constructor(e,t,n){super(e,t,n),this.handleEvent=e=>{this.handleOverEvent(e),this.handleOutEvent(e),this.handleEnterEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)},this.pressed=!1;let{enable:r}=this.options;this.enableMoveEvent=r,this.enableLeaveEvent=r,this.enableEnterEvent=r,this.enableOutEvent=r,this.enableOverEvent=r,this.events=(this.options.events||[]).concat(aA),this.events.forEach(t=>e.addEventListener(t,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===oA&&(this.enableMoveEvent=t),e===sA&&(this.enableOverEvent=t),e===cA&&(this.enableOutEvent=t),e===lA&&(this.enableEnterEvent=t),e===uA&&(this.enableLeaveEvent=t)}handleOverEvent(e){this.enableOverEvent&&e.type===`mouseover`&&this._emit(sA,e)}handleOutEvent(e){this.enableOutEvent&&e.type===`mouseout`&&this._emit(cA,e)}handleEnterEvent(e){this.enableEnterEvent&&e.type===`mouseenter`&&this._emit(lA,e)}handleLeaveEvent(e){this.enableLeaveEvent&&e.type===`mouseleave`&&this._emit(uA,e)}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case`mousedown`:e.button>=0&&(this.pressed=!0);break;case`mousemove`:e.buttons===0&&(this.pressed=!1),this.pressed||this._emit(oA,e);break;case`mouseup`:this.pressed=!1;break;default:}}_emit(e,t){this.callback({type:e,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:`mouse`,target:t.target})}},{KEY_EVENTS:fA}=Kk,pA=`keydown`,mA=`keyup`,hA=class extends Vk{constructor(e,t,n){super(e,t,n),this.handleEvent=e=>{let t=e.target||e.srcElement;t.tagName===`INPUT`&&t.type===`text`||t.tagName===`TEXTAREA`||(this.enableDownEvent&&e.type===`keydown`&&this.callback({type:pA,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&e.type===`keyup`&&this.callback({type:mA,srcEvent:e,key:e.key,target:e.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=(this.options.events||[]).concat(fA),e.tabIndex=this.options.tabIndex||0,e.style.outline=`none`,this.events.forEach(t=>e.addEventListener(t,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===pA&&(this.enableDownEvent=t),e===mA&&(this.enableUpEvent=t)}},gA=`contextmenu`,_A=class extends Vk{constructor(e,t,n){super(e,t,n),this.handleEvent=e=>{this.options.enable&&this.callback({type:gA,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:`mouse`,target:e.target})},e.addEventListener(`contextmenu`,this.handleEvent)}destroy(){this.element.removeEventListener(`contextmenu`,this.handleEvent)}enableEventType(e,t){e===gA&&(this.options.enable=t)}},vA=1,yA=2,bA=4,xA={pointerdown:vA,pointermove:yA,pointerup:bA,mousedown:vA,mousemove:yA,mouseup:bA},SA=0,CA=1,wA=2,TA=1,EA=2,DA=4;function OA(e){let t=xA[e.srcEvent.type];if(!t)return null;let{buttons:n,button:r}=e.srcEvent,i=!1,a=!1,o=!1;return t===yA?(i=!!(n&TA),a=!!(n&DA),o=!!(n&EA)):(i=r===SA,a=r===CA,o=r===wA),{leftButton:i,middleButton:a,rightButton:o}}function kA(e,t){let n=e.center;if(!n)return null;let r=t.getBoundingClientRect(),i=r.width/t.offsetWidth||1,a=r.height/t.offsetHeight||1;return{center:n,offsetCenter:{x:(n.x-r.left-t.clientLeft)/i,y:(n.y-r.top-t.clientTop)/a}}}var AA={srcElement:`root`,priority:0},jA=class{constructor(e){this.handleEvent=e=>{if(this.isEmpty())return;let t=this._normalizeEvent(e),n=e.srcEvent.target;for(;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,`root`)},this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(e,t,n,r=!1,i=!1){let{handlers:a,handlersByElement:o}=this,s=AA;typeof n==`string`||n&&n.addEventListener?s={...AA,srcElement:n}:n&&(s={...AA,...n});let c=o.get(s.srcElement);c||(c=[],o.set(s.srcElement,c));let l={type:e,handler:t,srcElement:s.srcElement,priority:s.priority};r&&(l.once=!0),i&&(l.passive=!0),a.push(l),this._active=this._active||!l.passive;let u=c.length-1;for(;u>=0&&!(c[u].priority>=l.priority);)u--;c.splice(u+1,0,l)}remove(e,t){let{handlers:n,handlersByElement:r}=this;for(let i=n.length-1;i>=0;i--){let a=n[i];if(a.type===e&&a.handler===t){n.splice(i,1);let e=r.get(a.srcElement);e.splice(e.indexOf(a),1),e.length===0&&r.delete(a.srcElement)}}this._active=n.some(e=>!e.passive)}_emit(e,t){let n=this.handlersByElement.get(t);if(n){let t=!1,r=()=>{e.handled=!0},i=()=>{e.handled=!0,t=!0},a=[];for(let o=0;o{e.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:t}}},MA={events:null,recognizers:null,recognizerOptions:{},Manager:zk,touchAction:`none`,tabIndex:0},NA=class{constructor(e=null,t){this._onBasicInput=e=>{let{srcEvent:t}=e,n=Gk[t.type];n&&this.manager.emit(n,e)},this._onOtherEvent=e=>{this.manager.emit(e.type,e)},this.options={...MA,...t},this.events=new Map,this.setElement(e);let{events:n}=this.options;n&&this.on(n)}getElement(){return this.element}setElement(e){if(this.element&&this.destroy(),this.element=e,!e)return;let{options:t}=this,n=t.Manager;this.manager=new n(e,{touchAction:t.touchAction,recognizers:t.recognizers||Hk}).on(`hammer.input`,this._onBasicInput),t.recognizers||Object.keys(Uk).forEach(e=>{let t=this.manager.get(e);t&&Uk[e].forEach(e=>{t.recognizeWith(e)})});for(let e in t.recognizerOptions){let n=this.manager.get(e);if(n){let r=t.recognizerOptions[e];delete r.enable,n.set(r)}}this.wheelInput=new iA(e,this._onOtherEvent,{enable:!1}),this.moveInput=new dA(e,this._onOtherEvent,{enable:!1}),this.keyInput=new hA(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new _A(e,this._onOtherEvent,{enable:!1});for(let[e,t]of this.events)t.isEmpty()||(this._toggleRecognizer(t.recognizerName,!0),this.manager.on(e,t.handleEvent))}destroy(){this.element&&=(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,null)}on(e,t,n){this._addEventHandler(e,t,n,!1)}once(e,t,n){this._addEventHandler(e,t,n,!0)}watch(e,t,n){this._addEventHandler(e,t,n,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){let{manager:n}=this;if(!n)return;let r=n.get(e);if(r&&r.options.enable!==t){r.set({enable:t});let i=Wk[e];i&&!this.options.recognizers&&i.forEach(i=>{let a=n.get(i);t?(a.requireFailure(e),r.dropRequireFailure(i)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,n,r,i){if(typeof e!=`string`){n=t;for(let t in e)this._addEventHandler(t,e[t],n,r,i);return}let{manager:a,events:o}=this,s=Jk[e]||e,c=o.get(s);c||(c=new jA(this),o.set(s,c),c.recognizerName=qk[s]||s,a&&a.on(s,c.handleEvent)),c.add(e,t,n,r,i),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(e,t){if(typeof e!=`string`){for(let t in e)this._removeEventHandler(t,e[t]);return}let{events:n}=this,r=Jk[e]||e,i=n.get(r);if(i&&(i.remove(e,t),i.isEmpty())){let{recognizerName:e}=i,t=!1;for(let r of n.values())if(r.recognizerName===e&&!r.isEmpty()){t=!0;break}t||this._toggleRecognizer(e,!1)}}};function PA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function FA(e){for(var t=1;t0),o=a&&!this.state.isHovering,s=!a&&this.state.isHovering;(n||o)&&(e.features=i,n&&n(e)),o&&JA.call(this,`onMouseEnter`,e),s&&JA.call(this,`onMouseLeave`,e),(o||s)&&this.setState({isHovering:a})}}function QA(e){var t=this.props,n=t.onClick,r=t.onNativeClick,i=t.onDblClick,a=t.doubleClickZoom,o=[],s=i||a;switch(e.type){case`anyclick`:o.push(r),s||o.push(n);break;case`click`:s&&o.push(n);break;default:}o=o.filter(Boolean),o.length&&(e=KA.call(this,e),e.features=qA.call(this,e.point),o.forEach(function(t){return t(e)}))}function $A(e){return{getMap:e.current&&e.current.getMap,queryRenderedFeatures:e.current&&e.current.queryRenderedFeatures}}var ej=(0,X.forwardRef)(function(e,t){var n=(0,X.useContext)(zO),r=(0,X.useMemo)(function(){return e.controller||new VA},[]),i=(0,X.useMemo)(function(){return new NA(null,{touchAction:e.touchAction,recognizerOptions:e.eventRecognizerOptions})},[]),a=(0,X.useRef)(null),o=(0,X.useRef)(null),s=(0,X.useRef)({width:0,height:0,state:{isHovering:!1,isDragging:!1}}).current;s.props=e,s.map=o.current&&o.current.getMap(),s.setState=function(t){s.state=UA(UA({},s.state),t),a.current.style.cursor=e.getCursor(s.state)};var c=!0,u,d,f=function(e,t,n){if(c){u=[e,t,n];return}var r=s.props,i=r.onViewStateChange,a=r.onViewportChange;i&&i({viewState:e,interactionState:t,oldViewState:n}),a&&a(e,t,n)};(0,X.useImperativeHandle)(t,function(){return $A(o)},[]);var p=(0,X.useMemo)(function(){return UA(UA({},n),{},{eventManager:i,container:n.container||a.current})},[n,a.current]);p.onViewportChange=f,p.viewport=n.viewport||JO(s),s.viewport=p.viewport;var m=function(e){var t=e.isDragging,n=t!==void 0&&t;if(n!==s.state.isDragging&&s.setState({isDragging:n}),c){d=e;return}var r=s.props.onInteractionStateChange;r&&r(e)},h=function(){s.width&&s.height&&r.setOptions(UA(UA(UA({},s.props),s.props.viewState),{},{isInteractive:!!(s.props.onViewStateChange||s.props.onViewportChange),onViewportChange:f,onStateChange:m,eventManager:i,width:s.width,height:s.height}))},g=function(e){var t=e.width,n=e.height;s.width=t,s.height=n,h(),s.props.onResize({width:t,height:n})};(0,X.useEffect)(function(){return i.setElement(a.current),i.on({pointerdown:YA.bind(s),pointermove:ZA.bind(s),pointerup:XA.bind(s),pointerleave:JA.bind(s,`onMouseOut`),click:QA.bind(s),anyclick:QA.bind(s),dblclick:JA.bind(s,`onDblClick`),wheel:JA.bind(s,`onWheel`),contextmenu:JA.bind(s,`onContextMenu`)}),function(){i.destroy()}},[]),HO(function(){u&&f.apply(void 0,E(u)),d&&m(d)}),h();var _=e.width,v=e.height,y=e.style,b=e.getCursor,x=(0,X.useMemo)(function(){return UA(UA({position:`relative`},y),{},{width:_,height:v,cursor:b(s.state)})},[y,_,v,b,s.state]);return(!u||!s._child)&&(s._child=X.createElement(BO,{value:p},X.createElement(`div`,{key:`event-canvas`,ref:a,style:x},X.createElement(tk,l({},e,{width:`100%`,height:`100%`,style:null,onResize:g,ref:o}))))),c=!1,s._child});ej.supported=tk.supported,ej.propTypes=WA,ej.defaultProps=GA;function tj(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n prop: ${r}`)}}function cj(e){var t=(0,X.useContext)(zO),n=(0,X.useRef)({id:e.id,type:e.type}),r=re((0,X.useState)(0),2)[1],i=(0,X.useMemo)(function(){return e.id||`jsx-source-${aj++}`},[]),a=t.map;(0,X.useEffect)(function(){if(a){var e=function(){return r(function(e){return e+1})};return a.on(`styledata`,e),function(){a.off(`styledata`,e),requestAnimationFrame(function(){a.style&&a.style._loaded&&a.getSource(i)&&a.removeSource(i)})}}},[a,i]);var o=a&&a.style&&a.getSource(i);return o?sj(o,e,n.current):o=oj(a,i,e),n.current=e,o&&X.Children.map(e.children,function(e){return e&&(0,X.cloneElement)(e,{source:i})})||null}cj.propTypes=ij;function lj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uj(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},t=(0,X.useContext)(zO),n=(0,X.useRef)({props:e,state:{},context:t,containerRef:(0,X.useRef)(null)}).current;return n.props=e,n.context=t,(0,X.useEffect)(function(){return yj(n)},[t.eventManager]),n}function xj(e){var t=Sj();return function(){var n=L(e),r;if(t){var i=L(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return se(this,r)}}function Sj(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Cj(e){var t=e.instance,n=bj(e),r=n.context,i=n.containerRef;return t._context=r,t._containerRef=i,t._render()}var wj=function(e){oe(n,e);var t=xj(n);function n(){var e;ie(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),C(ce(e),`_context`,{}),C(ce(e),`_containerRef`,(0,X.createRef)()),C(ce(e),`_onScroll`,function(e){}),C(ce(e),`_onDragStart`,function(e){}),C(ce(e),`_onDblClick`,function(e){}),C(ce(e),`_onClick`,function(e){}),C(ce(e),`_onPointerMove`,function(e){}),e}return ae(n,[{key:`_render`,value:function(){throw Error(`_render() not implemented`)}},{key:`render`,value:function(){return X.createElement(Cj,l({instance:this},this.props,{onScroll:this._onScroll,onDragStart:this._onDragStart,onDblClick:this._onDblClick,onClick:this._onClick,onPointerMove:this._onPointerMove}))}}]),n}(X.PureComponent);C(wj,`propTypes`,vj),C(wj,`defaultProps`,_j);function Tj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ej(e){for(var t=1;t2&&arguments[2]!==void 0?arguments[2]:`x`;if(e===null)return t;var r=n===`x`?e.offsetWidth:e.offsetHeight;return zj(t/100*r)/r*100};function Vj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hj(e){for(var t=1;t0){var g=f,_=h;for(f=0;f<=1;f+=.5)p=n-f*o,m=p+o,h=Math.max(0,l-p)+Math.max(0,m-i+l),h<_&&(_=h,g=f);f=g}var v=.5;f===.5&&(d=Math.floor(d),v=1);var y=t-d*a,b=y+a,x=Math.max(0,l-y)+Math.max(0,b-r+l);if(x>0){var S=d,C=x;for(d=0;d<=1;d+=v)y=t-d*a,b=y+a,x=Math.max(0,l-y)+Math.max(0,b-r+l),x1||c<-1||o<0||o>t.width||s<0||s>t.height?h.display=`none`:h.zIndex=Math.floor((1-c)/2*1e5)),h}function eM(e){var t=(0,X.useRef)(null),n=bj(e),r=n.context,i=n.containerRef,a=re((0,X.useState)(!1),2)[1];(0,X.useEffect)(function(){a(!0)},[t.current]),(0,X.useEffect)(function(){if(r.eventManager&&e.closeOnClick){var t=function(){return n.props.onClose()};return r.eventManager.on(`anyclick`,t),function(){r.eventManager.off(`anyclick`,t)}}},[r.eventManager,e.closeOnClick]);var o=r.viewport,s=e.className,c=e.longitude,l=e.latitude,u=e.altitude,d=e.tipSize,f=e.closeButton,p=e.children,m=o.project([c,l,u]),h=Qj(e,o,t.current,m),g=$j(e,o,i.current,m,h),_=(0,X.useCallback)(function(e){n.props.onClose();var t=n.context.eventManager;t&&t.once(`click`,function(e){return e.stopPropagation()},e.target)},[]);return X.createElement(`div`,{className:`mapboxgl-popup mapboxgl-popup-anchor-${h} ${s}`,style:g,ref:i},X.createElement(`div`,{key:`tip`,className:`mapboxgl-popup-tip`,style:{borderWidth:d}}),X.createElement(`div`,{key:`content`,ref:t,className:`mapboxgl-popup-content`},f&&X.createElement(`button`,{key:`close-button`,className:`mapboxgl-popup-close-button`,type:`button`,onClick:_},`×`),p))}eM.propTypes=Xj,eM.defaultProps=Zj,X.memo(eM);function tM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nM(e){for(var t=1;to)return 1}return 0}function TM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function EM(e){for(var t=1;t=0?jM:AM}function NM(e,t,n){var r=e.viewport,i=new PO(Object.assign({},r,n)),a=Object.assign({},i.getViewportProps(),LA),o=t.onViewportChange||e.onViewportChange||DM;(t.onViewStateChange||e.onViewStateChange||DM)({viewState:a}),o(a)}function PM(e,t,n,r){return X.createElement(`button`,{key:e,className:`mapboxgl-ctrl-icon mapboxgl-ctrl-${e}`,type:`button`,title:t,onClick:n},r||X.createElement(`span`,{className:`mapboxgl-ctrl-icon`,"aria-hidden":`true`}))}function FM(e){var t=(0,X.useMemo)(function(){return e.map?MM(e.map.version):jM},[e.map]),n={transform:`rotate(${-e.viewport.bearing}deg)`};return t===jM?X.createElement(`span`,{className:`mapboxgl-ctrl-icon`,"aria-hidden":`true`,style:n}):X.createElement(`span`,{className:`mapboxgl-ctrl-compass-arrow`,style:n})}function IM(e){var t=bj(e),n=t.context,r=t.containerRef,i=function(){NM(n,e,{zoom:n.viewport.zoom+1})},a=function(){NM(n,e,{zoom:n.viewport.zoom-1})},o=function(){NM(n,e,{bearing:0,pitch:0})},s=e.className,c=e.showCompass,l=e.showZoom,u=e.zoomInLabel,d=e.zoomOutLabel,f=e.compassLabel,p=(0,X.useMemo)(function(){return EM({position:`absolute`},e.style)},[e.style]);return X.createElement(`div`,{style:p,className:s},X.createElement(`div`,{className:`mapboxgl-ctrl mapboxgl-ctrl-group`,ref:r},l&&PM(`zoom-in`,u,i),l&&PM(`zoom-out`,d,a),c&&PM(`compass`,f,o,FM(n))))}IM.propTypes=OM,IM.defaultProps=kM;var LM=X.memo(IM);function RM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zM(e){for(var t=1;to(s,{}),iN=c(`div`,{target:`e1ck5q350`})(({isStretchHeight:e})=>({position:`relative`,height:`100%`,width:`100%`,...e&&{minHeight:`6.25rem`}})),aN=c(`div`,{target:`e1ck5q351`})(({theme:e})=>({position:`absolute`,inset:0,borderRadius:e.radii.default,overflow:`hidden`})),oN=c(`div`,{target:`e1ck5q352`})(({theme:e})=>({position:`absolute`,right:`2.625rem`,top:e.spacing.md,zIndex:e.zIndices.priority,".mapboxgl-ctrl.mapboxgl-ctrl-group":{overflow:`hidden`,background:e.colors.bgColor},"button:not(:disabled)":{background:e.colors.bgColor,width:e.iconSizes.twoXL,height:e.iconSizes.twoXL,"& + button":{borderTopColor:e.colors.borderColor},".mapboxgl-ctrl-icon":{backgroundSize:e.iconSizes.twoXL,"&:hover":{backgroundColor:e.colors.darkenedBgMix25}},"& span":{filter:g(e)?``:`invert(100%)`}}})),sN=({container:e,element:t,heightFallback:n=`auto`,isFullScreen:r,shouldUseContainerWidth:i,widthFallback:a=`auto`})=>({width:(0,X.useMemo)(()=>i||r?`100%`:t.width||e.width||a,[e.width,t.width,r,i,a]),height:(0,X.useMemo)(()=>r&&e.height?e.height:t.height||e.height||n,[r,t.height,e.height,n])}),cN=`layout(std140) uniform arcUniforms { + bool greatCircle; + bool useShortestPath; + float numSegments; + float widthScale; + float widthMinPixels; + float widthMaxPixels; + highp int widthUnits; +} arc; +`,lN={name:`arc`,vs:cN,fs:cN,uniformTypes:{greatCircle:`f32`,useShortestPath:`f32`,numSegments:`f32`,widthScale:`f32`,widthMinPixels:`f32`,widthMaxPixels:`f32`,widthUnits:`i32`}},uN=`#version 300 es +#define SHADER_NAME arc-layer-vertex-shader +in vec4 instanceSourceColors; +in vec4 instanceTargetColors; +in vec3 instanceSourcePositions; +in vec3 instanceSourcePositions64Low; +in vec3 instanceTargetPositions; +in vec3 instanceTargetPositions64Low; +in vec3 instancePickingColors; +in float instanceWidths; +in float instanceHeights; +in float instanceTilts; +out vec4 vColor; +out vec2 uv; +out float isValid; +float paraboloid(float distance, float sourceZ, float targetZ, float ratio) { +float deltaZ = targetZ - sourceZ; +float dh = distance * instanceHeights; +if (dh == 0.0) { +return sourceZ + deltaZ * ratio; +} +float unitZ = deltaZ / dh; +float p2 = unitZ * unitZ + 1.0; +float dir = step(deltaZ, 0.0); +float z0 = mix(sourceZ, targetZ, dir); +float r = mix(ratio, 1.0 - ratio, dir); +return sqrt(r * (p2 - r)) * dh + z0; +} +vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) { +vec2 dir_screenspace = normalize(line_clipspace * project.viewportSize); +dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x); +return dir_screenspace * offset_direction * width / 2.0; +} +float getSegmentRatio(float index) { +return smoothstep(0.0, 1.0, index / (arc.numSegments - 1.0)); +} +vec3 interpolateFlat(vec3 source, vec3 target, float segmentRatio) { +float distance = length(source.xy - target.xy); +float z = paraboloid(distance, source.z, target.z, segmentRatio); +float tiltAngle = radians(instanceTilts); +vec2 tiltDirection = normalize(target.xy - source.xy); +vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle); +return vec3( +mix(source.xy, target.xy, segmentRatio) + tilt, +z * cos(tiltAngle) +); +} +float getAngularDist (vec2 source, vec2 target) { +vec2 sourceRadians = radians(source); +vec2 targetRadians = radians(target); +vec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0); +vec2 shd_sq = sin_half_delta * sin_half_delta; +float a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x; +return 2.0 * asin(sqrt(a)); +} +vec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) { +vec2 lngLat; +if(abs(angularDist - PI) < 0.001) { +lngLat = (1.0 - t) * source.xy + t * target.xy; +} else { +float a = sin((1.0 - t) * angularDist); +float b = sin(t * angularDist); +vec3 p = source3D.yxz * a + target3D.yxz * b; +lngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy)))); +} +float z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t); +return vec3(lngLat, z); +} +void main(void) { +geometry.worldPosition = instanceSourcePositions; +geometry.worldPositionAlt = instanceTargetPositions; +float segmentIndex = float(gl_VertexID / 2); +float segmentSide = mod(float(gl_VertexID), 2.) == 0. ? -1. : 1.; +float segmentRatio = getSegmentRatio(segmentIndex); +float prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0)); +float nextSegmentRatio = getSegmentRatio(min(arc.numSegments - 1.0, segmentIndex + 1.0)); +float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0)); +isValid = 1.0; +uv = vec2(segmentRatio, segmentSide); +geometry.uv = uv; +geometry.pickingColor = instancePickingColors; +vec4 curr; +vec4 next; +vec3 source; +vec3 target; +if ((arc.greatCircle || project.projectionMode == PROJECTION_MODE_GLOBE) && project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { +source = project_globe_(vec3(instanceSourcePositions.xy, 0.0)); +target = project_globe_(vec3(instanceTargetPositions.xy, 0.0)); +float angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy); +vec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio); +vec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio); +vec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio); +if (abs(currPos.x - prevPos.x) > 180.0) { +indexDir = -1.0; +isValid = 0.0; +} else if (abs(currPos.x - nextPos.x) > 180.0) { +indexDir = 1.0; +isValid = 0.0; +} +nextPos = indexDir < 0.0 ? prevPos : nextPos; +nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio; +if (isValid == 0.0) { +nextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0; +float t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x); +currPos = mix(currPos, nextPos, t); +segmentRatio = mix(segmentRatio, nextSegmentRatio, t); +} +vec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio); +vec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio); +curr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position); +next = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0)); +} else { +vec3 source_world = instanceSourcePositions; +vec3 target_world = instanceTargetPositions; +if (arc.useShortestPath) { +source_world.x = mod(source_world.x + 180., 360.0) - 180.; +target_world.x = mod(target_world.x + 180., 360.0) - 180.; +float deltaLng = target_world.x - source_world.x; +if (deltaLng > 180.) target_world.x -= 360.; +if (deltaLng < -180.) source_world.x -= 360.; +} +source = project_position(source_world, instanceSourcePositions64Low); +target = project_position(target_world, instanceTargetPositions64Low); +float antiMeridianX = 0.0; +if (arc.useShortestPath) { +if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) { +antiMeridianX = -(project.coordinateOrigin.x + 180.) / 360. * TILE_SIZE; +} +float thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x); +if (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) { +isValid = 0.0; +indexDir = sign(segmentRatio - thresholdRatio); +segmentRatio = thresholdRatio; +} +} +nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio; +vec3 currPos = interpolateFlat(source, target, segmentRatio); +vec3 nextPos = interpolateFlat(source, target, nextSegmentRatio); +if (arc.useShortestPath) { +if (nextPos.x < antiMeridianX) { +currPos.x += TILE_SIZE; +nextPos.x += TILE_SIZE; +} +} +curr = project_common_position_to_clipspace(vec4(currPos, 1.0)); +next = project_common_position_to_clipspace(vec4(nextPos, 1.0)); +geometry.position = vec4(currPos, 1.0); +} +float widthPixels = clamp( +project_size_to_pixel(instanceWidths * arc.widthScale, arc.widthUnits), +arc.widthMinPixels, arc.widthMaxPixels +); +vec3 offset = vec3( +getExtrusionOffset((next.xy - curr.xy) * indexDir, segmentSide, widthPixels), +0.0); +DECKGL_FILTER_SIZE(offset, geometry); +DECKGL_FILTER_GL_POSITION(curr, geometry); +gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0); +vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio); +vColor = vec4(color.rgb, color.a * layer.opacity); +DECKGL_FILTER_COLOR(vColor, geometry); +} +`,dN=`#version 300 es +#define SHADER_NAME arc-layer-fragment-shader +precision highp float; +in vec4 vColor; +in vec2 uv; +in float isValid; +out vec4 fragColor; +void main(void) { +if (isValid == 0.0) { +discard; +} +fragColor = vColor; +geometry.uv = uv; +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,fN=[0,0,0,255],pN={getSourcePosition:{type:`accessor`,value:e=>e.sourcePosition},getTargetPosition:{type:`accessor`,value:e=>e.targetPosition},getSourceColor:{type:`accessor`,value:fN},getTargetColor:{type:`accessor`,value:fN},getWidth:{type:`accessor`,value:1},getHeight:{type:`accessor`,value:1},getTilt:{type:`accessor`,value:0},greatCircle:!1,numSegments:{type:`number`,value:50,min:1},widthUnits:`pixels`,widthScale:{type:`number`,value:1,min:0},widthMinPixels:{type:`number`,value:0,min:0},widthMaxPixels:{type:`number`,value:2**53-1,min:0}},mN=class extends dx{getBounds(){return this.getAttributeManager()?.getBounds([`instanceSourcePositions`,`instanceTargetPositions`])}getShaders(){return super.getShaders({vs:uN,fs:dN,modules:[Bp,jm,lN]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:`float64`,fp64:this.use64bitPositions(),transition:!0,accessor:`getSourcePosition`},instanceTargetPositions:{size:3,type:`float64`,fp64:this.use64bitPositions(),transition:!0,accessor:`getTargetPosition`},instanceSourceColors:{size:this.props.colorFormat.length,type:`unorm8`,transition:!0,accessor:`getSourceColor`,defaultValue:fN},instanceTargetColors:{size:this.props.colorFormat.length,type:`unorm8`,transition:!0,accessor:`getTargetColor`,defaultValue:fN},instanceWidths:{size:1,transition:!0,accessor:`getWidth`,defaultValue:1},instanceHeights:{size:1,transition:!0,accessor:`getHeight`,defaultValue:1},instanceTilts:{size:1,transition:!0,accessor:`getTilt`,defaultValue:0}})}updateState(e){super.updateState(e),e.changeFlags.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){let{widthUnits:t,widthScale:n,widthMinPixels:r,widthMaxPixels:i,greatCircle:a,wrapLongitude:o,numSegments:s}=this.props,c={numSegments:s,widthUnits:vp[t],widthScale:n,widthMinPixels:r,widthMaxPixels:i,greatCircle:a,useShortestPath:o},l=this.state.model;l.shaderInputs.setProps({arc:c}),l.setVertexCount(s*2),l.draw(this.context.renderPass)}_getModel(){return new Rg(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),topology:`triangle-strip`,isInstanced:!0})}};mN.layerName=`ArcLayer`,mN.defaultProps=pN;var hN=new Uint32Array([0,2,1,0,3,2]),gN=new Float32Array([0,1,0,0,1,0,1,1]);function _N(e,t){if(!t)return vN(e);let n=Math.max(Math.abs(e[0][0]-e[3][0]),Math.abs(e[1][0]-e[2][0])),r=Math.max(Math.abs(e[1][1]-e[0][1]),Math.abs(e[2][1]-e[3][1])),i=Math.ceil(n/t)+1,a=Math.ceil(r/t)+1,o=(i-1)*(a-1)*6,s=new Uint32Array(o),c=new Float32Array(i*a*2),l=new Float64Array(i*a*3),u=0,d=0;for(let t=0;t0&&r>0&&(s[d++]=u-a,s[d++]=u-a-1,s[d++]=u-1,s[d++]=u-a,s[d++]=u-1,s[d++]=u),u++}}return{vertexCount:o,positions:l,indices:s,texCoords:c}}function vN(e){let t=new Float64Array(12);for(let n=0;n`,coordinateConversion:`f32`,desaturate:`f32`,tintColor:`vec3`,transparentColor:`vec4`}},SN=`#version 300 es +#define SHADER_NAME bitmap-layer-vertex-shader + +in vec2 texCoords; +in vec3 positions; +in vec3 positions64Low; + +out vec2 vTexCoord; +out vec2 vTexPos; + +const vec3 pickingColor = vec3(1.0, 0.0, 0.0); + +void main(void) { + geometry.worldPosition = positions; + geometry.uv = texCoords; + geometry.pickingColor = pickingColor; + + gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position); + DECKGL_FILTER_GL_POSITION(gl_Position, geometry); + + vTexCoord = texCoords; + + if (bitmap.coordinateConversion < -0.5) { + vTexPos = geometry.position.xy + project.commonOrigin.xy; + } else if (bitmap.coordinateConversion > 0.5) { + vTexPos = geometry.worldPosition.xy; + } + + vec4 color = vec4(0.0); + DECKGL_FILTER_COLOR(color, geometry); +} +`,CN=`#version 300 es +#define SHADER_NAME bitmap-layer-fragment-shader + +#ifdef GL_ES +precision highp float; +#endif + +uniform sampler2D bitmapTexture; + +in vec2 vTexCoord; +in vec2 vTexPos; + +out vec4 fragColor; + +/* projection utils */ +const float TILE_SIZE = 512.0; +const float PI = 3.1415926536; +const float WORLD_SCALE = TILE_SIZE / PI / 2.0; + +// from degrees to Web Mercator +vec2 lnglat_to_mercator(vec2 lnglat) { + float x = lnglat.x; + float y = clamp(lnglat.y, -89.9, 89.9); + return vec2( + radians(x) + PI, + PI + log(tan(PI * 0.25 + radians(y) * 0.5)) + ) * WORLD_SCALE; +} + +// from Web Mercator to degrees +vec2 mercator_to_lnglat(vec2 xy) { + xy /= WORLD_SCALE; + return degrees(vec2( + xy.x - PI, + atan(exp(xy.y - PI)) * 2.0 - PI * 0.5 + )); +} +/* End projection utils */ + +// apply desaturation +vec3 color_desaturate(vec3 color) { + float luminance = (color.r + color.g + color.b) * 0.333333333; + return mix(color, vec3(luminance), bitmap.desaturate); +} + +// apply tint +vec3 color_tint(vec3 color) { + return color * bitmap.tintColor; +} + +// blend with background color +vec4 apply_opacity(vec3 color, float alpha) { + if (bitmap.transparentColor.a == 0.0) { + return vec4(color, alpha); + } + float blendedAlpha = alpha + bitmap.transparentColor.a * (1.0 - alpha); + float highLightRatio = alpha / blendedAlpha; + vec3 blendedRGB = mix(bitmap.transparentColor.rgb, color, highLightRatio); + return vec4(blendedRGB, blendedAlpha); +} + +vec2 getUV(vec2 pos) { + return vec2( + (pos.x - bitmap.bounds[0]) / (bitmap.bounds[2] - bitmap.bounds[0]), + (pos.y - bitmap.bounds[3]) / (bitmap.bounds[1] - bitmap.bounds[3]) + ); +} + + +vec3 packUVsIntoRGB(vec2 uv) { + // Extract the top 8 bits. We want values to be truncated down so we can add a fraction + vec2 uv8bit = floor(uv * 256.); + + // Calculate the normalized remainders of u and v parts that do not fit into 8 bits + // Scale and clamp to 0-1 range + vec2 uvFraction = fract(uv * 256.); + vec2 uvFraction4bit = floor(uvFraction * 16.); + + // Remainder can be encoded in blue channel, encode as 4 bits for pixel coordinates + float fractions = uvFraction4bit.x + uvFraction4bit.y * 16.; + + return vec3(uv8bit, fractions) / 255.; +} + + +void main(void) { + vec2 uv = vTexCoord; + if (bitmap.coordinateConversion < -0.5) { + vec2 lnglat = mercator_to_lnglat(vTexPos); + uv = getUV(lnglat); + } else if (bitmap.coordinateConversion > 0.5) { + vec2 commonPos = lnglat_to_mercator(vTexPos); + uv = getUV(commonPos); + } + vec4 bitmapColor = texture(bitmapTexture, uv); + + fragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * layer.opacity); + + geometry.uv = uv; + DECKGL_FILTER_COLOR(fragColor, geometry); + + if (bool(picking.isActive) && !bool(picking.isAttribute)) { + // Since instance information is not used, we can use picking color for pixel index + fragColor.rgb = packUVsIntoRGB(uv); + } +} +`,wN={image:{type:`image`,value:null,async:!0},bounds:{type:`array`,value:[1,0,0,1],compare:!0},_imageCoordinateSystem:`default`,desaturate:{type:`number`,min:0,max:1,value:0},transparentColor:{type:`color`,value:[0,0,0,0]},tintColor:{type:`color`,value:[255,255,255]},textureParameters:{type:`object`,ignore:!0,value:null}},TN=class extends dx{getShaders(){return super.getShaders({vs:SN,fs:CN,modules:[Bp,jm,xN]})}initializeState(){let e=this.getAttributeManager();e.remove([`instancePickingColors`]),e.add({indices:{size:1,isIndexed:!0,update:e=>e.value=this.state.mesh.indices,noAlloc:!0},positions:{size:3,type:`float64`,fp64:this.use64bitPositions(),update:e=>e.value=this.state.mesh.positions,noAlloc:!0},texCoords:{size:2,update:e=>e.value=this.state.mesh.texCoords,noAlloc:!0}})}updateState({props:e,oldProps:t,changeFlags:n}){let r=this.getAttributeManager();if(n.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),r.invalidateAll()),e.bounds!==t.bounds){let e=this.state.mesh,t=this._createMesh();this.state.model.setVertexCount(t.vertexCount);for(let n in t)e&&e[n]!==t[n]&&r.invalidate(n);this.setState({mesh:t,...this._getCoordinateUniforms()})}else e._imageCoordinateSystem!==t._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}getPickingInfo(e){let{image:t}=this.props,n=e.info;if(!n.color||!t)return n.bitmap=null,n;let{width:r,height:i}=t;n.index=0;let a=EN(n.color);return n.bitmap={size:{width:r,height:i},uv:a,pixel:[Math.floor(a[0]*r),Math.floor(a[1]*i)]},n}disablePickingIndex(){this.setState({disablePicking:!0})}restorePickingColors(){this.setState({disablePicking:!1})}_updateAutoHighlight(e){super._updateAutoHighlight({...e,color:this.encodePickingColor(0)})}_createMesh(){let{bounds:e}=this.props,t=e;return DN(e)&&(t=[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]]]),_N(t,this.context.viewport.resolution)}_getModel(){return new Rg(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),topology:`triangle-list`,isInstanced:!1})}draw(e){let{shaderModuleProps:t}=e,{model:n,coordinateConversion:r,bounds:i,disablePicking:a}=this.state,{image:o,desaturate:s,transparentColor:c,tintColor:l}=this.props;if(!(t.picking.isActive&&a)&&o&&n){let e={bitmapTexture:o,bounds:i,coordinateConversion:r,desaturate:s,tintColor:l.slice(0,3).map(e=>e/255),transparentColor:c.map(e=>e/255)};n.shaderInputs.setProps({bitmap:e}),n.draw(this.context.renderPass)}}_getCoordinateUniforms(){let{_imageCoordinateSystem:e}=this.props;if(e!=="default"){let{bounds:t}=this.props;if(!DN(t))throw Error(`_imageCoordinateSystem only supports rectangular bounds`);let n=this.context.viewport.resolution?`lnglat`:`cartesian`;if(e=e===`lnglat`?`lnglat`:`cartesian`,e===`lnglat`&&n===`cartesian`)return{coordinateConversion:-1,bounds:t};if(e===`cartesian`&&n===`lnglat`){let e=rm([t[0],t[1]]),n=rm([t[2],t[3]]);return{coordinateConversion:1,bounds:[e[0],e[1],n[0],n[1]]}}}return{coordinateConversion:0,bounds:[0,0,0,0]}}};TN.layerName=`BitmapLayer`,TN.defaultProps=wN;function EN(e){let[t,n,r]=e,i=(r&240)/256;return[(t+(r&15)/16)/256,(n+i)/256]}function DN(e){return Number.isFinite(e[0])}var ON=`layout(std140) uniform iconUniforms { + float sizeScale; + vec2 iconsTextureDim; + float sizeBasis; + float sizeMinPixels; + float sizeMaxPixels; + bool billboard; + highp int sizeUnits; + float alphaCutoff; +} icon; +`,Wee={name:`icon`,vs:ON,fs:ON,uniformTypes:{sizeScale:`f32`,iconsTextureDim:`vec2`,sizeBasis:`f32`,sizeMinPixels:`f32`,sizeMaxPixels:`f32`,billboard:`f32`,sizeUnits:`i32`,alphaCutoff:`f32`}},Gee=`#version 300 es +#define SHADER_NAME icon-layer-vertex-shader +in vec2 positions; +in vec3 instancePositions; +in vec3 instancePositions64Low; +in float instanceSizes; +in float instanceAngles; +in vec4 instanceColors; +in vec3 instancePickingColors; +in vec4 instanceIconFrames; +in float instanceColorModes; +in vec2 instanceOffsets; +in vec2 instancePixelOffset; +out float vColorMode; +out vec4 vColor; +out vec2 vTextureCoords; +out vec2 uv; +vec2 rotate_by_angle(vec2 vertex, float angle) { +float angle_radian = angle * PI / 180.0; +float cos_angle = cos(angle_radian); +float sin_angle = sin(angle_radian); +mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle); +return rotationMatrix * vertex; +} +void main(void) { +geometry.worldPosition = instancePositions; +geometry.uv = positions; +geometry.pickingColor = instancePickingColors; +uv = positions; +vec2 iconSize = instanceIconFrames.zw; +float sizePixels = clamp( +project_size_to_pixel(instanceSizes * icon.sizeScale, icon.sizeUnits), +icon.sizeMinPixels, icon.sizeMaxPixels +); +float iconConstraint = icon.sizeBasis == 0.0 ? iconSize.x : iconSize.y; +float instanceScale = iconConstraint == 0.0 ? 0.0 : sizePixels / iconConstraint; +vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets; +pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale; +pixelOffset += instancePixelOffset; +pixelOffset.y *= -1.0; +if (icon.billboard) { +gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +vec3 offset = vec3(pixelOffset, 0.0); +DECKGL_FILTER_SIZE(offset, geometry); +gl_Position.xy += project_pixel_size_to_clipspace(offset.xy); +} else { +vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0); +DECKGL_FILTER_SIZE(offset_common, geometry); +gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +} +vTextureCoords = mix( +instanceIconFrames.xy, +instanceIconFrames.xy + iconSize, +(positions.xy + 1.0) / 2.0 +) / icon.iconsTextureDim; +vColor = instanceColors; +DECKGL_FILTER_COLOR(vColor, geometry); +vColorMode = instanceColorModes; +} +`,Kee=`#version 300 es +#define SHADER_NAME icon-layer-fragment-shader +precision highp float; +uniform sampler2D iconsTexture; +in float vColorMode; +in vec4 vColor; +in vec2 vTextureCoords; +in vec2 uv; +out vec4 fragColor; +void main(void) { +geometry.uv = uv; +vec4 texColor = texture(iconsTexture, vTextureCoords); +vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode); +float a = texColor.a * layer.opacity * vColor.a; +if (a < icon.alphaCutoff) { +discard; +} +fragColor = vec4(color, a); +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,qee=`struct IconUniforms { + sizeScale: f32, + iconsTextureDim: vec2, + sizeBasis: f32, + sizeMinPixels: f32, + sizeMaxPixels: f32, + billboard: i32, + sizeUnits: i32, + alphaCutoff: f32 +}; + +@group(0) @binding(auto) var icon: IconUniforms; +@group(0) @binding(auto) var iconsTexture : texture_2d; +@group(0) @binding(auto) var iconsTextureSampler : sampler; + +fn rotate_by_angle(vertex: vec2, angle_deg: f32) -> vec2 { + let angle_radian = angle_deg * PI / 180.0; + let c = cos(angle_radian); + let s = sin(angle_radian); + let rotation = mat2x2(vec2(c, s), vec2(-s, c)); + return rotation * vertex; +} + +struct Attributes { + @location(0) positions: vec2, + + @location(1) instancePositions: vec3, + @location(2) instancePositions64Low: vec3, + @location(3) instanceSizes: f32, + @location(4) instanceAngles: f32, + @location(5) instanceColors: vec4, + @location(6) instancePickingColors: vec3, + @location(7) instanceIconFrames: vec4, + @location(8) instanceColorModes: f32, + @location(9) instanceOffsets: vec2, + @location(10) instancePixelOffset: vec2, +}; + +struct Varyings { + @builtin(position) position: vec4, + + @location(0) vColorMode: f32, + @location(1) vColor: vec4, + @location(2) vTextureCoords: vec2, + @location(3) uv: vec2, + @location(4) pickingColor: vec3, +}; + +@vertex +fn vertexMain(inp: Attributes) -> Varyings { + // write geometry fields used by filters + FS + geometry.worldPosition = inp.instancePositions; + geometry.uv = inp.positions; + geometry.pickingColor = inp.instancePickingColors; + + var outp: Varyings; + outp.uv = inp.positions; + + let iconSize = inp.instanceIconFrames.zw; + + // convert size in meters to pixels, then clamp + let sizePixels = clamp( + project_unit_size_to_pixel(inp.instanceSizes * icon.sizeScale, icon.sizeUnits), + icon.sizeMinPixels, icon.sizeMaxPixels + ); + + // scale icon height to match instanceSize + let iconConstraint = select(iconSize.y, iconSize.x, icon.sizeBasis == 0.0); + let instanceScale = select(sizePixels / iconConstraint, 0.0, iconConstraint == 0.0); + + // scale and rotate vertex in "pixel" units; then add per-instance pixel offset + var pixelOffset = inp.positions / 2.0 * iconSize + inp.instanceOffsets; + pixelOffset = rotate_by_angle(pixelOffset, inp.instanceAngles) * instanceScale; + pixelOffset = pixelOffset + inp.instancePixelOffset; + pixelOffset.y = pixelOffset.y * -1.0; + + if (icon.billboard != 0) { + var pos = project_position_to_clipspace(inp.instancePositions, inp.instancePositions64Low, vec3(0.0)); // TODO, &geometry.position); + // DECKGL_FILTER_GL_POSITION(pos, geometry); + + var offset = vec3(pixelOffset, 0.0); + // DECKGL_FILTER_SIZE(offset, geometry); + let clipOffset = project_pixel_size_to_clipspace(offset.xy); + pos = vec4(pos.x + clipOffset.x, pos.y + clipOffset.y, pos.z, pos.w); + outp.position = pos; + } else { + var offset_common = vec3(project_pixel_size_vec2(pixelOffset), 0.0); + // DECKGL_FILTER_SIZE(offset_common, geometry); + var pos = project_position_to_clipspace(inp.instancePositions, inp.instancePositions64Low, offset_common); // TODO, &geometry.position); + // DECKGL_FILTER_GL_POSITION(pos, geometry); + outp.position = pos; + } + + let uvMix = (inp.positions.xy + vec2(1.0, 1.0)) * 0.5; + outp.vTextureCoords = mix(inp.instanceIconFrames.xy, inp.instanceIconFrames.xy + iconSize, uvMix) / icon.iconsTextureDim; + + outp.vColor = inp.instanceColors; + // DECKGL_FILTER_COLOR(outp.vColor, geometry); + + outp.vColorMode = inp.instanceColorModes; + outp.pickingColor = inp.instancePickingColors; + + return outp; +} + +@fragment +fn fragmentMain(inp: Varyings) -> @location(0) vec4 { + // expose to deck.gl filter hooks + geometry.uv = inp.uv; + + let texColor = textureSample(iconsTexture, iconsTextureSampler, inp.vTextureCoords); + + // if colorMode == 0, use pixel color from the texture + // if colorMode == 1 (or picking), use texture as transparency mask + let rgb = mix(texColor.rgb, inp.vColor.rgb, inp.vColorMode); + let a = texColor.a * layer.opacity * inp.vColor.a; + + if (a < icon.alphaCutoff) { + discard; + } + + if (picking.isActive > 0.5) { + if (!picking_isColorValid(inp.pickingColor)) { + discard; + } + return vec4(inp.pickingColor, 1.0); + } + + var fragColor = deckgl_premultiplied_alpha(vec4(rgb, a)); + + if (picking.isHighlightActive > 0.5) { + let highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor); + if (picking_isColorZero(abs(inp.pickingColor - highlightedObjectColor))) { + let highLightAlpha = picking.highlightColor.a; + let blendedAlpha = highLightAlpha + fragColor.a * (1.0 - highLightAlpha); + if (blendedAlpha > 0.0) { + let highLightRatio = highLightAlpha / blendedAlpha; + fragColor = vec4( + mix(fragColor.rgb, picking.highlightColor.rgb, highLightRatio), + blendedAlpha + ); + } else { + fragColor = vec4(fragColor.rgb, 0.0); + } + } + } + + return fragColor; +} +`,Jee=1024,Yee=4,kN=()=>{},AN={minFilter:`linear`,mipmapFilter:`linear`,magFilter:`linear`,addressModeU:`clamp-to-edge`,addressModeV:`clamp-to-edge`},Xee={x:0,y:0,width:0,height:0};function Zee(e){return 2**Math.ceil(Math.log2(e))}function Qee(e,t,n,r){let i=Math.min(n/t.width,r/t.height),a=Math.floor(t.width*i),o=Math.floor(t.height*i);return i===1?{image:t,width:a,height:o}:(e.canvas.height=o,e.canvas.width=a,e.clearRect(0,0,a,o),e.drawImage(t,0,0,t.width,t.height,0,0,a,o),{image:e.canvas,width:a,height:o})}function jN(e){return e&&(e.id||e.url)}function MN(e){let{device:t}=e;t.type===`webgl`?e.generateMipmapsWebGL():t.type===`webgpu`&&t.generateMipmapsWebGPU(e)}function $ee(e,t,n,r){let{width:i,height:a,device:o}=e,s=o.createTexture({format:`rgba8unorm`,width:t,height:n,sampler:r,mipLevels:o.getMipLevelCount(t,n)}),c=o.createCommandEncoder();c.copyTextureToTexture({sourceTexture:e,destinationTexture:s,width:i,height:a});let l=c.finish();return o.submit(l),MN(s),e.destroy(),s}function NN(e,t,n){for(let r=0;ro&&(NN(n,s,i),r=0,i=a+i+t,a=0,s=[]),s.push({icon:l,xOffset:r}),r=r+c+t,a=Math.max(a,e)}}return s.length>0&&NN(n,s,i),{mapping:n,rowHeight:a,xOffset:r,yOffset:i,canvasWidth:o,canvasHeight:Zee(a+i+t)}}function tte(e,t,n){if(!e||!t)return null;n||={};let r={},{iterable:i,objectInfo:a}=Ty(e);for(let e of i){a.index++;let i=t(e,a),o=jN(i);if(!i)throw Error(`Icon is missing.`);if(!i.url)throw Error(`Icon url is missing.`);!r[o]&&(!n[o]||i.url!==n[o].url)&&(r[o]={...i,source:e,sourceIndex:a.index})}return r}var nte=class{constructor(e,{onUpdate:t=kN,onError:n=kN}){this._loadOptions=null,this._texture=null,this._externalTexture=null,this._mapping={},this._samplerParameters=null,this._pendingCount=0,this._autoPacking=!1,this._xOffset=0,this._yOffset=0,this._rowHeight=0,this._buffer=Yee,this._canvasWidth=Jee,this._canvasHeight=0,this._canvas=null,this.device=e,this.onUpdate=t,this.onError=n}finalize(){this._texture?.delete()}getTexture(){return this._texture||this._externalTexture}getIconMapping(e){let t=this._autoPacking?jN(e):e;return this._mapping[t]||Xee}setProps({loadOptions:e,autoPacking:t,iconAtlas:n,iconMapping:r,textureParameters:i}){e&&(this._loadOptions=e),t!==void 0&&(this._autoPacking=t),r&&(this._mapping=r),n&&(this._texture?.delete(),this._texture=null,this._externalTexture=n),i&&(this._samplerParameters=i)}get isLoaded(){return this._pendingCount===0}packIcons(e,t){if(!this._autoPacking||typeof document>`u`)return;let n=Object.values(tte(e,t,this._mapping)||{});if(n.length>0){let{mapping:e,xOffset:t,yOffset:r,rowHeight:i,canvasHeight:a}=ete({icons:n,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=i,this._mapping=e,this._xOffset=t,this._yOffset=r,this._canvasHeight=a,this._texture||=this.device.createTexture({format:`rgba8unorm`,data:null,width:this._canvasWidth,height:this._canvasHeight,sampler:this._samplerParameters||AN,mipLevels:this.device.getMipLevelCount(this._canvasWidth,this._canvasHeight)}),this._texture.height!==this._canvasHeight&&(this._texture=$ee(this._texture,this._canvasWidth,this._canvasHeight,this._samplerParameters||AN)),this.onUpdate(!0),this._canvas=this._canvas||document.createElement(`canvas`),this._loadIcons(n)}}_loadIcons(e){let t=this._canvas.getContext(`2d`,{willReadFrequently:!0});for(let n of e)this._pendingCount++,ga(n.url,this._loadOptions).then(e=>{let r=jN(n),i=this._mapping[r],{x:a,y:o,width:s,height:c}=i,{image:l,width:u,height:d}=Qee(t,e,s,c),f=a+(s-u)/2,p=o+(c-d)/2;this._texture?.copyExternalImage({image:l,x:f,y:p,width:u,height:d}),i.x=f,i.y=p,i.width=u,i.height=d,this._texture&&MN(this._texture),this.onUpdate(u!==s||d!==c)}).catch(e=>{this.onError({url:n.url,source:n.source,sourceIndex:n.sourceIndex,loadOptions:this._loadOptions,error:e})}).finally(()=>{this._pendingCount--})}},PN=[0,0,0,255],rte={iconAtlas:{type:`image`,value:null,async:!0},iconMapping:{type:`object`,value:{},async:!0},sizeScale:{type:`number`,value:1,min:0},billboard:!0,sizeUnits:`pixels`,sizeBasis:`height`,sizeMinPixels:{type:`number`,min:0,value:0},sizeMaxPixels:{type:`number`,min:0,value:2**53-1},alphaCutoff:{type:`number`,value:.05,min:0,max:1},getPosition:{type:`accessor`,value:e=>e.position},getIcon:{type:`accessor`,value:e=>e.icon},getColor:{type:`accessor`,value:PN},getSize:{type:`accessor`,value:1},getAngle:{type:`accessor`,value:0},getPixelOffset:{type:`accessor`,value:[0,0]},onIconError:{type:`function`,value:null,optional:!0},textureParameters:{type:`object`,ignore:!0,value:null}},FN=class extends dx{getShaders(){return super.getShaders({vs:Gee,fs:Kee,source:qee,modules:[Bp,Wd,jm,Wee]})}initializeState(){this.state={iconManager:new nte(this.context.device,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:`float64`,fp64:this.use64bitPositions(),transition:!0,accessor:`getPosition`},instanceSizes:{size:1,transition:!0,accessor:`getSize`,defaultValue:1},instanceIconDefs:{size:7,accessor:`getIcon`,transform:this.getInstanceIconDef,shaderAttributes:{instanceOffsets:{size:2,elementOffset:0},instanceIconFrames:{size:4,elementOffset:2},instanceColorModes:{size:1,elementOffset:6}}},instanceColors:{size:this.props.colorFormat.length,type:`unorm8`,transition:!0,accessor:`getColor`,defaultValue:PN},instanceAngles:{size:1,transition:!0,accessor:`getAngle`},instancePixelOffset:{size:2,transition:!0,accessor:`getPixelOffset`}})}updateState(e){super.updateState(e);let{props:t,oldProps:n,changeFlags:r}=e,i=this.getAttributeManager(),{iconAtlas:a,iconMapping:o,data:s,getIcon:c,textureParameters:l}=t,{iconManager:u}=this.state;if(typeof a==`string`)return;let d=a||this.internalState.isAsyncPropLoading(`iconAtlas`);u.setProps({loadOptions:t.loadOptions,autoPacking:!d,iconAtlas:a,iconMapping:d?o:null,textureParameters:l}),d?n.iconMapping!==t.iconMapping&&i.invalidate(`getIcon`):(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&u.packIcons(s,c),r.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),i.invalidateAll())}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(e){super.finalizeState(e),this.state.iconManager.finalize()}draw({uniforms:e}){let{sizeScale:t,sizeBasis:n,sizeMinPixels:r,sizeMaxPixels:i,sizeUnits:a,billboard:o,alphaCutoff:s}=this.props,{iconManager:c}=this.state,l=c.getTexture();if(l){let e=this.state.model,c={iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeUnits:vp[a],sizeScale:t,sizeBasis:+(n===`height`),sizeMinPixels:r,sizeMaxPixels:i,billboard:o,alphaCutoff:s};e.shaderInputs.setProps({icon:c}),e.draw(this.context.renderPass)}}_getModel(){let e=[-1,-1,1,-1,-1,1,1,1];return new Rg(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new Jg({topology:`triangle-strip`,attributes:{positions:{size:2,value:new Float32Array(e)}}}),isInstanced:!0})}_onUpdate(e){e?(this.getAttributeManager()?.invalidate(`getIcon`),this.setNeedsUpdate()):this.setNeedsRedraw()}_onError(e){let t=this.getCurrentLayer()?.props.onIconError;t?t(e):fo.error(e.error.message)()}getInstanceIconDef(e){let{x:t,y:n,width:r,height:i,mask:a,anchorX:o=r/2,anchorY:s=i/2}=this.state.iconManager.getIconMapping(e);return[r/2-o,i/2-s,t,n,r,i,+!!a]}};FN.defaultProps=rte,FN.layerName=`IconLayer`;var IN=`layout(std140) uniform lineUniforms { + float widthScale; + float widthMinPixels; + float widthMaxPixels; + float useShortestPath; + highp int widthUnits; +} line; +`,ite={name:`line`,source:``,vs:IN,fs:IN,uniformTypes:{widthScale:`f32`,widthMinPixels:`f32`,widthMaxPixels:`f32`,useShortestPath:`f32`,widthUnits:`i32`}},ate=`// ---------- Helper Structures & Functions ---------- + +// Placeholder filter functions. +fn deckgl_filter_size(offset: vec3, geometry: Geometry) -> vec3 { + return offset; +} +fn deckgl_filter_gl_position(p: vec4, geometry: Geometry) -> vec4 { + if (picking.isAttribute > 0.5) { + // For depth picking, write normalized depth into the picking payload. + // This mirrors the legacy DECKGL_FILTER_GL_POSITION hook on WebGL. + } + return p; +} + +// Compute an extrusion offset given a line direction (in clipspace), +// an offset direction (-1 or 1), and a width in pixels. +// Assumes a uniform "project" with a viewportSize field is available. +fn getExtrusionOffset(line_clipspace: vec2, offset_direction: f32, width: f32) -> vec2 { + // project.viewportSize should be provided as a uniform (not shown here) + let dir_screenspace = normalize(line_clipspace * project.viewportSize); + // Rotate by 90°: (x,y) becomes (-y,x) + let rotated = vec2(-dir_screenspace.y, dir_screenspace.x); + return rotated * offset_direction * width / 2.0; +} + +// Splits the line between two points at a given x coordinate. +// Interpolates the y and z components. +fn splitLine(a: vec3, b: vec3, x: f32) -> vec3 { + let t: f32 = (x - a.x) / (b.x - a.x); + return vec3(x, a.yz + t * (b.yz - a.yz)); +} + +// ---------- Uniforms & Global Structures ---------- + +struct LineUniforms { + widthScale: f32, + widthMinPixels: f32, + widthMaxPixels: f32, + useShortestPath: f32, + widthUnits: i32, +}; + +@group(0) @binding(0) +var line: LineUniforms; + + + +// ---------- Vertex Output Structure ---------- + +struct Varyings { + @builtin(position) gl_Position: vec4, + @location(0) vColor: vec4, + @location(1) uv: vec2, + @location(2) pickingColor: vec3, +}; + +// ---------- Vertex Shader Entry Point ---------- + +@vertex +fn vertexMain( + @location(0) positions: vec3, + @location(1) instanceSourcePositions: vec3, + @location(2) instanceTargetPositions: vec3, + @location(3) instanceSourcePositions64Low: vec3, + @location(4) instanceTargetPositions64Low: vec3, + @location(5) instanceColors: vec4, + @location(6) instancePickingColors: vec3, + @location(7) instanceWidths: f32 +) -> Varyings { + geometry.worldPosition = instanceSourcePositions; + geometry.worldPositionAlt = instanceTargetPositions; + + var source_world: vec3 = instanceSourcePositions; + var target_world: vec3 = instanceTargetPositions; + var source_world_64low: vec3 = instanceSourcePositions64Low; + var target_world_64low: vec3 = instanceTargetPositions64Low; + + // Apply shortest-path adjustments if needed. + if (line.useShortestPath > 0.5 || line.useShortestPath < -0.5) { + source_world.x = (source_world.x + 180.0 % 360.0) - 180.0; + target_world.x = (target_world.x + 180.0 % 360.0) - 180.0; + let deltaLng: f32 = target_world.x - source_world.x; + + if (deltaLng * line.useShortestPath > 180.0) { + source_world.x = source_world.x + 360.0 * line.useShortestPath; + source_world = splitLine(source_world, target_world, 180.0 * line.useShortestPath); + source_world_64low = vec3(0.0, 0.0, 0.0); + } else if (deltaLng * line.useShortestPath < -180.0) { + target_world.x = target_world.x + 360.0 * line.useShortestPath; + target_world = splitLine(source_world, target_world, 180.0 * line.useShortestPath); + target_world_64low = vec3(0.0, 0.0, 0.0); + } else if (line.useShortestPath < 0.0) { + var abortOut: Varyings; + abortOut.gl_Position = vec4(0.0); + abortOut.vColor = vec4(0.0); + abortOut.uv = vec2(0.0); + return abortOut; + } + } + + // Project Pos and target positions to clip space. + let sourceResult = project_position_to_clipspace_and_commonspace(source_world, source_world_64low, vec3(0.0)); + let targetResult = project_position_to_clipspace_and_commonspace(target_world, target_world_64low, vec3(0.0)); + let sourcePos: vec4 = sourceResult.clipPosition; + let targetPos: vec4 = targetResult.clipPosition; + let source_commonspace: vec4 = sourceResult.commonPosition; + let target_commonspace: vec4 = targetResult.commonPosition; + + // Interpolate along the line segment. + let segmentIndex: f32 = positions.x; + let p: vec4 = sourcePos + segmentIndex * (targetPos - sourcePos); + geometry.position = source_commonspace + segmentIndex * (target_commonspace - source_commonspace); + let uv: vec2 = positions.xy; + geometry.uv = uv; + geometry.pickingColor = instancePickingColors; + + // Determine width in pixels. + let widthPixels: f32 = clamp( + project_unit_size_to_pixel(instanceWidths * line.widthScale, line.widthUnits), + line.widthMinPixels, line.widthMaxPixels + ); + + // Compute extrusion offset. + let extrusion: vec2 = getExtrusionOffset(targetPos.xy - sourcePos.xy, positions.y, widthPixels); + let offset: vec3 = vec3(extrusion, 0.0); + + // Apply deck.gl filter functions. + let filteredOffset = deckgl_filter_size(offset, geometry); + let filteredP = deckgl_filter_gl_position(p, geometry); + + let clipOffset: vec2 = project_pixel_size_to_clipspace(filteredOffset.xy); + let finalPosition: vec4 = filteredP + vec4(clipOffset, 0.0, 0.0); + + // Compute color. + var vColor: vec4 = vec4(instanceColors.rgb, instanceColors.a * layer.opacity); + // vColor = deckgl_filter_color(vColor, geometry); + + var output: Varyings; + output.gl_Position = finalPosition; + output.vColor = vColor; + output.uv = uv; + output.pickingColor = instancePickingColors; + return output; +} + +@fragment +fn fragmentMain( + @location(0) vColor: vec4, + @location(1) uv: vec2, + @location(2) pickingColor: vec3 +) -> @location(0) vec4 { + // Create and initialize geometry with the provided uv. + var geometry: Geometry; + geometry.uv = uv; + + // Start with the input color. + var fragColor: vec4 = vColor; + + if (picking.isActive > 0.5) { + if (!picking_isColorValid(pickingColor)) { + discard; + } + return vec4(pickingColor, 1.0); + } + + if (picking.isHighlightActive > 0.5) { + let highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor); + if (picking_isColorZero(abs(pickingColor - highlightedObjectColor))) { + let highLightAlpha = picking.highlightColor.a; + let blendedAlpha = highLightAlpha + fragColor.a * (1.0 - highLightAlpha); + if (blendedAlpha > 0.0) { + let highLightRatio = highLightAlpha / blendedAlpha; + fragColor = vec4( + mix(fragColor.rgb, picking.highlightColor.rgb, highLightRatio), + blendedAlpha + ); + } else { + fragColor = vec4(fragColor.rgb, 0.0); + } + } + } + + // Apply premultiplied alpha as required by transparent canvas + fragColor = deckgl_premultiplied_alpha(fragColor); + + return fragColor; +} +`,ote=`#version 300 es +#define SHADER_NAME line-layer-vertex-shader +in vec3 positions; +in vec3 instanceSourcePositions; +in vec3 instanceTargetPositions; +in vec3 instanceSourcePositions64Low; +in vec3 instanceTargetPositions64Low; +in vec4 instanceColors; +in vec3 instancePickingColors; +in float instanceWidths; +out vec4 vColor; +out vec2 uv; +vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) { +vec2 dir_screenspace = normalize(line_clipspace * project.viewportSize); +dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x); +return dir_screenspace * offset_direction * width / 2.0; +} +vec3 splitLine(vec3 a, vec3 b, float x) { +float t = (x - a.x) / (b.x - a.x); +return vec3(x, mix(a.yz, b.yz, t)); +} +void main(void) { +geometry.worldPosition = instanceSourcePositions; +geometry.worldPositionAlt = instanceTargetPositions; +vec3 source_world = instanceSourcePositions; +vec3 target_world = instanceTargetPositions; +vec3 source_world_64low = instanceSourcePositions64Low; +vec3 target_world_64low = instanceTargetPositions64Low; +if (line.useShortestPath > 0.5 || line.useShortestPath < -0.5) { +source_world.x = mod(source_world.x + 180., 360.0) - 180.; +target_world.x = mod(target_world.x + 180., 360.0) - 180.; +float deltaLng = target_world.x - source_world.x; +if (deltaLng * line.useShortestPath > 180.) { +source_world.x += 360. * line.useShortestPath; +source_world = splitLine(source_world, target_world, 180. * line.useShortestPath); +source_world_64low = vec3(0.0); +} else if (deltaLng * line.useShortestPath < -180.) { +target_world.x += 360. * line.useShortestPath; +target_world = splitLine(source_world, target_world, 180. * line.useShortestPath); +target_world_64low = vec3(0.0); +} else if (line.useShortestPath < 0.) { +gl_Position = vec4(0.); +return; +} +} +vec4 source_commonspace; +vec4 target_commonspace; +vec4 source = project_position_to_clipspace(source_world, source_world_64low, vec3(0.), source_commonspace); +vec4 target = project_position_to_clipspace(target_world, target_world_64low, vec3(0.), target_commonspace); +float segmentIndex = positions.x; +vec4 p = mix(source, target, segmentIndex); +geometry.position = mix(source_commonspace, target_commonspace, segmentIndex); +uv = positions.xy; +geometry.uv = uv; +geometry.pickingColor = instancePickingColors; +float widthPixels = clamp( +project_size_to_pixel(instanceWidths * line.widthScale, line.widthUnits), +line.widthMinPixels, line.widthMaxPixels +); +vec3 offset = vec3( +getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels), +0.0); +DECKGL_FILTER_SIZE(offset, geometry); +DECKGL_FILTER_GL_POSITION(p, geometry); +gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0); +vColor = vec4(instanceColors.rgb, instanceColors.a * layer.opacity); +DECKGL_FILTER_COLOR(vColor, geometry); +} +`,ste=`#version 300 es +#define SHADER_NAME line-layer-fragment-shader +precision highp float; +in vec4 vColor; +in vec2 uv; +out vec4 fragColor; +void main(void) { +geometry.uv = uv; +fragColor = vColor; +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,cte={getSourcePosition:{type:`accessor`,value:e=>e.sourcePosition},getTargetPosition:{type:`accessor`,value:e=>e.targetPosition},getColor:{type:`accessor`,value:[0,0,0,255]},getWidth:{type:`accessor`,value:1},widthUnits:`pixels`,widthScale:{type:`number`,value:1,min:0},widthMinPixels:{type:`number`,value:0,min:0},widthMaxPixels:{type:`number`,value:2**53-1,min:0}},LN=class extends dx{getBounds(){return this.getAttributeManager()?.getBounds([`instanceSourcePositions`,`instanceTargetPositions`])}getShaders(){return super.getShaders({vs:ote,fs:ste,source:ate,modules:[Bp,Wd,jm,ite]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:`float64`,fp64:this.use64bitPositions(),transition:!0,accessor:`getSourcePosition`},instanceTargetPositions:{size:3,type:`float64`,fp64:this.use64bitPositions(),transition:!0,accessor:`getTargetPosition`},instanceColors:{size:this.props.colorFormat.length,type:`unorm8`,transition:!0,accessor:`getColor`,defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:`getWidth`,defaultValue:1}})}updateState(e){super.updateState(e),e.changeFlags.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){let{widthUnits:t,widthScale:n,widthMinPixels:r,widthMaxPixels:i,wrapLongitude:a}=this.props,o=this.state.model,s={widthUnits:vp[t],widthScale:n,widthMinPixels:r,widthMaxPixels:i,useShortestPath:+!!a};o.shaderInputs.setProps({line:s}),o.draw(this.context.renderPass),a&&(o.shaderInputs.setProps({line:{...s,useShortestPath:-1}}),o.draw(this.context.renderPass))}_getModel(){let e=[0,-1,0,0,1,0,1,-1,0,1,1,0];return new Rg(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new Jg({topology:`triangle-strip`,attributes:{positions:{size:3,value:new Float32Array(e)}}}),isInstanced:!0})}};LN.layerName=`LineLayer`,LN.defaultProps=cte;var RN=`layout(std140) uniform pointCloudUniforms { + float radiusPixels; + highp int sizeUnits; +} pointCloud; +`,lte={name:`pointCloud`,source:``,vs:RN,fs:RN,uniformTypes:{radiusPixels:`f32`,sizeUnits:`i32`}},ute=`#version 300 es +#define SHADER_NAME point-cloud-layer-vertex-shader +in vec3 positions; +in vec3 instanceNormals; +in vec4 instanceColors; +in vec3 instancePositions; +in vec3 instancePositions64Low; +in vec3 instancePickingColors; +out vec4 vColor; +out vec2 unitPosition; +void main(void) { +geometry.worldPosition = instancePositions; +geometry.normal = project_normal(instanceNormals); +unitPosition = positions.xy; +geometry.uv = unitPosition; +geometry.pickingColor = instancePickingColors; +vec3 offset = vec3(positions.xy * project_size_to_pixel(pointCloud.radiusPixels, pointCloud.sizeUnits), 0.0); +DECKGL_FILTER_SIZE(offset, geometry); +gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +gl_Position.xy += project_pixel_size_to_clipspace(offset.xy); +vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal); +vColor = vec4(lightColor, instanceColors.a * layer.opacity); +DECKGL_FILTER_COLOR(vColor, geometry); +} +`,dte=`#version 300 es +#define SHADER_NAME point-cloud-layer-fragment-shader +precision highp float; +in vec4 vColor; +in vec2 unitPosition; +out vec4 fragColor; +void main(void) { +geometry.uv = unitPosition.xy; +float distToCenter = length(unitPosition); +if (distToCenter > 1.0) { +discard; +} +fragColor = vColor; +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,fte=`struct PointCloudUniforms { + radiusPixels: f32, + sizeUnits: i32, +}; + +@group(0) @binding(0) +var pointCloudUniforms: PointCloudUniforms; + +struct ConstantAttributes { + instanceNormals: vec3, + instanceColors: vec4, + instancePositions: vec3, + instancePositions64Low: vec3, + instancePickingColors: vec3 +}; + +const constants = ConstantAttributes( + vec3(1.0, 0.0, 0.0), + vec4(0.0, 0.0, 0.0, 1.0), + vec3(0.0), + vec3(0.0), + vec3(0.0) +); + +struct Attributes { + @builtin(instance_index) instanceIndex : u32, + @builtin(vertex_index) vertexIndex : u32, + @location(0) positions: vec3, + @location(1) instancePositions: vec3, + @location(2) instancePositions64Low: vec3, + @location(3) instanceNormals: vec3, + @location(4) instanceColors: vec4, + @location(5) instancePickingColors: vec3 +}; + +struct Varyings { + @builtin(position) position: vec4, + @location(0) vColor: vec4, + @location(1) unitPosition: vec2, + @location(2) pickingColor: vec3, +}; + +@vertex +fn vertexMain(attributes: Attributes) -> Varyings { + var varyings: Varyings; + + geometry.worldPosition = attributes.instancePositions; + + let centerResult = project_position_to_clipspace_and_commonspace( + attributes.instancePositions, + attributes.instancePositions64Low, + vec3(0.0) + ); + geometry.position = centerResult.commonPosition; + geometry.normal = project_normal(attributes.instanceNormals); + + // position on the containing square in [-1, 1] space + varyings.unitPosition = attributes.positions.xy; + geometry.uv = varyings.unitPosition; + geometry.pickingColor = attributes.instancePickingColors; + + // Find the center of the point and add the current vertex + let offset = vec3( + attributes.positions.xy * + project_unit_size_to_pixel(pointCloudUniforms.radiusPixels, pointCloudUniforms.sizeUnits), + 0.0 + ); + // DECKGL_FILTER_SIZE(offset, geometry); + + varyings.position = centerResult.clipPosition; + // DECKGL_FILTER_GL_POSITION(gl_Position, geometry); + let clipPixels = project_pixel_size_to_clipspace(offset.xy); + varyings.position.x += clipPixels.x; + varyings.position.y += clipPixels.y; + + // Apply lighting + let lightColor = lighting_getLightColor2(attributes.instanceColors.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal); + + // Apply opacity to instance color, or return instance picking color + varyings.vColor = vec4(lightColor, attributes.instanceColors.a * layer.opacity); + // DECKGL_FILTER_COLOR(vColor, geometry); + varyings.pickingColor = attributes.instancePickingColors; + + return varyings; +} + +@fragment +fn fragmentMain(varyings: Varyings) -> @location(0) vec4 { + // var geometry: Geometry; + // geometry.uv = unitPosition.xy; + + let distToCenter = length(varyings.unitPosition); + if (distToCenter > 1.0) { + discard; + } + + var fragColor: vec4; + + fragColor = varyings.vColor; + + if (picking.isActive > 0.5) { + if (!picking_isColorValid(varyings.pickingColor)) { + discard; + } + return vec4(varyings.pickingColor, 1.0); + } + + if (picking.isHighlightActive > 0.5) { + let highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor); + if (picking_isColorZero(abs(varyings.pickingColor - highlightedObjectColor))) { + let highLightAlpha = picking.highlightColor.a; + let blendedAlpha = highLightAlpha + fragColor.a * (1.0 - highLightAlpha); + if (blendedAlpha > 0.0) { + let highLightRatio = highLightAlpha / blendedAlpha; + fragColor = vec4( + mix(fragColor.rgb, picking.highlightColor.rgb, highLightRatio), + blendedAlpha + ); + } else { + fragColor = vec4(fragColor.rgb, 0.0); + } + } + } + + // Apply premultiplied alpha as required by transparent canvas + fragColor = deckgl_premultiplied_alpha(fragColor); + + return fragColor; +} +`,zN=[0,0,0,255],BN=[0,0,1],pte={sizeUnits:`pixels`,pointSize:{type:`number`,min:0,value:10},getPosition:{type:`accessor`,value:e=>e.position},getNormal:{type:`accessor`,value:BN},getColor:{type:`accessor`,value:zN},material:!0,radiusPixels:{deprecatedFor:`pointSize`}};function mte(e){let{header:t,attributes:n}=e;if(!(!t||!n)&&(e.length=t.vertexCount,n.POSITION&&(n.instancePositions=n.POSITION),n.NORMAL&&(n.instanceNormals=n.NORMAL),n.COLOR_0)){let{size:e,value:t}=n.COLOR_0;n.instanceColors={size:e,type:`unorm8`,value:t}}}var VN=class extends dx{getShaders(){return super.getShaders({vs:ute,fs:dte,source:fte,modules:[Bp,Wd,Id,jm,lte]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:`float64`,fp64:this.use64bitPositions(),transition:!0,accessor:`getPosition`},instanceNormals:{size:3,transition:!0,accessor:`getNormal`,defaultValue:BN},instanceColors:{size:this.props.colorFormat.length,type:`unorm8`,transition:!0,accessor:`getColor`,defaultValue:zN}})}updateState(e){let{changeFlags:t,props:n}=e;super.updateState(e),t.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll()),t.dataChanged&&mte(n.data)}draw({uniforms:e}){let{pointSize:t,sizeUnits:n}=this.props,r=this.state.model,i={sizeUnits:vp[n],radiusPixels:t};r.shaderInputs.setProps({pointCloud:i}),r.draw(this.context.renderPass)}_getModel(){let e=[];for(let t=0;t<3;t++){let n=t/3*Math.PI*2;e.push(Math.cos(n)*2,Math.sin(n)*2,0)}return new Rg(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new Jg({topology:`triangle-list`,attributes:{positions:new Float32Array(e)}}),isInstanced:!0})}};VN.layerName=`PointCloudLayer`,VN.defaultProps=pte;var HN=`layout(std140) uniform scatterplotUniforms { + float radiusScale; + float radiusMinPixels; + float radiusMaxPixels; + float lineWidthScale; + float lineWidthMinPixels; + float lineWidthMaxPixels; + float stroked; + float filled; + bool antialiasing; + bool billboard; + highp int radiusUnits; + highp int lineWidthUnits; +} scatterplot; +`,hte={name:`scatterplot`,vs:HN,fs:HN,source:``,uniformTypes:{radiusScale:`f32`,radiusMinPixels:`f32`,radiusMaxPixels:`f32`,lineWidthScale:`f32`,lineWidthMinPixels:`f32`,lineWidthMaxPixels:`f32`,stroked:`f32`,filled:`f32`,antialiasing:`f32`,billboard:`f32`,radiusUnits:`i32`,lineWidthUnits:`i32`}},gte=`#version 300 es +#define SHADER_NAME scatterplot-layer-vertex-shader +in vec3 positions; +in vec3 instancePositions; +in vec3 instancePositions64Low; +in float instanceRadius; +in float instanceLineWidths; +in vec4 instanceFillColors; +in vec4 instanceLineColors; +in vec3 instancePickingColors; +in vec2 instancePixelOffset; +out vec4 vFillColor; +out vec4 vLineColor; +out vec2 unitPosition; +out float innerUnitRadius; +out float outerRadiusPixels; +void main(void) { +geometry.worldPosition = instancePositions; +outerRadiusPixels = clamp( +project_size_to_pixel(scatterplot.radiusScale * instanceRadius, scatterplot.radiusUnits), +scatterplot.radiusMinPixels, scatterplot.radiusMaxPixels +); +float lineWidthPixels = clamp( +project_size_to_pixel(scatterplot.lineWidthScale * instanceLineWidths, scatterplot.lineWidthUnits), +scatterplot.lineWidthMinPixels, scatterplot.lineWidthMaxPixels +); +outerRadiusPixels += scatterplot.stroked * lineWidthPixels / 2.0; +float edgePadding = scatterplot.antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0; +unitPosition = edgePadding * positions.xy; +geometry.uv = unitPosition; +geometry.pickingColor = instancePickingColors; +innerUnitRadius = 1.0 - scatterplot.stroked * lineWidthPixels / outerRadiusPixels; +if (scatterplot.billboard) { +gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +vec3 offset = edgePadding * positions * outerRadiusPixels; +offset.xy += instancePixelOffset; +DECKGL_FILTER_SIZE(offset, geometry); +gl_Position.xy += project_pixel_size_to_clipspace(offset.xy); +} else { +vec3 offset = edgePadding * positions * project_pixel_size(outerRadiusPixels); +offset.xy += project_pixel_size(instancePixelOffset); +DECKGL_FILTER_SIZE(offset, geometry); +gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +} +vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * layer.opacity); +DECKGL_FILTER_COLOR(vFillColor, geometry); +vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * layer.opacity); +DECKGL_FILTER_COLOR(vLineColor, geometry); +} +`,_te=`#version 300 es +#define SHADER_NAME scatterplot-layer-fragment-shader +precision highp float; +in vec4 vFillColor; +in vec4 vLineColor; +in vec2 unitPosition; +in float innerUnitRadius; +in float outerRadiusPixels; +out vec4 fragColor; +void main(void) { +geometry.uv = unitPosition; +float distToCenter = length(unitPosition) * outerRadiusPixels; +float inCircle = scatterplot.antialiasing ? +smoothedge(distToCenter, outerRadiusPixels) : +step(distToCenter, outerRadiusPixels); +if (inCircle == 0.0) { +discard; +} +if (scatterplot.stroked > 0.5) { +float isLine = scatterplot.antialiasing ? +smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) : +step(innerUnitRadius * outerRadiusPixels, distToCenter); +if (scatterplot.filled > 0.5) { +fragColor = mix(vFillColor, vLineColor, isLine); +} else { +if (isLine == 0.0) { +discard; +} +fragColor = vec4(vLineColor.rgb, vLineColor.a * isLine); +} +} else if (scatterplot.filled < 0.5) { +discard; +} else { +fragColor = vFillColor; +} +fragColor.a *= inCircle; +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,vte=`// Main shaders + +struct ScatterplotUniforms { + radiusScale: f32, + radiusMinPixels: f32, + radiusMaxPixels: f32, + lineWidthScale: f32, + lineWidthMinPixels: f32, + lineWidthMaxPixels: f32, + stroked: f32, + filled: i32, + antialiasing: i32, + billboard: i32, + radiusUnits: i32, + lineWidthUnits: i32, +}; + +struct ConstantAttributeUniforms { + instancePositions: vec3, + instancePositions64Low: vec3, + instanceRadius: f32, + instanceLineWidths: f32, + instanceFillColors: vec4, + instanceLineColors: vec4, + instancePickingColors: vec3, + instancePixelOffset: vec2, + + instancePositionsConstant: i32, + instancePositions64LowConstant: i32, + instanceRadiusConstant: i32, + instanceLineWidthsConstant: i32, + instanceFillColorsConstant: i32, + instanceLineColorsConstant: i32, + instancePickingColorsConstant: i32, + instancePixelOffsetConstant: i32 +}; + +@group(0) @binding(0) var scatterplot: ScatterplotUniforms; + +struct ConstantAttributes { + instancePositions: vec3, + instancePositions64Low: vec3, + instanceRadius: f32, + instanceLineWidths: f32, + instanceFillColors: vec4, + instanceLineColors: vec4, + instancePickingColors: vec3, + instancePixelOffset: vec2 +}; + +const constants = ConstantAttributes( + vec3(0.0), + vec3(0.0), + 0.0, + 0.0, + vec4(0.0, 0.0, 0.0, 1.0), + vec4(0.0, 0.0, 0.0, 1.0), + vec3(0.0), + vec2(0.0) +); + +struct Attributes { + @builtin(instance_index) instanceIndex : u32, + @builtin(vertex_index) vertexIndex : u32, + @location(0) positions: vec3, + @location(1) instancePositions: vec3, + @location(2) instancePositions64Low: vec3, + @location(3) instanceRadius: f32, + @location(4) instanceLineWidths: f32, + @location(5) instanceFillColors: vec4, + @location(6) instanceLineColors: vec4, + @location(7) instancePickingColors: vec3, + @location(8) instancePixelOffset: vec2 +}; + +struct Varyings { + @builtin(position) position: vec4, + @location(0) vFillColor: vec4, + @location(1) vLineColor: vec4, + @location(2) unitPosition: vec2, + @location(3) innerUnitRadius: f32, + @location(4) outerRadiusPixels: f32, + @location(5) pickingColor: vec3, +}; + +@vertex +fn vertexMain(attributes: Attributes) -> Varyings { + var varyings: Varyings; + + // Draw an inline geometry constant array clip space triangle to verify that rendering works. + // var positions = array, 3>(vec2(0.0, 0.5), vec2(-0.5, -0.5), vec2(0.5, -0.5)); + // if (attributes.instanceIndex == 0) { + // varyings.position = vec4(positions[attributes.vertexIndex], 0.0, 1.0); + // return varyings; + // } + + geometry.worldPosition = attributes.instancePositions; + + // Multiply out radius and clamp to limits + varyings.outerRadiusPixels = clamp( + project_unit_size_to_pixel(scatterplot.radiusScale * attributes.instanceRadius, scatterplot.radiusUnits), + scatterplot.radiusMinPixels, scatterplot.radiusMaxPixels + ); + + // Multiply out line width and clamp to limits + let lineWidthPixels = clamp( + project_unit_size_to_pixel(scatterplot.lineWidthScale * attributes.instanceLineWidths, scatterplot.lineWidthUnits), + scatterplot.lineWidthMinPixels, scatterplot.lineWidthMaxPixels + ); + + // outer radius needs to offset by half stroke width + varyings.outerRadiusPixels += scatterplot.stroked * lineWidthPixels / 2.0; + // Expand geometry to accommodate edge smoothing + let edgePadding = select( + (varyings.outerRadiusPixels + SMOOTH_EDGE_RADIUS) / varyings.outerRadiusPixels, + 1.0, + scatterplot.antialiasing != 0 + ); + + // position on the containing square in [-1, 1] space + varyings.unitPosition = edgePadding * attributes.positions.xy; + geometry.uv = varyings.unitPosition; + geometry.pickingColor = attributes.instancePickingColors; + + varyings.innerUnitRadius = 1.0 - scatterplot.stroked * lineWidthPixels / varyings.outerRadiusPixels; + + if (scatterplot.billboard != 0) { + varyings.position = project_position_to_clipspace(attributes.instancePositions, attributes.instancePositions64Low, vec3(0.0)); // TODO , geometry.position); + // DECKGL_FILTER_GL_POSITION(varyings.position, geometry); + var offset = edgePadding * attributes.positions * varyings.outerRadiusPixels; + offset = vec3(offset.xy + attributes.instancePixelOffset, offset.z); + // DECKGL_FILTER_SIZE(offset, geometry); + let clipPixels = project_pixel_size_to_clipspace(offset.xy); + varyings.position = vec4(varyings.position.x + clipPixels.x, varyings.position.y + clipPixels.y, varyings.position.z, varyings.position.w); + } else { + var offset = edgePadding * attributes.positions * project_pixel_size_float(varyings.outerRadiusPixels); + offset = vec3(offset.xy + project_pixel_size_vec2(attributes.instancePixelOffset), offset.z); + // DECKGL_FILTER_SIZE(offset, geometry); + varyings.position = project_position_to_clipspace(attributes.instancePositions, attributes.instancePositions64Low, offset); // TODO , geometry.position); + // DECKGL_FILTER_GL_POSITION(varyings.position, geometry); + } + + // Apply opacity to instance color, or return instance picking color + varyings.vFillColor = vec4(attributes.instanceFillColors.rgb, attributes.instanceFillColors.a * layer.opacity); + // DECKGL_FILTER_COLOR(varyings.vFillColor, geometry); + varyings.vLineColor = vec4(attributes.instanceLineColors.rgb, attributes.instanceLineColors.a * layer.opacity); + // DECKGL_FILTER_COLOR(varyings.vLineColor, geometry); + varyings.pickingColor = attributes.instancePickingColors; + + return varyings; +} + +@fragment +fn fragmentMain(varyings: Varyings) -> @location(0) vec4 { + // var geometry: Geometry; + // geometry.uv = unitPosition; + + let distToCenter = length(varyings.unitPosition) * varyings.outerRadiusPixels; + let inCircle = select( + smoothedge(distToCenter, varyings.outerRadiusPixels), + step(distToCenter, varyings.outerRadiusPixels), + scatterplot.antialiasing != 0 + ); + + if (inCircle == 0.0) { + discard; + } + + var fragColor: vec4; + + if (scatterplot.stroked != 0) { + let isLine = select( + smoothedge(varyings.innerUnitRadius * varyings.outerRadiusPixels, distToCenter), + step(varyings.innerUnitRadius * varyings.outerRadiusPixels, distToCenter), + scatterplot.antialiasing != 0 + ); + + if (scatterplot.filled != 0) { + fragColor = mix(varyings.vFillColor, varyings.vLineColor, isLine); + } else { + if (isLine == 0.0) { + discard; + } + fragColor = vec4(varyings.vLineColor.rgb, varyings.vLineColor.a * isLine); + } + } else if (scatterplot.filled == 0) { + discard; + } else { + fragColor = varyings.vFillColor; + } + + fragColor.a *= inCircle; + + if (picking.isActive > 0.5) { + if (!picking_isColorValid(varyings.pickingColor)) { + discard; + } + return vec4(varyings.pickingColor, 1.0); + } + + if (picking.isHighlightActive > 0.5) { + let highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor); + if (picking_isColorZero(abs(varyings.pickingColor - highlightedObjectColor))) { + let highLightAlpha = picking.highlightColor.a; + let blendedAlpha = highLightAlpha + fragColor.a * (1.0 - highLightAlpha); + if (blendedAlpha > 0.0) { + let highLightRatio = highLightAlpha / blendedAlpha; + fragColor = vec4( + mix(fragColor.rgb, picking.highlightColor.rgb, highLightRatio), + blendedAlpha + ); + } else { + fragColor = vec4(fragColor.rgb, 0.0); + } + } + } + + // Apply premultiplied alpha as required by transparent canvas + fragColor = deckgl_premultiplied_alpha(fragColor); + + return fragColor; + // return vec4(0, 0, 1, 1); +} +`,UN=[0,0,0,255],yte={radiusUnits:`meters`,radiusScale:{type:`number`,min:0,value:1},radiusMinPixels:{type:`number`,min:0,value:0},radiusMaxPixels:{type:`number`,min:0,value:2**53-1},lineWidthUnits:`meters`,lineWidthScale:{type:`number`,min:0,value:1},lineWidthMinPixels:{type:`number`,min:0,value:0},lineWidthMaxPixels:{type:`number`,min:0,value:2**53-1},stroked:!1,filled:!0,billboard:!1,antialiasing:!0,getPosition:{type:`accessor`,value:e=>e.position},getRadius:{type:`accessor`,value:1},getFillColor:{type:`accessor`,value:UN},getLineColor:{type:`accessor`,value:UN},getLineWidth:{type:`accessor`,value:1},getPixelOffset:{type:`accessor`,value:[0,0]},strokeWidth:{deprecatedFor:`getLineWidth`},outline:{deprecatedFor:`stroked`},getColor:{deprecatedFor:[`getFillColor`,`getLineColor`]}},WN=class extends dx{getShaders(){return super.getShaders({vs:gte,fs:_te,source:vte,modules:[Bp,Wd,jm,hte]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:`float64`,fp64:this.use64bitPositions(),transition:!0,accessor:`getPosition`},instanceRadius:{size:1,transition:!0,accessor:`getRadius`,defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,type:`unorm8`,accessor:`getFillColor`,defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,type:`unorm8`,accessor:`getLineColor`,defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:`getLineWidth`,defaultValue:1},instancePixelOffset:{size:2,transition:!0,accessor:`getPixelOffset`}})}updateState(e){super.updateState(e),e.changeFlags.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){let{radiusUnits:t,radiusScale:n,radiusMinPixels:r,radiusMaxPixels:i,stroked:a,filled:o,billboard:s,antialiasing:c,lineWidthUnits:l,lineWidthScale:u,lineWidthMinPixels:d,lineWidthMaxPixels:f}=this.props,p={stroked:a,filled:o,billboard:s,antialiasing:c,radiusUnits:vp[t],radiusScale:n,radiusMinPixels:r,radiusMaxPixels:i,lineWidthUnits:vp[l],lineWidthScale:u,lineWidthMinPixels:d,lineWidthMaxPixels:f},m=this.state.model;m.shaderInputs.setProps({scatterplot:p}),m.draw(this.context.renderPass)}_getModel(){let e=[-1,-1,0,1,-1,0,-1,1,0,1,1,0];return new Rg(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new Jg({topology:`triangle-strip`,attributes:{positions:{size:3,value:new Float32Array(e)}}}),isInstanced:!0})}};WN.defaultProps=yte,WN.layerName=`ScatterplotLayer`;var GN={CLOCKWISE:1,COUNTER_CLOCKWISE:-1};function KN(e,t,n={}){return qN(e,n)===t?!1:(XN(e,n),!0)}function qN(e,t={}){return Math.sign(YN(e,t))}var JN={x:0,y:1,z:2};function YN(e,t={}){let{start:n=0,end:r=e.length,plane:i=`xy`}=t,a=t.size||2,o=0,s=JN[i[0]],c=JN[i[1]];for(let t=n,i=r-a;t=0)return!1;let i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=ia?i>o?i:o:a>o?a:o,p=s>c?s>l?s:l:c>l?c:l,m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&oP(i,s,a,c,o,l,m.x,m.y)&&cP(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function eP(e,t,n,r){let i=e.prev,a=e,o=e.next;if(cP(i,a,o)>=0)return!1;let s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=sc?s>l?s:l:c>l?c:l,g=u>d?u>f?u:f:d>f?d:f,_=aP(p,m,t,n,r),v=aP(h,g,t,n,r),y=e.prevZ,b=e.nextZ;for(;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&oP(s,u,c,d,l,f,y.x,y.y)&&cP(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&oP(s,u,c,d,l,f,b.x,b.y)&&cP(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&oP(s,u,c,d,l,f,y.x,y.y)&&cP(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&oP(s,u,c,d,l,f,b.x,b.y)&&cP(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function tP(e,t,n){let r=e;do{let i=r.prev,a=r.next.next;!lP(i,a)&&uP(i,r,r.next,a)&&mP(i,a)&&mP(a,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(a.i/n|0),_P(r),_P(r.next),r=e=a),r=r.next}while(r!==e);return ZN(r)}function nP(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&sP(o,e)){let s=gP(o,e);o=ZN(o,o.next),s=ZN(s,s.next),QN(o,t,n,r,i,a,0),QN(s,t,n,r,i,a,0);return}e=e.next}o=o.next}while(o!==e)}function rP(e,t,n,r){let i=e;do i.z===0&&(i.z=aP(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,iP(i)}function iP(e){let t,n,r=1,i,a,o,s,c,l;do{for(a=e,e=null,l=null,i=0;a;){for(i++,s=a,o=0,n=0;n0||c>0&&s;)o!==0&&(c===0||!s||a.z<=s.z)?(t=a,a=a.nextZ,o--):(t=s,s=s.nextZ,c--),l?l.nextZ=t:e=t,t.prevZ=l,l=t;a=s}l.nextZ=null,r*=2}while(i>1);return e}function aP(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function oP(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function sP(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!pP(e,t)&&(mP(e,t)&&mP(t,e)&&hP(e,t)&&(cP(e.prev,e,t.prev)||cP(e,t.prev,t))||lP(e,t)&&cP(e.prev,e,e.next)>0&&cP(t.prev,t,t.next)>0)}function cP(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function lP(e,t){return e.x===t.x&&e.y===t.y}function uP(e,t,n,r){let i=fP(cP(e,t,n)),a=fP(cP(e,t,r)),o=fP(cP(n,r,e)),s=fP(cP(n,r,t));return!!(i!==a&&o!==s||i===0&&dP(e,n,t)||a===0&&dP(e,r,t)||o===0&&dP(n,e,r)||s===0&&dP(n,t,r))}function dP(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function fP(e){return e>0?1:e<0?-1:0}function pP(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&uP(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function mP(e,t){return cP(e.prev,e,e.next)<0?cP(e,t,e.next)>=0&&cP(e,e.prev,t)>=0:cP(e,t,e.prev)<0||cP(e,e.next,t)<0}function hP(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function gP(e,t){let n=new vP(e.i,e.x,e.y),r=new vP(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function _P(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}var vP=class{constructor(e,t,n){this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1,this.i=e,this.x=t,this.y=n}};function yP(e,t){let n=t.length,r=e.length;if(r>0){let i=!0;for(let a=0;at[2]&&(n|=2),e[1]t[3]&&(n|=8),n}function wP(e,t){let{size:n=2,broken:r=!1,gridResolution:i=10,gridOffset:a=[0,0],startIndex:o=0,endIndex:s=e.length}=t||{},c=(s-o)/n,l=[],u=[l],d=xP(e,0,n,o),f,p,m=kP(d,i,a,[]),h=[];yP(l,d);for(let t=1;tn&&(l=[],u.push(l),yP(l,d)),p=CP(f,m)}yP(l,f),bP(d,f)}return r?u:u[0]}var TP=0,EP=1;function DP(e,t=null,n){if(!e.length)return[];let{size:r=2,gridResolution:i=10,gridOffset:a=[0,0],edgeTypes:o=!1}=n||{},s=[],c=[{pos:e,types:o?Array(e.length/r).fill(EP):null,holes:t||[]}],l=[[],[]],u=[];for(;c.length;){let{pos:e,types:t,holes:n}=c.shift();jP(e,r,n[0]||e.length,l),u=kP(l[0],i,a,u);let d=CP(l[1],u);if(d){let i=OP(e,t,r,0,n[0]||e.length,u,d),a={pos:i[0].pos,types:i[0].types,holes:[]},s={pos:i[1].pos,types:i[1].types,holes:[]};c.push(a,s);for(let c=0;c=0?(yP(l,p)&&d.push(h),b+=m):d.length&&(d[d.length-1]=TP),bP(g,p),_=m,v=h;return[y?{pos:c,types:t&&u}:null,b?{pos:l,types:t&&d}:null]}function kP(e,t,n,r){let i=Math.floor((e[0]-n[0])/t)*t+n[0],a=Math.floor((e[1]-n[1])/t)*t+n[1];return r[0]=i,r[1]=a,r[2]=i+t,r[3]=a+t,r}function AP(e,t,n){n&8?(e[1]+=t,e[3]+=t):n&4?(e[1]-=t,e[3]-=t):n&2?(e[0]+=t,e[2]+=t):n&1&&(e[0]-=t,e[2]-=t)}function jP(e,t,n,r){let i=1/0,a=-1/0,o=1/0,s=-1/0;for(let r=0;ra?t:a,o=ns?n:s}return r[0][0]=i,r[0][1]=o,r[1][0]=a,r[1][1]=s,r}function MP(e,t){for(let n=0;ni&&(i=t,a=o-1)}return a}function LP(e,t,n,r,i=NP){let a=e[n],o=e[r-t];if(Math.abs(a-o)>180){let r=xP(e,0,t,n);r[0]+=Math.round((o-a)/360)*360,yP(e,r),r[1]=Math.sign(r[1])*i,yP(e,r),r[0]=a,yP(e,r)}}function RP(e,t,n,r){let i=e[0],a;for(let o=n;o180||t<-180)&&(a-=Math.round(t/360)*360),e[o]=i=a}}function zP(e,t){let n,r=e.length/t;for(let i=0;i=r),i=i.flatMap(e=>[e[0],e[1]]),KN(i,GN.COUNTER_CLOCKWISE));let a=n>0,o=r+1,s=a?o*3+1:r,c=Math.PI*2/r,l=new Uint16Array(a?r*3*2:0),u=new Float32Array(s*3),d=new Float32Array(s*3),f=0;if(a){for(let e=0;e`,extruded:`f32`,stroked:`f32`,isStroke:`f32`,coverage:`f32`,elevationScale:`f32`,edgeDistance:`f32`,widthScale:`f32`,widthMinPixels:`f32`,widthMaxPixels:`f32`,radiusUnits:`i32`,widthUnits:`i32`}},WP=`#version 300 es +#define SHADER_NAME column-layer-vertex-shader +in vec3 positions; +in vec3 normals; +in vec3 instancePositions; +in float instanceElevations; +in vec3 instancePositions64Low; +in vec4 instanceFillColors; +in vec4 instanceLineColors; +in float instanceStrokeWidths; +in vec3 instancePickingColors; +out vec4 vColor; +#ifdef FLAT_SHADING +out vec3 cameraPosition; +out vec4 position_commonspace; +#endif +void main(void) { +geometry.worldPosition = instancePositions; +vec4 color = column.isStroke ? instanceLineColors : instanceFillColors; +mat2 rotationMatrix = mat2(cos(column.angle), sin(column.angle), -sin(column.angle), cos(column.angle)); +float elevation = 0.0; +float strokeOffsetRatio = 1.0; +if (column.extruded) { +elevation = instanceElevations * (positions.z + 1.0) / 2.0 * column.elevationScale; +} else if (column.stroked) { +float widthPixels = clamp( +project_size_to_pixel(instanceStrokeWidths * column.widthScale, column.widthUnits), +column.widthMinPixels, column.widthMaxPixels) / 2.0; +float halfOffset = project_pixel_size(widthPixels) / project_size(column.edgeDistance * column.coverage * column.radius); +if (column.isStroke) { +strokeOffsetRatio -= sign(positions.z) * halfOffset; +} else { +strokeOffsetRatio -= halfOffset; +} +} +float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0); +float dotRadius = column.radius * column.coverage * shouldRender; +geometry.pickingColor = instancePickingColors; +vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation); +vec3 centroidPosition64Low = instancePositions64Low; +vec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + column.offset) * dotRadius; +if (column.radiusUnits == UNIT_METERS) { +offset = project_size(offset); +} else if (column.radiusUnits == UNIT_PIXELS) { +offset = project_pixel_size(offset); +} +vec3 pos = vec3(offset, 0.); +DECKGL_FILTER_SIZE(pos, geometry); +gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position); +geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z)); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +if (column.extruded && !column.isStroke) { +#ifdef FLAT_SHADING +cameraPosition = project.cameraPosition; +position_commonspace = geometry.position; +vColor = vec4(color.rgb, color.a * layer.opacity); +#else +vec3 lightColor = lighting_getLightColor(color.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal); +vColor = vec4(lightColor, color.a * layer.opacity); +#endif +} else { +vColor = vec4(color.rgb, color.a * layer.opacity); +} +DECKGL_FILTER_COLOR(vColor, geometry); +} +`,GP=`#version 300 es +#define SHADER_NAME column-layer-fragment-shader +precision highp float; +out vec4 fragColor; +in vec4 vColor; +#ifdef FLAT_SHADING +in vec3 cameraPosition; +in vec4 position_commonspace; +#endif +void main(void) { +fragColor = vColor; +geometry.uv = vec2(0.); +#ifdef FLAT_SHADING +if (column.extruded && !column.isStroke && !bool(picking.isActive)) { +vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz))); +fragColor.rgb = lighting_getLightColor(vColor.rgb, cameraPosition, position_commonspace.xyz, normal); +} +#endif +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,KP=[0,0,0,255],qP={diskResolution:{type:`number`,min:4,value:20},vertices:null,radius:{type:`number`,min:0,value:1e3},angle:{type:`number`,value:0},offset:{type:`array`,value:[0,0]},coverage:{type:`number`,min:0,max:1,value:1},elevationScale:{type:`number`,min:0,value:1},radiusUnits:`meters`,lineWidthUnits:`meters`,lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:2**53-1,extruded:!0,wireframe:!1,filled:!0,stroked:!1,flatShading:!1,getPosition:{type:`accessor`,value:e=>e.position},getFillColor:{type:`accessor`,value:KP},getLineColor:{type:`accessor`,value:KP},getLineWidth:{type:`accessor`,value:1},getElevation:{type:`accessor`,value:1e3},material:!0,getColor:{deprecatedFor:[`getFillColor`,`getLineColor`]}},JP=class extends dx{getShaders(){let e={},{flatShading:t}=this.props;return t&&(e.FLAT_SHADING=1),super.getShaders({vs:WP,fs:GP,defines:e,modules:[Bp,t?Ld:Id,jm,UP]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:`float64`,fp64:this.use64bitPositions(),transition:!0,accessor:`getPosition`},instanceElevations:{size:1,transition:!0,accessor:`getElevation`},instanceFillColors:{size:this.props.colorFormat.length,type:`unorm8`,transition:!0,accessor:`getFillColor`,defaultValue:KP},instanceLineColors:{size:this.props.colorFormat.length,type:`unorm8`,transition:!0,accessor:`getLineColor`,defaultValue:KP},instanceStrokeWidths:{size:1,accessor:`getLineWidth`,transition:!0}})}updateState(e){super.updateState(e);let{props:t,oldProps:n,changeFlags:r}=e,i=r.extensionsChanged||t.flatShading!==n.flatShading;i&&(this.state.models?.forEach(e=>e.destroy()),this.setState(this._getModels()),this.getAttributeManager().invalidateAll());let a=this.getNumInstances();this.state.fillModel.setInstanceCount(a),this.state.wireframeModel.setInstanceCount(a),(i||t.diskResolution!==n.diskResolution||t.vertices!==n.vertices||(t.extruded||t.stroked)!==(n.extruded||n.stroked))&&this._updateGeometry(t)}getGeometry(e,t,n){let r=new BP({radius:1,height:n?2:0,vertices:t,nradial:e}),i=0;if(t)for(let n=0;n=e.length&&(t+=1-e.length/r);let i=t*r;return n[0]=e[i],n[1]=e[i+1],n[2]=r===3&&e[i+2]||0,n}isClosed(e){if(!this.normalize)return!!this.opts.loop;let{positionSize:t}=this,n=e.length-t;return e[0]===e[n]&&e[1]===e[n+1]&&(t===2||e[2]===e[n+2])}};function nF(e){return Array.isArray(e[0])}var rF=`layout(std140) uniform pathUniforms { + float widthScale; + float widthMinPixels; + float widthMaxPixels; + float jointType; + float capType; + float miterLimit; + bool billboard; + highp int widthUnits; +} path; +`,iF={name:`path`,vs:rF,fs:rF,uniformTypes:{widthScale:`f32`,widthMinPixels:`f32`,widthMaxPixels:`f32`,jointType:`f32`,capType:`f32`,miterLimit:`f32`,billboard:`f32`,widthUnits:`i32`}},aF=`#version 300 es +#define SHADER_NAME path-layer-vertex-shader +in vec2 positions; +in float instanceTypes; +in vec3 instanceStartPositions; +in vec3 instanceEndPositions; +in vec3 instanceLeftPositions; +in vec3 instanceRightPositions; +in vec3 instanceLeftPositions64Low; +in vec3 instanceStartPositions64Low; +in vec3 instanceEndPositions64Low; +in vec3 instanceRightPositions64Low; +in float instanceStrokeWidths; +in vec4 instanceColors; +in vec3 instancePickingColors; +uniform float opacity; +out vec4 vColor; +out vec2 vCornerOffset; +out float vMiterLength; +out vec2 vPathPosition; +out float vPathLength; +out float vJointType; +const float EPSILON = 0.001; +const vec3 ZERO_OFFSET = vec3(0.0); +float flipIfTrue(bool flag) { +return -(float(flag) * 2. - 1.); +} +vec3 getLineJoinOffset( +vec3 prevPoint, vec3 currPoint, vec3 nextPoint, +vec2 width +) { +bool isEnd = positions.x > 0.0; +float sideOfPath = positions.y; +float isJoint = float(sideOfPath == 0.0); +vec3 deltaA3 = (currPoint - prevPoint); +vec3 deltaB3 = (nextPoint - currPoint); +mat3 rotationMatrix; +bool needsRotation = !path.billboard && project_needs_rotation(currPoint, rotationMatrix); +if (needsRotation) { +deltaA3 = deltaA3 * rotationMatrix; +deltaB3 = deltaB3 * rotationMatrix; +} +vec2 deltaA = deltaA3.xy / width; +vec2 deltaB = deltaB3.xy / width; +float lenA = length(deltaA); +float lenB = length(deltaB); +vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0); +vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0); +vec2 perpA = vec2(-dirA.y, dirA.x); +vec2 perpB = vec2(-dirB.y, dirB.x); +vec2 tangent = dirA + dirB; +tangent = length(tangent) > 0. ? normalize(tangent) : perpA; +vec2 miterVec = vec2(-tangent.y, tangent.x); +vec2 dir = isEnd ? dirA : dirB; +vec2 perp = isEnd ? perpA : perpB; +float L = isEnd ? lenA : lenB; +float sinHalfA = abs(dot(miterVec, perp)); +float cosHalfA = abs(dot(dirA, miterVec)); +float turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x); +float cornerPosition = sideOfPath * turnDirection; +float miterSize = 1.0 / max(sinHalfA, EPSILON); +miterSize = mix( +min(miterSize, max(lenA, lenB) / max(cosHalfA, EPSILON)), +miterSize, +step(0.0, cornerPosition) +); +vec2 offsetVec = mix(miterVec * miterSize, perp, step(0.5, cornerPosition)) +* (sideOfPath + isJoint * turnDirection); +bool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0)); +bool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0)); +bool isCap = isStartCap || isEndCap; +if (isCap) { +offsetVec = mix(perp * sideOfPath, dir * path.capType * 4.0 * flipIfTrue(isStartCap), isJoint); +vJointType = path.capType; +} else { +vJointType = path.jointType; +} +vPathLength = L; +vCornerOffset = offsetVec; +vMiterLength = dot(vCornerOffset, miterVec * turnDirection); +vMiterLength = isCap ? isJoint : vMiterLength; +vec2 offsetFromStartOfPath = vCornerOffset + deltaA * float(isEnd); +vPathPosition = vec2( +dot(offsetFromStartOfPath, perp), +dot(offsetFromStartOfPath, dir) +); +geometry.uv = vPathPosition; +float isValid = step(instanceTypes, 3.5); +vec3 offset = vec3(offsetVec * width * isValid, 0.0); +if (needsRotation) { +offset = rotationMatrix * offset; +} +return offset; +} +void clipLine(inout vec4 position, vec4 refPosition) { +if (position.w < EPSILON) { +float r = (EPSILON - refPosition.w) / (position.w - refPosition.w); +position = refPosition + (position - refPosition) * r; +} +} +void main() { +geometry.pickingColor = instancePickingColors; +vColor = vec4(instanceColors.rgb, instanceColors.a * layer.opacity); +float isEnd = positions.x; +vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd); +vec3 prevPosition64Low = mix(instanceLeftPositions64Low, instanceStartPositions64Low, isEnd); +vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd); +vec3 currPosition64Low = mix(instanceStartPositions64Low, instanceEndPositions64Low, isEnd); +vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd); +vec3 nextPosition64Low = mix(instanceEndPositions64Low, instanceRightPositions64Low, isEnd); +geometry.worldPosition = currPosition; +vec2 widthPixels = vec2(clamp( +project_size_to_pixel(instanceStrokeWidths * path.widthScale, path.widthUnits), +path.widthMinPixels, path.widthMaxPixels) / 2.0); +vec3 width; +if (path.billboard) { +vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64Low, ZERO_OFFSET); +vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64Low, ZERO_OFFSET, geometry.position); +vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64Low, ZERO_OFFSET); +clipLine(prevPositionScreen, currPositionScreen); +clipLine(nextPositionScreen, currPositionScreen); +clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd)); +width = vec3(widthPixels, 0.0); +DECKGL_FILTER_SIZE(width, geometry); +vec3 offset = getLineJoinOffset( +prevPositionScreen.xyz / prevPositionScreen.w, +currPositionScreen.xyz / currPositionScreen.w, +nextPositionScreen.xyz / nextPositionScreen.w, +project_pixel_size_to_clipspace(width.xy) +); +DECKGL_FILTER_GL_POSITION(currPositionScreen, geometry); +gl_Position = vec4(currPositionScreen.xyz + offset * currPositionScreen.w, currPositionScreen.w); +} else { +prevPosition = project_position(prevPosition, prevPosition64Low); +currPosition = project_position(currPosition, currPosition64Low); +nextPosition = project_position(nextPosition, nextPosition64Low); +width = vec3(project_pixel_size(widthPixels), 0.0); +DECKGL_FILTER_SIZE(width, geometry); +vec3 offset = getLineJoinOffset(prevPosition, currPosition, nextPosition, width.xy); +geometry.position = vec4(currPosition + offset, 1.0); +gl_Position = project_common_position_to_clipspace(geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +} +DECKGL_FILTER_COLOR(vColor, geometry); +} +`,oF=`#version 300 es +#define SHADER_NAME path-layer-fragment-shader +precision highp float; +in vec4 vColor; +in vec2 vCornerOffset; +in float vMiterLength; +in vec2 vPathPosition; +in float vPathLength; +in float vJointType; +out vec4 fragColor; +void main(void) { +geometry.uv = vPathPosition; +if (vPathPosition.y < 0.0 || vPathPosition.y > vPathLength) { +if (vJointType > 0.5 && length(vCornerOffset) > 1.0) { +discard; +} +if (vJointType < 0.5 && vMiterLength > path.miterLimit + 1.0) { +discard; +} +} +fragColor = vColor; +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,sF=[0,0,0,255],cF={widthUnits:`meters`,widthScale:{type:`number`,min:0,value:1},widthMinPixels:{type:`number`,min:0,value:0},widthMaxPixels:{type:`number`,min:0,value:2**53-1},jointRounded:!1,capRounded:!1,miterLimit:{type:`number`,min:0,value:4},billboard:!1,_pathType:null,getPath:{type:`accessor`,value:e=>e.path},getColor:{type:`accessor`,value:sF},getWidth:{type:`accessor`,value:1},rounded:{deprecatedFor:[`jointRounded`,`capRounded`]}},lF={enter:(e,t)=>t.length?t.subarray(t.length-e.length):e},uF=class extends dx{getShaders(){return super.getShaders({vs:aF,fs:oF,modules:[Bp,jm,iF]})}get wrapLongitude(){return!1}getBounds(){return this.getAttributeManager()?.getBounds([`vertexPositions`])}initializeState(){this.getAttributeManager().addInstanced({vertexPositions:{size:3,vertexOffset:1,type:`float64`,fp64:this.use64bitPositions(),transition:lF,accessor:`getPath`,update:this.calculatePositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{vertexOffset:0},instanceStartPositions:{vertexOffset:1},instanceEndPositions:{vertexOffset:2},instanceRightPositions:{vertexOffset:3}}},instanceTypes:{size:1,type:`uint8`,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:`getWidth`,transition:lF,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:`unorm8`,accessor:`getColor`,transition:lF,defaultValue:sF},instancePickingColors:{size:4,type:`uint8`,accessor:(e,{index:t,target:n})=>this.encodePickingColor(e&&e.__source?e.__source.index:t,n)}}),this.setState({pathTesselator:new tF({fp64:this.use64bitPositions()})})}updateState(e){super.updateState(e);let{props:t,changeFlags:n}=e,r=this.getAttributeManager();if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPath)){let{pathTesselator:e}=this.state,i=t.data.attributes||{};e.updateGeometry({data:t.data,geometryBuffer:i.getPath,buffers:i,normalize:!t._pathType,loop:t._pathType===`loop`,getGeometry:t.getPath,positionFormat:t.positionFormat,wrapLongitude:t.wrapLongitude,resolution:this.context.viewport.resolution,dataChanged:n.dataChanged}),this.setState({numInstances:e.instanceCount,startIndices:e.vertexStarts}),n.dataChanged||r.invalidateAll()}n.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),r.invalidateAll())}getPickingInfo(e){let t=super.getPickingInfo(e),{index:n}=t,r=this.props.data;return r[0]&&r[0].__source&&(t.object=r.find(e=>e.__source.index===n)),t}disablePickingIndex(e){let t=this.props.data;if(t[0]&&t[0].__source)for(let n=0;n{t.exports=n,t.exports.default=n;function n(e,t,n){n||=2;var i=t&&t.length,o=i?t[0]*n:e.length,s=r(e,0,o,n,!0),c=[];if(!s||s.next===s.prev)return c;var l,d,f,p,m,h,g;if(i&&(s=u(e,t,s,n)),e.length>80*n){l=f=e[0],d=p=e[1];for(var _=n;_f&&(f=m),h>p&&(p=h);g=Math.max(f-l,p-d),g=g===0?0:32767/g}return a(s,c,n,l,d,g,0),c}function r(e,t,n,r,i){var a,o;if(i===N(e,t,n,r)>0)for(a=t;a=t;a-=r)o=A(a,e[a],e[a+1],o);return o&&S(o,o.next)&&(j(o),o=o.next),o}function i(e,t){if(!e)return e;t||=e;var n=e,r;do if(r=!1,!n.steiner&&(S(n,n.next)||x(n.prev,n,n.next)===0)){if(j(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function a(e,t,n,r,u,d,f){if(e){!f&&d&&h(e,r,u,d);for(var p=e,m,g;e.prev!==e.next;){if(m=e.prev,g=e.next,d?s(e,r,u,d):o(e)){t.push(m.i/n|0),t.push(e.i/n|0),t.push(g.i/n|0),j(e),e=g.next,p=g.next;continue}if(e=g,e===p){f?f===1?(e=c(i(e),t,n),a(e,t,n,r,u,d,2)):f===2&&l(e,t,n,r,u,d):a(i(e),t,n,r,u,d,1);break}}}}function o(e){var t=e.prev,n=e,r=e.next;if(x(t,n,r)>=0)return!1;for(var i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=ia?i>o?i:o:a>o?a:o,p=s>c?s>l?s:l:c>l?c:l,m=r.next;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&y(i,s,a,c,o,l,m.x,m.y)&&x(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function s(e,t,n,r){var i=e.prev,a=e,o=e.next;if(x(i,a,o)>=0)return!1;for(var s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=sc?s>l?s:l:c>l?c:l,g=u>d?u>f?u:f:d>f?d:f,v=_(p,m,t,n,r),b=_(h,g,t,n,r),S=e.prevZ,C=e.nextZ;S&&S.z>=v&&C&&C.z<=b;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0||(S=S.prevZ,C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;S&&S.z>=v;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;C&&C.z<=b;){if(C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function c(e,t,n){var r=e;do{var a=r.prev,o=r.next.next;!S(a,o)&&C(a,r,r.next,o)&&D(a,o)&&D(o,a)&&(t.push(a.i/n|0),t.push(r.i/n|0),t.push(o.i/n|0),j(r),j(r.next),r=e=o),r=r.next}while(r!==e);return i(r)}function l(e,t,n,r,o,s){var c=e;do{for(var l=c.next.next;l!==c.prev;){if(c.i!==l.i&&b(c,l)){var u=k(c,l);c=i(c,c.next),u=i(u,u.next),a(c,t,n,r,o,s,0),a(u,t,n,r,o,s,0);return}l=l.next}c=c.next}while(c!==e)}function u(e,t,n,i){var a=[],o,s,c,l,u;for(o=0,s=t.length;o=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a&&(a=s,o=n.x=n.x&&n.x>=l&&r!==n.x&&y(io.x||n.x===o.x&&m(o,n)))&&(o=n,d=f)),n=n.next;while(n!==c);return o}function m(e,t){return x(e.prev,e,t.prev)<0&&x(t.next,e,e.next)<0}function h(e,t,n,r){var i=e;do i.z===0&&(i.z=_(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return e}function _(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function v(e){var t=e,n=e;do(t.x=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function b(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!E(e,t)&&(D(e,t)&&D(t,e)&&O(e,t)&&(x(e.prev,e,t.prev)||x(e,t.prev,t))||S(e,t)&&x(e.prev,e,e.next)>0&&x(t.prev,t,t.next)>0)}function x(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,n,r){var i=T(x(e,t,n)),a=T(x(e,t,r)),o=T(x(n,r,e)),s=T(x(n,r,t));return!!(i!==a&&o!==s||i===0&&w(e,n,t)||a===0&&w(e,r,t)||o===0&&w(n,e,r)||s===0&&w(n,t,r))}function w(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function T(e){return e>0?1:e<0?-1:0}function E(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&C(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function D(e,t){return x(e.prev,e,e.next)<0?x(e,t,e.next)>=0&&x(e,e.prev,t)>=0:x(e,t,e.prev)<0||x(e,e.next,t)<0}function O(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function k(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function A(e,t,n,r){var i=new M(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function j(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}n.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(N(e,0,a,n));if(i)for(var s=0,c=t.length;s0&&(r+=e[i-1].length,n.holes.push(r))}return n}}))(),1),fF=GN.CLOCKWISE,pF=GN.COUNTER_CLOCKWISE,mF={isClosed:!0};function hF(e){if(e=e&&e.positions||e,!Array.isArray(e)&&!ArrayBuffer.isView(e))throw Error(`invalid polygon`)}function gF(e){return`positions`in e?e.positions:e}function _F(e){return`holeIndices`in e?e.holeIndices:null}function vF(e){return Array.isArray(e[0])}function yF(e){return e.length>=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function bF(e){let t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function xF(e,t,n,r){for(let i=0;ie/t);let a=gF(e),o=r&&t===3;if(n){let e=a.length;a=a.slice();let r=[];for(let i=0;it&&e>r||(t>r?(n||(a=a.slice()),EF(a,0,2,1)):(n||(a=a.slice()),EF(a,2,0,1)))}return(0,dF.default)(a,i,t)}var OF=class extends mx{constructor(e){let{fp64:t,IndexType:n=Uint32Array}=e;super({...e,attributes:{positions:{size:3,type:t?Float64Array:Float32Array},vertexValid:{type:Uint16Array,size:1},indices:{type:n,size:1}}})}get(e){let{attributes:t}=this;return e===`indices`?t.indices&&t.indices.subarray(0,this.vertexCount):t[e]}updateGeometry(e){super.updateGeometry(e);let t=this.buffers.indices;if(t)this.vertexCount=(t.value||t).length;else if(this.data&&!this.getGeometry)throw Error(`missing indices buffer`)}normalizeGeometry(e){if(this.normalize){let t=wF(e,this.positionSize);return this.opts.resolution?DP(gF(t),_F(t),{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0}):this.opts.wrapLongitude?FP(gF(t),_F(t),{size:this.positionSize,maxLatitude:86,edgeTypes:!0}):t}return e}getGeometrySize(e){if(kF(e)){let t=0;for(let n of e)t+=this.getGeometrySize(n);return t}return gF(e).length/this.positionSize}getGeometryFromBuffer(e){return this.normalize||!this.buffers.indices?super.getGeometryFromBuffer(e):null}updateGeometryAttributes(e,t){if(e&&kF(e))for(let n of e){let e=this.getGeometrySize(n);t.geometrySize=e,this.updateGeometryAttributes(n,t),t.vertexStart+=e,t.indexStart=this.indexStarts[t.geometryIndex+1]}else{let n=e;this._updateIndices(n,t),this._updatePositions(n,t),this._updateVertexValid(n,t)}}_updateIndices(e,{geometryIndex:t,vertexStart:n,indexStart:r}){let{attributes:i,indexStarts:a,typedArrayManager:o}=this,s=i.indices;if(!s||!e)return;let c=r,l=DF(e,this.positionSize,this.opts.preproject,this.opts.full3d);s=o.allocate(s,r+l.length,{copy:!0});for(let e=0;e2?a[o*i+2]:0;r[e*3]=t,r[e*3+1]=n,r[e*3+2]=s}}_updateVertexValid(e,{vertexStart:t,geometrySize:n}){let{positionSize:r}=this,i=this.attributes.vertexValid,a=e&&_F(e);if(e&&e.edgeTypes?i.set(e.edgeTypes,t):i.fill(1,t,t+n),a)for(let e=0;e0&&!Number.isFinite(e[0])}var AF=`layout(std140) uniform solidPolygonUniforms { + bool extruded; + bool isWireframe; + float elevationScale; +} solidPolygon; +`,jF={name:`solidPolygon`,vs:AF,fs:AF,uniformTypes:{extruded:`f32`,isWireframe:`f32`,elevationScale:`f32`}},MF=`in vec4 fillColors; +in vec4 lineColors; +in vec3 pickingColors; +out vec4 vColor; +struct PolygonProps { +vec3 positions; +vec3 positions64Low; +vec3 normal; +float elevations; +}; +vec3 project_offset_normal(vec3 vector) { +if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT || +project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) { +return normalize(vector * project.commonUnitsPerWorldUnit); +} +return project_normal(vector); +} +void calculatePosition(PolygonProps props) { +vec3 pos = props.positions; +vec3 pos64Low = props.positions64Low; +vec3 normal = props.normal; +vec4 colors = solidPolygon.isWireframe ? lineColors : fillColors; +geometry.worldPosition = props.positions; +geometry.pickingColor = pickingColors; +if (solidPolygon.extruded) { +pos.z += props.elevations * solidPolygon.elevationScale; +} +gl_Position = project_position_to_clipspace(pos, pos64Low, vec3(0.), geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +if (solidPolygon.extruded) { +#ifdef IS_SIDE_VERTEX +normal = project_offset_normal(normal); +#else +normal = project_normal(normal); +#endif +geometry.normal = normal; +vec3 lightColor = lighting_getLightColor(colors.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal); +vColor = vec4(lightColor, colors.a * layer.opacity); +} else { +vColor = vec4(colors.rgb, colors.a * layer.opacity); +} +DECKGL_FILTER_COLOR(vColor, geometry); +} +`,NF=`\ +#version 300 es +#define SHADER_NAME solid-polygon-layer-vertex-shader +in vec3 vertexPositions; +in vec3 vertexPositions64Low; +in float elevations; +${MF} +void main(void) { +PolygonProps props; +props.positions = vertexPositions; +props.positions64Low = vertexPositions64Low; +props.elevations = elevations; +props.normal = vec3(0.0, 0.0, 1.0); +calculatePosition(props); +} +`,PF=`\ +#version 300 es +#define SHADER_NAME solid-polygon-layer-vertex-shader-side +#define IS_SIDE_VERTEX +in vec2 positions; +in vec3 vertexPositions; +in vec3 nextVertexPositions; +in vec3 vertexPositions64Low; +in vec3 nextVertexPositions64Low; +in float elevations; +in float instanceVertexValid; +${MF} +void main(void) { +if(instanceVertexValid < 0.5){ +gl_Position = vec4(0.); +return; +} +PolygonProps props; +vec3 pos; +vec3 pos64Low; +vec3 nextPos; +vec3 nextPos64Low; +#if RING_WINDING_ORDER_CW == 1 +pos = vertexPositions; +pos64Low = vertexPositions64Low; +nextPos = nextVertexPositions; +nextPos64Low = nextVertexPositions64Low; +#else +pos = nextVertexPositions; +pos64Low = nextVertexPositions64Low; +nextPos = vertexPositions; +nextPos64Low = vertexPositions64Low; +#endif +props.positions = mix(pos, nextPos, positions.x); +props.positions64Low = mix(pos64Low, nextPos64Low, positions.x); +props.normal = vec3( +pos.y - nextPos.y + (pos64Low.y - nextPos64Low.y), +nextPos.x - pos.x + (nextPos64Low.x - pos64Low.x), +0.0); +props.elevations = elevations * positions.y; +calculatePosition(props); +} +`,FF=`#version 300 es +#define SHADER_NAME solid-polygon-layer-fragment-shader +precision highp float; +in vec4 vColor; +out vec4 fragColor; +void main(void) { +fragColor = vColor; +geometry.uv = vec2(0.); +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,IF=[0,0,0,255],LF={filled:!0,extruded:!1,wireframe:!1,_normalize:!0,_windingOrder:`CW`,_full3d:!1,elevationScale:{type:`number`,min:0,value:1},getPolygon:{type:`accessor`,value:e=>e.polygon},getElevation:{type:`accessor`,value:1e3},getFillColor:{type:`accessor`,value:IF},getLineColor:{type:`accessor`,value:IF},material:!0},RF={enter:(e,t)=>t.length?t.subarray(t.length-e.length):e},zF=class extends dx{getShaders(e){return super.getShaders({vs:e===`top`?NF:PF,fs:FF,defines:{RING_WINDING_ORDER_CW:!this.props._normalize&&this.props._windingOrder===`CCW`?0:1},modules:[Bp,Id,jm,jF]})}get wrapLongitude(){return!1}getBounds(){return this.getAttributeManager()?.getBounds([`vertexPositions`])}initializeState(){let{viewport:e}=this.context,{coordinateSystem:t}=this.props,{_full3d:n}=this.props;e.isGeospatial&&t==="default"&&(t=`lnglat`);let r;t===`lnglat`&&(r=n?e.projectPosition.bind(e):e.projectFlat.bind(e)),this.setState({numInstances:0,polygonTesselator:new OF({preproject:r,fp64:this.use64bitPositions(),IndexType:Uint32Array})});let i=this.getAttributeManager();i.remove([`instancePickingColors`]),i.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:!0},vertexPositions:{size:3,type:`float64`,stepMode:`dynamic`,fp64:this.use64bitPositions(),transition:RF,accessor:`getPolygon`,update:this.calculatePositions,noAlloc:!0,shaderAttributes:{nextVertexPositions:{vertexOffset:1}}},instanceVertexValid:{size:1,type:`uint16`,stepMode:`instance`,update:this.calculateVertexValid,noAlloc:!0},elevations:{size:1,stepMode:`dynamic`,transition:RF,accessor:`getElevation`},fillColors:{size:this.props.colorFormat.length,type:`unorm8`,stepMode:`dynamic`,transition:RF,accessor:`getFillColor`,defaultValue:IF},lineColors:{size:this.props.colorFormat.length,type:`unorm8`,stepMode:`dynamic`,transition:RF,accessor:`getLineColor`,defaultValue:IF},pickingColors:{size:4,type:`uint8`,stepMode:`dynamic`,accessor:(e,{index:t,target:n})=>this.encodePickingColor(e&&e.__source?e.__source.index:t,n)}})}getPickingInfo(e){let t=super.getPickingInfo(e),{index:n}=t,r=this.props.data;return r[0]&&r[0].__source&&(t.object=r.find(e=>e.__source.index===n)),t}disablePickingIndex(e){let t=this.props.data;if(t[0]&&t[0].__source)for(let n=0;ne.destroy()),this.setState(this._getModels()),i.invalidateAll())}updateGeometry({props:e,oldProps:t,changeFlags:n}){if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon)){let{polygonTesselator:t}=this.state,r=e.data.attributes||{};t.updateGeometry({data:e.data,normalize:e._normalize,geometryBuffer:r.getPolygon,buffers:r,getGeometry:e.getPolygon,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,fp64:this.use64bitPositions(),dataChanged:n.dataChanged,full3d:e._full3d}),this.setState({numInstances:t.instanceCount,startIndices:t.vertexStarts}),n.dataChanged||this.getAttributeManager().invalidateAll()}}_getModels(){let{id:e,filled:t,extruded:n}=this.props,r,i,a;if(t){let t=this.getShaders(`top`);t.defines.NON_INSTANCED_MODEL=1;let n=this.getAttributeManager().getBufferLayouts({isInstanced:!1});r=new Rg(this.context.device,{...t,id:`${e}-top`,topology:`triangle-list`,bufferLayout:n,isIndexed:!0,userData:{excludeAttributes:{instanceVertexValid:!0}}})}if(n){let t=this.getAttributeManager().getBufferLayouts({isInstanced:!0});i=new Rg(this.context.device,{...this.getShaders(`side`),id:`${e}-side`,bufferLayout:t,geometry:new Jg({topology:`triangle-strip`,attributes:{positions:{size:2,value:new Float32Array([1,0,0,0,1,1,0,1])}}}),isInstanced:!0,userData:{excludeAttributes:{indices:!0}}}),a=new Rg(this.context.device,{...this.getShaders(`side`),id:`${e}-wireframe`,bufferLayout:t,geometry:new Jg({topology:`line-strip`,attributes:{positions:{size:2,value:new Float32Array([1,0,0,0,0,1,1,1])}}}),isInstanced:!0,userData:{excludeAttributes:{indices:!0}}})}return{models:[i,a,r].filter(Boolean),topModel:r,sideModel:i,wireframeModel:a}}calculateIndices(e){let{polygonTesselator:t}=this.state;e.startIndices=t.indexStarts,e.value=t.get(`indices`)}calculatePositions(e){let{polygonTesselator:t}=this.state;e.startIndices=t.vertexStarts,e.value=t.get(`positions`)}calculateVertexValid(e){e.value=this.state.polygonTesselator.get(`vertexValid`)}};zF.defaultProps=LF,zF.layerName=`SolidPolygonLayer`;function BF({data:e,getIndex:t,dataRange:n,replace:r}){let{startRow:i=0,endRow:a=1/0}=n,o=e.length,s=o,c=o;for(let n=0;nn&&r>=i&&(s=n),r>=a){c=n;break}}let l=s,u=c-s===r.length?void 0:e.slice(c);for(let t=0;te.polygon},getFillColor:{type:`accessor`,value:[0,0,0,255]},getLineColor:{type:`accessor`,value:VF},getLineWidth:{type:`accessor`,value:1},getElevation:{type:`accessor`,value:1e3},material:!0},UF=class extends fx{initializeState(){this.state={paths:[],pathsDiff:null},this.props.getLineDashArray&&fo.removed(`getLineDashArray`,`PathStyleExtension`)()}updateState({changeFlags:e}){let t=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getPolygon);if(t&&Array.isArray(e.dataChanged)){let t=this.state.paths.slice(),n=e.dataChanged.map(e=>BF({data:t,getIndex:e=>e.__source.index,dataRange:e,replace:this._getPaths(e)}));this.setState({paths:t,pathsDiff:n})}else t&&this.setState({paths:this._getPaths(),pathsDiff:null})}_getPaths(e={}){let{data:t,getPolygon:n,positionFormat:r,_normalize:i}=this.props,a=[],o=r===`XY`?2:3,{startRow:s,endRow:c}=e,{iterable:l,objectInfo:u}=Ty(t,s,c);for(let e of l){u.index++;let t=n(e,u);i&&(t=wF(t,o));let{holeIndices:r}=t,s=t.positions||t;if(r)for(let t=0;t<=r.length;t++){let n=s.slice(r[t-1]||0,r[t]||s.length);a.push(this.getSubLayerRow({path:n},e,u.index))}else a.push(this.getSubLayerRow({path:s},e,u.index))}return a}renderLayers(){let{data:e,_dataDiff:t,stroked:n,filled:r,extruded:i,wireframe:a,_normalize:o,_windingOrder:s,elevationScale:c,transitions:l,positionFormat:u}=this.props,{lineWidthUnits:d,lineWidthScale:f,lineWidthMinPixels:p,lineWidthMaxPixels:m,lineJointRounded:h,lineMiterLimit:g,lineDashJustified:_}=this.props,{getFillColor:v,getLineColor:y,getLineWidth:b,getLineDashArray:x,getElevation:S,getPolygon:C,updateTriggers:w,material:T}=this.props,{paths:E,pathsDiff:D}=this.state,O=this.getSubLayerClass(`fill`,zF),k=this.getSubLayerClass(`stroke`,uF),A=this.shouldRenderSubLayer(`fill`,E)&&new O({_dataDiff:t,extruded:i,elevationScale:c,filled:r,wireframe:a,_normalize:o,_windingOrder:s,getElevation:S,getFillColor:v,getLineColor:i&&a?y:VF,material:T,transitions:l},this.getSubLayerProps({id:`fill`,updateTriggers:w&&{getPolygon:w.getPolygon,getElevation:w.getElevation,getFillColor:w.getFillColor,lineColors:i&&a,getLineColor:w.getLineColor}}),{data:e,positionFormat:u,getPolygon:C}),j=!i&&n&&this.shouldRenderSubLayer(`stroke`,E)&&new k({_dataDiff:D&&(()=>D),widthUnits:d,widthScale:f,widthMinPixels:p,widthMaxPixels:m,jointRounded:h,miterLimit:g,dashJustified:_,_pathType:`loop`,transitions:l&&{getWidth:l.getLineWidth,getColor:l.getLineColor,getPath:l.getPolygon},getColor:this.getSubLayerAccessor(y),getWidth:this.getSubLayerAccessor(b),getDashArray:this.getSubLayerAccessor(x)},this.getSubLayerProps({id:`stroke`,updateTriggers:w&&{getWidth:w.getLineWidth,getColor:w.getLineColor,getDashArray:w.getLineDashArray}}),{data:E,positionFormat:u,getPath:e=>e.path});return[!i&&A,j,i&&A]}};UF.layerName=`PolygonLayer`,UF.defaultProps=HF;function WF(e,t){if(!e)return null;let n=`startIndices`in e?e.startIndices[t]:t,r=e.featureIds.value[n];return n===-1?null:GF(e,r,n)}function GF(e,t,n){let r={properties:{...e.properties[t]}};for(let t in e.numericProps)r.properties[t]=e.numericProps[t].value[n];return r}function KF(e,t){let n={points:null,lines:null,polygons:null};for(let r in n){let i=e[r].globalFeatureIds.value;n[r]=new Uint8ClampedArray(i.length*4);let a=[];for(let e=0;e`}},YF={none:0,start:1,center:2,end:3},XF={name:`text`,vs:`\ +layout(std140) uniform textUniforms { + highp vec2 cutoffPixels; + highp ivec2 align; + highp float fontSize; + bool flipY; +} text; + +#define ALIGN_MODE_START ${YF.start} +#define ALIGN_MODE_CENTER ${YF.center} +#define ALIGN_MODE_END ${YF.end} +`,getUniforms:({contentCutoffPixels:e=[0,0],contentAlignHorizontal:t=`none`,contentAlignVertical:n=`none`,fontSize:r,viewport:i})=>({cutoffPixels:e,align:[YF[t],YF[n]],fontSize:r,flipY:i?.flipY??!1}),uniformTypes:{cutoffPixels:`vec2`,align:`vec2`,fontSize:`f32`,flipY:`f32`}},ZF=`#version 300 es +#define SHADER_NAME multi-icon-layer-vertex-shader +in vec2 positions; +in vec3 instancePositions; +in vec3 instancePositions64Low; +in float instanceSizes; +in float instanceAngles; +in vec4 instanceColors; +in vec3 instancePickingColors; +in vec4 instanceIconFrames; +in float instanceColorModes; +in vec2 instanceOffsets; +in vec2 instancePixelOffset; +in vec4 instanceClipRect; +out float vColorMode; +out vec4 vColor; +out vec2 vTextureCoords; +out vec2 uv; +vec2 rotate_by_angle(vec2 vertex, float angle) { +float angle_radian = angle * PI / 180.0; +float cos_angle = cos(angle_radian); +float sin_angle = sin(angle_radian); +mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle); +return rotationMatrix * vertex; +} +float getPixelOffsetFromAlignment(float anchor, float extent, float clipStart, float clipEnd, int mode) { +if (clipEnd < clipStart) return 0.0; +if (mode == ALIGN_MODE_START) { +return max(- (anchor + clipStart), 0.0); +} +if (mode == ALIGN_MODE_CENTER) { +float _min = max(0., anchor + clipStart); +float _max = min(extent, anchor + clipEnd); +return _min < _max ? (_min + _max) / 2.0 - anchor : 0.0; +} +if (mode == ALIGN_MODE_END) { +return min(extent - (anchor + clipEnd), 0.); +} +return 0.0; +} +void main(void) { +geometry.worldPosition = instancePositions; +geometry.uv = positions; +geometry.pickingColor = instancePickingColors; +uv = positions; +vec2 iconSize = instanceIconFrames.zw; +float sizePixels = clamp( +project_size_to_pixel(instanceSizes * icon.sizeScale, icon.sizeUnits), +icon.sizeMinPixels, icon.sizeMaxPixels +); +float instanceScale = sizePixels / text.fontSize; +vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets; +pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale; +pixelOffset += instancePixelOffset; +pixelOffset.y *= -1.0; +vec2 anchorPosScreen; +if (icon.billboard) { +gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position); +anchorPosScreen = gl_Position.xy / gl_Position.w; +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +vec3 offset = vec3(pixelOffset, 0.0); +DECKGL_FILTER_SIZE(offset, geometry); +gl_Position.xy += project_pixel_size_to_clipspace(offset.xy); +} else { +vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0); +if (text.flipY) { +offset_common.y *= -1.; +} +DECKGL_FILTER_SIZE(offset_common, geometry); +vec4 anchorPos = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0)); +anchorPosScreen = anchorPos.xy / anchorPos.w; +gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +} +anchorPosScreen = vec2(anchorPosScreen.x + 1.0, 1.0 - anchorPosScreen.y) / 2.0 * project.viewportSize / project.devicePixelRatio; +vec2 xy = project_size_to_pixel(instanceClipRect.xy); +vec2 wh = project_size_to_pixel(instanceClipRect.zw); +if (text.flipY) { +xy.y = -xy.y - wh.y; +} +if (text.align.x > 0 || text.align.y > 0) { +vec2 viewportPixels = project.viewportSize / project.devicePixelRatio; +vec2 scrollPixels = vec2( +getPixelOffsetFromAlignment(anchorPosScreen.x, viewportPixels.x, xy.x, xy.x + wh.x, text.align.x), +-getPixelOffsetFromAlignment(anchorPosScreen.y, viewportPixels.y, -xy.y - wh.y, -xy.y, text.align.y) +); +pixelOffset += scrollPixels; +gl_Position.xy += project_pixel_size_to_clipspace(scrollPixels); +} +if (instanceClipRect.z >= 0.) { +if (pixelOffset.x < xy.x || pixelOffset.x > xy.x + wh.x) { +gl_Position = vec4(0.0); +} +else if (text.cutoffPixels.x > 0.) { +float vpWidth = project.viewportSize.x / project.devicePixelRatio; +float l = max(anchorPosScreen.x + xy.x, 0.0); +float r = min(anchorPosScreen.x + xy.x + wh.x, vpWidth); +if (r - l < text.cutoffPixels.x) { +gl_Position = vec4(0.0); +} +} +} +if (instanceClipRect.w >= 0.) { +if (pixelOffset.y < xy.y || pixelOffset.y > xy.y + wh.y) { +gl_Position = vec4(0.0); +} +else if (text.cutoffPixels.y > 0.) { +float vpHeight = project.viewportSize.y / project.devicePixelRatio; +float t = max(anchorPosScreen.y - xy.y - wh.y, 0.0); +float b = min(anchorPosScreen.y - xy.y, vpHeight); +if (b - t < text.cutoffPixels.y) { +gl_Position = vec4(0.0); +} +} +} +vTextureCoords = mix( +instanceIconFrames.xy, +instanceIconFrames.xy + iconSize, +(positions.xy + 1.0) / 2.0 +) / icon.iconsTextureDim; +vColor = instanceColors; +DECKGL_FILTER_COLOR(vColor, geometry); +vColorMode = instanceColorModes; +} +`,QF=`#version 300 es +#define SHADER_NAME multi-icon-layer-fragment-shader +precision highp float; +uniform sampler2D iconsTexture; +in vec4 vColor; +in vec2 vTextureCoords; +in vec2 uv; +out vec4 fragColor; +void main(void) { +geometry.uv = uv; +if (!bool(picking.isActive)) { +float alpha = texture(iconsTexture, vTextureCoords).a; +vec4 color = vColor; +if (sdf.enabled) { +float distance = alpha; +alpha = smoothstep(sdf.buffer - sdf.gamma, sdf.buffer + sdf.gamma, distance); +if (sdf.outlineBuffer > 0.0) { +float inFill = alpha; +float inBorder = smoothstep(sdf.outlineBuffer - sdf.gamma, sdf.outlineBuffer + sdf.gamma, distance); +color = mix(sdf.outlineColor, vColor, inFill); +alpha = inBorder; +} +} +float a = alpha * color.a; +if (a < icon.alphaCutoff) { +discard; +} +fragColor = vec4(color.rgb, a * layer.opacity); +} +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,$F=192/256,eI={getIconOffsets:{type:`accessor`,value:e=>e.offsets},getContentBox:{type:`accessor`,value:[0,0,-1,-1]},fontSize:1,alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:`color`,value:[0,0,0,255]},contentCutoffPixels:{type:`array`,value:[0,0]},contentAlignHorizontal:`none`,contentAlignVertical:`none`},tI=class extends FN{getShaders(){let e=super.getShaders();return{...e,modules:[...e.modules,XF,JF],vs:ZF,fs:QF}}initializeState(){super.initializeState();let e=this.getAttributeManager(),t=e.attributes.instanceIconDefs;t.settings.update=this.calculateInstanceIconDefs,e.addInstanced({instancePickingColors:{type:`uint8`,size:4,accessor:(e,{index:t,target:n})=>this.encodePickingColor(t,n)},instanceClipRect:{size:4,accessor:`getContentBox`,defaultValue:[0,0,-1,-1]}})}updateState(e){super.updateState(e);let{props:t,oldProps:n,changeFlags:r}=e,{outlineColor:i}=t;if(r.updateTriggersChanged&&(r.updateTriggersChanged.getIcon||r.updateTriggersChanged.getIconOffsets)&&this.getAttributeManager().invalidate(`instanceIconDefs`),i!==n.outlineColor){let e=[i[0]/255,i[1]/255,i[2]/255,(i[3]??255)/255];this.setState({outlineColor:e})}!t.sdf&&t.outlineWidth&&fo.warn(`${this.id}: fontSettings.sdf is required to render outline`)()}draw(e){let{sdf:t,smoothing:n,fontSize:r,outlineWidth:i,contentCutoffPixels:a,contentAlignHorizontal:o,contentAlignVertical:s}=this.props,{outlineColor:c}=this.state,l=i?Math.max(n,$F*(1-i)):-1,u=this.state.model,d={buffer:$F,outlineBuffer:l,gamma:n,enabled:!!t,outlineColor:c},f={contentCutoffPixels:a,contentAlignHorizontal:o,contentAlignVertical:s,fontSize:r,viewport:this.context.viewport};if(u.shaderInputs.setProps({sdf:d,text:f}),super.draw(e),t&&i){let{iconManager:e}=this.state;e.getTexture()&&(u.shaderInputs.setProps({sdf:{...d,outlineBuffer:$F}}),u.draw(this.context.renderPass))}}calculateInstanceIconDefs(e,{startRow:t,endRow:n}){let{data:r,getIcon:i,getIconOffsets:a}=this.props,o=e.getVertexOffset(t),s=e.value,{iterable:c,objectInfo:l}=Ty(r,t,n);for(let t of c){l.index++;let n=i(t,l),r=a(t,l);if(n){let t=0;for(let i of Array.from(n)){let n=super.getInstanceIconDef(i);n[0]=r[t*2],n[1]+=r[t*2+1],n[6]=1,s.set(n,o),o+=e.size,t++}}}}};tI.defaultProps=eI,tI.layerName=`MultiIconLayer`;var nI=0x56bc75e2d63100000,rI=class{constructor({fontSize:e=24,buffer:t=3,radius:n=8,cutoff:r=.25,fontFamily:i=`sans-serif`,fontWeight:a=`normal`,fontStyle:o=`normal`}={}){this.buffer=t,this.cutoff=r,this.radius=n;let s=this.size=e+t*4,c=this._createCanvas(s),l=this.ctx=c.getContext(`2d`,{willReadFrequently:!0});l.font=`${o} ${a} ${e}px ${i}`,l.textBaseline=`alphabetic`,l.textAlign=`left`,l.fillStyle=`black`,this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(e){let t=document.createElement(`canvas`);return t.width=t.height=e,t}draw(e){let{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:r,actualBoundingBoxLeft:i,actualBoundingBoxRight:a}=this.ctx.measureText(e),o=Math.ceil(n),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-i))),c=Math.min(this.size-this.buffer,o+Math.ceil(r)),l=s+2*this.buffer,u=c+2*this.buffer,d=Math.max(l*u,0),f=new Uint8ClampedArray(d),p={data:f,width:l,height:u,glyphWidth:s,glyphHeight:c,glyphTop:o,glyphLeft:0,glyphAdvance:t};if(s===0||c===0)return p;let{ctx:m,buffer:h,gridInner:g,gridOuter:_}=this;m.clearRect(h,h,s,c),m.fillText(e,h,h+o);let v=m.getImageData(h,h,s,c);_.fill(nI,0,d),g.fill(0,0,d);for(let e=0;e0?e*e:0,g[r]=e<0?e*e:0}}iI(_,0,0,l,u,l,this.f,this.v,this.z),iI(g,h,h,s,c,l,this.f,this.v,this.z);for(let e=0;e-1);c++,a[c]=s,o[c]=l,o[c+1]=nI}for(let s=0,c=0;sr&&(c=0,l=u),i[a]={x:c+n,y:l+n,width:o,height:f,advance:e,anchorX:o/2,anchorY:s},c+=o+n*2,u=Math.max(u,l+f+n*2)}return{mapping:i,xOffset:c,yOffsetMin:l,yOffsetMax:u,canvasHeight:cI(u)}}function uI(e,t,n,r){let i=0;for(let a=t;ar&&(os){let t=uI(e,s,c,i);l+t>r&&(or&&(t=dI(e,s,c,r,i,a),o=a[a.length-1])),s=c,l+=t}return l}function pI(e,t,n,r,i=0,a){a===void 0&&(a=e.length);let o=[];return t===`break-all`?dI(e,i,a,n,r,o):fI(e,i,a,n,r,o),o}function mI(e,t,n,r,i,a){let o=0,s=0;for(let i=t;i0,f=[0,0],p=[0,0],m=0,h=t+n/2,g=0,_=0;for(let e=0;e<=s;e++){let t=o[e];if((t===` +`||e===s)&&(_=e),_>g){let e=d?pI(o,r,i,a,g,_):sI;for(let t=0;t<=e.length;t++){let r=t===0?g:e[t-1],i=t1||c>0){let t=e.constructor;f=new t(l);for(let t=0;t=0&&this._order.splice(t,1)}_appendOrder(e){this._order.push(e)}};function vI(){let e=[];for(let t=32;t<128;t++)e.push(String.fromCharCode(t));return e}var yI={fontFamily:`Monaco, monospace`,fontWeight:`normal`,characterSet:vI(),fontSize:64,buffer:4,sdf:!1,cutoff:.25,radius:12,smoothing:.1},bI=1024,xI=.9,SI=.3,CI=3,wI=new _I(CI);function TI(e,t){let n;n=typeof t==`string`?new Set(Array.from(t)):new Set(t);let r=wI.get(e);if(!r)return n;for(let e in r.mapping)n.has(e)&&n.delete(e);return n}function EI(e,t){for(let n=0;n=CI,`Invalid cache limit`),wI=new _I(e)}var AI=class{constructor(){this.props={...yI}}get atlas(){return this._atlas}get mapping(){return this._atlas&&this._atlas.mapping}setProps(e={}){Object.assign(this.props,e),e._getFontRenderer&&(this._getFontRenderer=e._getFontRenderer),this._key=this._getKey();let t=TI(this._key,this.props.characterSet),n=wI.get(this._key);if(n&&t.size===0){this._atlas!==n&&(this._atlas=n);return}let r=this._generateFontAtlas(t,n);this._atlas=r,wI.set(this._key,r)}_generateFontAtlas(e,t){let{fontFamily:n,fontWeight:r,fontSize:i,buffer:a,sdf:o,radius:s,cutoff:c}=this.props,l=t&&t.data;l||(l=document.createElement(`canvas`),l.width=bI);let u=l.getContext(`2d`,{willReadFrequently:!0});DI(u,n,i,r);let d=e=>OI(u,i,e),f;this._getFontRenderer?f=this._getFontRenderer(this.props):o&&(f={measure:d,draw:jI(this.props)});let{mapping:p,canvasHeight:m,xOffset:h,yOffsetMin:g,yOffsetMax:_}=lI({measureText:e=>f?f.measure(e):d(e),buffer:a,characterSet:e,maxCanvasWidth:bI,...t&&{mapping:t.mapping,xOffset:t.xOffset,yOffsetMin:t.yOffsetMin,yOffsetMax:t.yOffsetMax}});if(l.height!==m){let e=l.height>0?u.getImageData(0,0,l.width,l.height):null;l.height=m,e&&u.putImageData(e,0,0)}if(DI(u,n,i,r),f)for(let t of e){let e=p[t],{data:n,left:r=0,top:i=0}=f.draw(t),a=e.x-r,o=e.y-i,s=Math.max(0,Math.round(a)),c=Math.max(0,Math.round(o)),d=Math.min(n.width,l.width-s),m=Math.min(n.height,l.height-c);u.putImageData(n,s,c,0,0,d,m),e.x+=s-a,e.y+=c-o}else for(let t of e){let e=p[t];u.fillText(t,e.x,e.y+e.anchorY)}let v=f?f.measure():d();return{baselineOffset:(v.ascent-v.descent)/2,xOffset:h,yOffsetMin:g,yOffsetMax:_,mapping:p,data:l,width:l.width,height:l.height}}_getKey(){let{fontFamily:e,fontWeight:t,fontSize:n,buffer:r,sdf:i,radius:a,cutoff:o}=this.props;return i?`${e} ${t} ${n} ${r} ${a} ${o}`:`${e} ${t} ${n} ${r}`}};function jI({fontSize:e,buffer:t,radius:n,cutoff:r,fontFamily:i,fontWeight:a}){let o=new rI({fontSize:e,buffer:t,radius:n,cutoff:r,fontFamily:i,fontWeight:`${a}`});return e=>{let{data:n,width:r,height:i}=o.draw(e),a=new ImageData(r,i);return EI(n,a),{data:a,left:t,top:t}}}var MI=`layout(std140) uniform textBackgroundUniforms { + bool billboard; + float sizeScale; + float sizeMinPixels; + float sizeMaxPixels; + vec4 borderRadius; + vec4 padding; + highp int sizeUnits; + bool stroked; +} textBackground; +`,NI={name:`textBackground`,vs:MI,fs:MI,uniformTypes:{billboard:`f32`,sizeScale:`f32`,sizeMinPixels:`f32`,sizeMaxPixels:`f32`,borderRadius:`vec4`,padding:`vec4`,sizeUnits:`i32`,stroked:`f32`}},PI=`#version 300 es +#define SHADER_NAME text-background-layer-vertex-shader +in vec2 positions; +in vec3 instancePositions; +in vec3 instancePositions64Low; +in vec4 instanceRects; +in vec4 instanceClipRect; +in float instanceSizes; +in float instanceAngles; +in vec2 instancePixelOffsets; +in float instanceLineWidths; +in vec4 instanceFillColors; +in vec4 instanceLineColors; +in vec3 instancePickingColors; +out vec4 vFillColor; +out vec4 vLineColor; +out float vLineWidth; +out vec2 uv; +out vec2 dimensions; +vec2 rotate_by_angle(vec2 vertex, float angle) { +float angle_radian = radians(angle); +float cos_angle = cos(angle_radian); +float sin_angle = sin(angle_radian); +mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle); +return rotationMatrix * vertex; +} +void main(void) { +geometry.worldPosition = instancePositions; +geometry.uv = positions; +geometry.pickingColor = instancePickingColors; +uv = positions; +vLineWidth = instanceLineWidths; +float sizePixels = clamp( +project_size_to_pixel(instanceSizes * textBackground.sizeScale, textBackground.sizeUnits), +textBackground.sizeMinPixels, textBackground.sizeMaxPixels +); +float instanceScale = sizePixels / text.fontSize; +dimensions = instanceRects.zw * instanceScale + textBackground.padding.xy + textBackground.padding.zw; +vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * instanceScale + mix(-textBackground.padding.xy, textBackground.padding.zw, positions); +pixelOffset = rotate_by_angle(pixelOffset, instanceAngles); +pixelOffset += instancePixelOffsets; +pixelOffset.y *= -1.0; +vec2 xy = project_size_to_pixel(instanceClipRect.xy); +vec2 wh = project_size_to_pixel(instanceClipRect.zw); +if (text.flipY) { +xy.y = -xy.y - wh.y; +} +if (instanceClipRect.z >= 0.0) { +dimensions.x = wh.x; +pixelOffset.x = xy.x + uv.x * wh.x + mix(-textBackground.padding.x, textBackground.padding.z, uv.x); +} +if (instanceClipRect.w >= 0.0) { +dimensions.y = wh.y; +pixelOffset.y = xy.y + uv.y * wh.y + mix(-textBackground.padding.y, textBackground.padding.w, uv.y); +} +if (textBackground.billboard) { +gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +vec3 offset = vec3(pixelOffset, 0.0); +DECKGL_FILTER_SIZE(offset, geometry); +gl_Position.xy += project_pixel_size_to_clipspace(offset.xy); +} else { +vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0); +if (text.flipY) { +offset_common.y *= -1.; +} +DECKGL_FILTER_SIZE(offset_common, geometry); +gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +} +vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * layer.opacity); +DECKGL_FILTER_COLOR(vFillColor, geometry); +vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * layer.opacity); +DECKGL_FILTER_COLOR(vLineColor, geometry); +} +`,FI=`#version 300 es +#define SHADER_NAME text-background-layer-fragment-shader +precision highp float; +in vec4 vFillColor; +in vec4 vLineColor; +in float vLineWidth; +in vec2 uv; +in vec2 dimensions; +out vec4 fragColor; +float round_rect(vec2 p, vec2 size, vec4 radii) { +vec2 pixelPositionCB = (p - 0.5) * size; +vec2 sizeCB = size * 0.5; +float maxBorderRadius = min(size.x, size.y) * 0.5; +vec4 borderRadius = vec4(min(radii, maxBorderRadius)); +borderRadius.xy = +(pixelPositionCB.x > 0.0) ? borderRadius.xy : borderRadius.zw; +borderRadius.x = (pixelPositionCB.y > 0.0) ? borderRadius.x : borderRadius.y; +vec2 q = abs(pixelPositionCB) - sizeCB + borderRadius.x; +return -(min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - borderRadius.x); +} +float rect(vec2 p, vec2 size) { +vec2 pixelPosition = p * size; +return min(min(pixelPosition.x, size.x - pixelPosition.x), +min(pixelPosition.y, size.y - pixelPosition.y)); +} +vec4 get_stroked_fragColor(float dist) { +float isBorder = smoothedge(dist, vLineWidth); +return mix(vFillColor, vLineColor, isBorder); +} +void main(void) { +geometry.uv = uv; +if (textBackground.borderRadius != vec4(0.0)) { +float distToEdge = round_rect(uv, dimensions, textBackground.borderRadius); +float shapeAlpha = smoothedge(-distToEdge, 0.0); +if (shapeAlpha == 0.0) { +discard; +} +if (textBackground.stroked) { +fragColor = get_stroked_fragColor(distToEdge); +} else { +fragColor = vFillColor; +} +fragColor.a *= shapeAlpha; +} else { +if (textBackground.stroked) { +float distToEdge = rect(uv, dimensions); +fragColor = get_stroked_fragColor(distToEdge); +} else { +fragColor = vFillColor; +} +} +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,II={billboard:!0,sizeScale:1,sizeUnits:`pixels`,sizeMinPixels:0,sizeMaxPixels:2**53-1,fontSize:1,borderRadius:{type:`object`,value:0},padding:{type:`array`,value:[0,0,0,0]},getPosition:{type:`accessor`,value:e=>e.position},getSize:{type:`accessor`,value:1},getAngle:{type:`accessor`,value:0},getPixelOffset:{type:`accessor`,value:[0,0]},getBoundingRect:{type:`accessor`,value:[0,0,0,0]},getClipRect:{type:`accessor`,value:[0,0,-1,-1]},getFillColor:{type:`accessor`,value:[0,0,0,255]},getLineColor:{type:`accessor`,value:[0,0,0,255]},getLineWidth:{type:`accessor`,value:1}},LI=class extends dx{getShaders(){return super.getShaders({vs:PI,fs:FI,modules:[Bp,jm,NI,XF]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:`float64`,fp64:this.use64bitPositions(),transition:!0,accessor:`getPosition`},instanceSizes:{size:1,transition:!0,accessor:`getSize`,defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:`getAngle`},instanceRects:{size:4,accessor:`getBoundingRect`},instanceClipRect:{size:4,accessor:`getClipRect`,defaultValue:[0,0,-1,-1]},instancePixelOffsets:{size:2,transition:!0,accessor:`getPixelOffset`},instanceFillColors:{size:4,transition:!0,type:`unorm8`,accessor:`getFillColor`,defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,type:`unorm8`,accessor:`getLineColor`,defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:`getLineWidth`,defaultValue:1}})}updateState(e){super.updateState(e);let{changeFlags:t}=e;t.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){let{billboard:t,sizeScale:n,sizeUnits:r,sizeMinPixels:i,sizeMaxPixels:a,getLineWidth:o,fontSize:s}=this.props,{padding:c,borderRadius:l}=this.props;c.length<4&&(c=[c[0],c[1],c[0],c[1]]),Array.isArray(l)||(l=[l,l,l,l]);let u=this.state.model,d={billboard:t,stroked:!!o,borderRadius:l,padding:c,sizeUnits:vp[r],sizeScale:n,sizeMinPixels:i,sizeMaxPixels:a},f={fontSize:s,viewport:this.context.viewport};u.shaderInputs.setProps({textBackground:d,text:f}),u.draw(this.context.renderPass)}_getModel(){let e=[0,0,1,0,0,1,1,1];return new Rg(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new Jg({topology:`triangle-strip`,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array(e)}}}),isInstanced:!0})}};LI.defaultProps=II,LI.layerName=`TextBackgroundLayer`;var RI={start:1,middle:0,end:-1},zI={top:1,center:0,bottom:-1},BI=[0,0,0,255],VI={billboard:!0,sizeScale:1,sizeUnits:`pixels`,sizeMinPixels:0,sizeMaxPixels:2**53-1,background:!1,getBackgroundColor:{type:`accessor`,value:[255,255,255,255]},getBorderColor:{type:`accessor`,value:BI},getBorderWidth:{type:`accessor`,value:0},backgroundBorderRadius:{type:`object`,value:0},backgroundPadding:{type:`array`,value:[0,0,0,0]},characterSet:{type:`object`,value:yI.characterSet},fontFamily:yI.fontFamily,fontWeight:yI.fontWeight,lineHeight:1,outlineWidth:{type:`number`,value:0,min:0},outlineColor:{type:`color`,value:BI},fontSettings:{type:`object`,value:{},compare:1},wordBreak:`break-word`,maxWidth:{type:`number`,value:-1},contentCutoffPixels:{type:`array`,value:[0,0]},contentAlignHorizontal:`none`,contentAlignVertical:`none`,getText:{type:`accessor`,value:e=>e.text},getPosition:{type:`accessor`,value:e=>e.position},getColor:{type:`accessor`,value:BI},getSize:{type:`accessor`,value:32},getAngle:{type:`accessor`,value:0},getTextAnchor:{type:`accessor`,value:`middle`},getAlignmentBaseline:{type:`accessor`,value:`center`},getPixelOffset:{type:`accessor`,value:[0,0]},getContentBox:{type:`accessor`,value:[0,0,-1,-1]},backgroundColor:{deprecatedFor:[`background`,`getBackgroundColor`]}},HI=class extends fx{constructor(){super(...arguments),this.getBoundingRect=(e,t)=>{let{size:[n,r]}=this.transformParagraph(e,t),{getTextAnchor:i,getAlignmentBaseline:a}=this.props,o=RI[typeof i==`function`?i(e,t):i],s=zI[typeof a==`function`?a(e,t):a];return[(o-1)*n/2,(s-1)*r/2,n,r]},this.getIconOffsets=(e,t)=>{let{getTextAnchor:n,getAlignmentBaseline:r}=this.props,{x:i,y:a,rowWidth:o,size:[,s]}=this.transformParagraph(e,t),c=RI[typeof n==`function`?n(e,t):n],l=zI[typeof r==`function`?r(e,t):r],u=i.length,d=Array(u*2),f=0;for(let e=0;e0&&fo.once(1,`v8.9 breaking change: TextLayer maxWidth is now relative to text size`)()}updateState(e){let{props:t,oldProps:n,changeFlags:r}=e;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this._updateText(),(this._updateFontAtlas()||t.lineHeight!==n.lineHeight||t.wordBreak!==n.wordBreak||t.maxWidth!==n.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:e}){return e.object=e.index>=0?this.props.data[e.index]:null,e}_updateFontAtlas(){let{fontSettings:e,fontFamily:t,fontWeight:n,_getFontRenderer:r}=this.props,{fontAtlasManager:i,characterSet:a}=this.state,o={...e,characterSet:a,fontFamily:t,fontWeight:n,_getFontRenderer:r};if(!i.mapping)return i.setProps(o),!0;for(let e in o)if(o[e]!==i.props[e])return i.setProps(o),!0;return!1}_updateText(){let{data:e,characterSet:t}=this.props,n=e.attributes?.getText,{getText:r}=this.props,i=e.startIndices,a,o=t===`auto`&&new Set;if(n&&i){let{texts:t,characterCount:s}=gI({...ArrayBuffer.isView(n)?{value:n}:n,length:e.length,startIndices:i,characterSet:o});a=s,r=(e,{index:n})=>t[n]}else{let{iterable:t,objectInfo:n}=Ty(e);i=[0],a=0;for(let e of t){n.index++;let t=Array.from(r(e,n)||``);o&&t.forEach(o.add,o),a+=t.length,i.push(a)}}this.setState({getText:r,startIndices:i,numInstances:a,characterSet:o||t})}transformParagraph(e,t){let{fontAtlasManager:n}=this.state,r=n.mapping,{baselineOffset:i}=n.atlas,{fontSize:a}=n.props,o=this.state.getText,{wordBreak:s,lineHeight:c,maxWidth:l}=this.props;return hI(o(e,t)||``,i,c*a,s,l*a,r)}renderLayers(){let{startIndices:e,numInstances:t,getText:n,fontAtlasManager:{atlas:r,mapping:i},styleVersion:a}=this.state,{data:o,_dataDiff:s,getPosition:c,getColor:l,getSize:u,getAngle:d,getPixelOffset:f,getBackgroundColor:p,getBorderColor:m,getBorderWidth:h,getContentBox:g,backgroundBorderRadius:_,backgroundPadding:v,background:y,billboard:b,fontSettings:x,outlineWidth:S,outlineColor:C,sizeScale:w,sizeUnits:T,sizeMinPixels:E,sizeMaxPixels:D,contentCutoffPixels:O,contentAlignHorizontal:k,contentAlignVertical:A,transitions:j,updateTriggers:M}=this.props,N=this.getSubLayerClass(`characters`,tI),P=this.getSubLayerClass(`background`,LI),{fontSize:ee}=this.state.fontAtlasManager.props;return[y&&new P({getFillColor:p,getLineColor:m,getLineWidth:h,borderRadius:_,padding:v,getPosition:c,getSize:u,getAngle:d,getPixelOffset:f,getClipRect:g,billboard:b,sizeScale:w,sizeUnits:T,sizeMinPixels:E,sizeMaxPixels:D,fontSize:ee,transitions:j&&{getPosition:j.getPosition,getAngle:j.getAngle,getSize:j.getSize,getFillColor:j.getBackgroundColor,getLineColor:j.getBorderColor,getLineWidth:j.getBorderWidth,getPixelOffset:j.getPixelOffset}},this.getSubLayerProps({id:`background`,updateTriggers:{getPosition:M.getPosition,getAngle:M.getAngle,getSize:M.getSize,getFillColor:M.getBackgroundColor,getLineColor:M.getBorderColor,getLineWidth:M.getBorderWidth,getPixelOffset:M.getPixelOffset,getBoundingRect:{getText:M.getText,getTextAnchor:M.getTextAnchor,getAlignmentBaseline:M.getAlignmentBaseline,styleVersion:a}}}),{data:o.attributes&&o.attributes.background?{length:o.length,attributes:o.attributes.background}:o,_dataDiff:s,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new N({sdf:x.sdf,smoothing:Number.isFinite(x.smoothing)?x.smoothing:yI.smoothing,outlineWidth:S/(x.radius||yI.radius),outlineColor:C,iconAtlas:r,iconMapping:i,getPosition:c,getColor:l,getSize:u,getAngle:d,getPixelOffset:f,getContentBox:g,billboard:b,sizeScale:w,sizeUnits:T,sizeMinPixels:E,sizeMaxPixels:D,fontSize:ee,contentCutoffPixels:O,contentAlignHorizontal:k,contentAlignVertical:A,transitions:j&&{getPosition:j.getPosition,getAngle:j.getAngle,getColor:j.getColor,getSize:j.getSize,getPixelOffset:j.getPixelOffset,getContentBox:j.getContentBox}},this.getSubLayerProps({id:`characters`,updateTriggers:{all:M.getText,getPosition:M.getPosition,getAngle:M.getAngle,getColor:M.getColor,getSize:M.getSize,getPixelOffset:M.getPixelOffset,getContentBox:M.getContentBox,getIconOffsets:{getTextAnchor:M.getTextAnchor,getAlignmentBaseline:M.getAlignmentBaseline,styleVersion:a}}}),{data:o,_dataDiff:s,startIndices:e,numInstances:t,getIconOffsets:this.getIconOffsets,getIcon:n})]}static set fontAtlasCacheLimit(e){kI(e)}};HI.defaultProps=VI,HI.layerName=`TextLayer`;var UI={circle:{type:WN,props:{filled:`filled`,stroked:`stroked`,lineWidthMaxPixels:`lineWidthMaxPixels`,lineWidthMinPixels:`lineWidthMinPixels`,lineWidthScale:`lineWidthScale`,lineWidthUnits:`lineWidthUnits`,pointRadiusMaxPixels:`radiusMaxPixels`,pointRadiusMinPixels:`radiusMinPixels`,pointRadiusScale:`radiusScale`,pointRadiusUnits:`radiusUnits`,pointAntialiasing:`antialiasing`,pointBillboard:`billboard`,getFillColor:`getFillColor`,getLineColor:`getLineColor`,getLineWidth:`getLineWidth`,getPointRadius:`getRadius`}},icon:{type:FN,props:{iconAtlas:`iconAtlas`,iconMapping:`iconMapping`,iconSizeMaxPixels:`sizeMaxPixels`,iconSizeMinPixels:`sizeMinPixels`,iconSizeScale:`sizeScale`,iconSizeUnits:`sizeUnits`,iconAlphaCutoff:`alphaCutoff`,iconBillboard:`billboard`,getIcon:`getIcon`,getIconAngle:`getAngle`,getIconColor:`getColor`,getIconPixelOffset:`getPixelOffset`,getIconSize:`getSize`}},text:{type:HI,props:{textSizeMaxPixels:`sizeMaxPixels`,textSizeMinPixels:`sizeMinPixels`,textSizeScale:`sizeScale`,textSizeUnits:`sizeUnits`,textBackground:`background`,textBackgroundPadding:`backgroundPadding`,textFontFamily:`fontFamily`,textFontWeight:`fontWeight`,textLineHeight:`lineHeight`,textMaxWidth:`maxWidth`,textOutlineColor:`outlineColor`,textOutlineWidth:`outlineWidth`,textWordBreak:`wordBreak`,textCharacterSet:`characterSet`,textBillboard:`billboard`,textFontSettings:`fontSettings`,getText:`getText`,getTextAngle:`getAngle`,getTextColor:`getColor`,getTextPixelOffset:`getPixelOffset`,getTextSize:`getSize`,getTextAnchor:`getTextAnchor`,getTextAlignmentBaseline:`getAlignmentBaseline`,getTextBackgroundColor:`getBackgroundColor`,getTextBorderColor:`getBorderColor`,getTextBorderWidth:`getBorderWidth`}}},WI={type:uF,props:{lineWidthUnits:`widthUnits`,lineWidthScale:`widthScale`,lineWidthMinPixels:`widthMinPixels`,lineWidthMaxPixels:`widthMaxPixels`,lineJointRounded:`jointRounded`,lineCapRounded:`capRounded`,lineMiterLimit:`miterLimit`,lineBillboard:`billboard`,getLineColor:`getColor`,getLineWidth:`getWidth`}},GI={type:zF,props:{extruded:`extruded`,filled:`filled`,wireframe:`wireframe`,elevationScale:`elevationScale`,material:`material`,_full3d:`_full3d`,getElevation:`getElevation`,getFillColor:`getFillColor`,getLineColor:`getLineColor`}};function KI({type:e,props:t}){let n={};for(let r in t)n[r]=e.defaultProps[t[r]];return n}function qI(e,t){let{transitions:n,updateTriggers:r}=e.props,i={updateTriggers:{},transitions:n&&{getPosition:n.geometry}};for(let a in t){let o=t[a],s=e.props[a];a.startsWith(`get`)&&(s=e.getSubLayerAccessor(s),i.updateTriggers[o]=r[a],n&&(i.transitions[o]=n[a])),i[o]=s}return i}function JI(e){if(Array.isArray(e))return e;switch(fo.assert(e.type,`GeoJSON does not have type`),e.type){case`Feature`:return[e];case`FeatureCollection`:return fo.assert(Array.isArray(e.features),`GeoJSON does not have features array`),e.features;default:return[{geometry:e}]}}function YI(e,t,n={}){let r={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},{startRow:i=0,endRow:a=e.length}=n;for(let n=i;n{s.push(n({geometry:{type:`Point`,coordinates:e}},r,i))});break;case`LineString`:c.push(n({geometry:e},r,i));break;case`MultiLineString`:o.forEach(e=>{c.push(n({geometry:{type:`LineString`,coordinates:e}},r,i))});break;case`Polygon`:l.push(n({geometry:e},r,i)),o.forEach(e=>{u.push(n({geometry:{type:`LineString`,coordinates:e}},r,i))});break;case`MultiPolygon`:o.forEach(e=>{l.push(n({geometry:{type:`Polygon`,coordinates:e}},r,i)),e.forEach(e=>{u.push(n({geometry:{type:`LineString`,coordinates:e}},r,i))})});break;default:}}var ZI={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function QI(e,t){let n=ZI[e];for(fo.assert(n,`Unknown GeoJSON type ${e}`);t&&--n>0;)t=t[0];return t&&Number.isFinite(t[0])}function $I(){return{points:{},lines:{},polygons:{},polygonsOutline:{}}}function eL(e){return e.geometry.coordinates}function tL(e,t){let n=$I(),{pointFeatures:r,lineFeatures:i,polygonFeatures:a,polygonOutlineFeatures:o}=e;return n.points.data=r,n.points._dataDiff=t.pointFeatures&&(()=>t.pointFeatures),n.points.getPosition=eL,n.lines.data=i,n.lines._dataDiff=t.lineFeatures&&(()=>t.lineFeatures),n.lines.getPath=eL,n.polygons.data=a,n.polygons._dataDiff=t.polygonFeatures&&(()=>t.polygonFeatures),n.polygons.getPolygon=eL,n.polygonsOutline.data=o,n.polygonsOutline._dataDiff=t.polygonOutlineFeatures&&(()=>t.polygonOutlineFeatures),n.polygonsOutline.getPath=eL,n}function nL(e,t){let n=$I(),{points:r,lines:i,polygons:a}=e,o=KF(e,t);n.points.data={length:r.positions.value.length/r.positions.size,attributes:{...r.attributes,getPosition:r.positions,instancePickingColors:{size:4,value:o.points}},properties:r.properties,numericProps:r.numericProps,featureIds:r.featureIds},n.lines.data={length:i.pathIndices.value.length-1,startIndices:i.pathIndices.value,attributes:{...i.attributes,getPath:i.positions,instancePickingColors:{size:4,value:o.lines}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},n.lines._pathType=`open`;let s=a.positions.value.length/a.positions.size,c=Array(s).fill(1);for(let e of a.primitivePolygonIndices.value)c[e-1]=0;return n.polygons.data={length:a.polygonIndices.value.length-1,startIndices:a.polygonIndices.value,attributes:{...a.attributes,getPolygon:a.positions,instanceVertexValid:{size:1,value:new Uint16Array(c)},pickingColors:{size:4,value:o.polygons}},properties:a.properties,numericProps:a.numericProps,featureIds:a.featureIds},n.polygons._normalize=!1,a.triangles&&(n.polygons.data.attributes.indices=a.triangles.value),n.polygonsOutline.data={length:a.primitivePolygonIndices.value.length-1,startIndices:a.primitivePolygonIndices.value,attributes:{...a.attributes,getPath:a.positions,instancePickingColors:{size:4,value:o.polygons}},properties:a.properties,numericProps:a.numericProps,featureIds:a.featureIds},n.polygonsOutline._pathType=`open`,n}var rL=[`points`,`linestrings`,`polygons`],iL={...KI(UI.circle),...KI(UI.icon),...KI(UI.text),...KI(WI),...KI(GI),stroked:!0,filled:!0,extruded:!1,wireframe:!1,_full3d:!1,iconAtlas:{type:`object`,value:null},iconMapping:{type:`object`,value:{}},getIcon:{type:`accessor`,value:e=>e.properties.icon},getText:{type:`accessor`,value:e=>e.properties.text},pointType:`circle`,getRadius:{deprecatedFor:`getPointRadius`}},aL=class extends fx{initializeState(){this.state={layerProps:{},features:{},featuresDiff:{}}}updateState({props:e,changeFlags:t}){if(!t.dataChanged)return;let{data:n}=this.props,r=n&&`points`in n&&`polygons`in n&&`lines`in n;this.setState({binary:r}),r?this._updateStateBinary({props:e,changeFlags:t}):this._updateStateJSON({props:e,changeFlags:t})}_updateStateBinary({props:e,changeFlags:t}){let n=nL(e.data,this.encodePickingColor);this.setState({layerProps:n})}_updateStateJSON({props:e,changeFlags:t}){let n=JI(e.data),r=this.getSubLayerRow.bind(this),i={},a={};if(Array.isArray(t.dataChanged)){let e=this.state.features;for(let t in e)i[t]=e[t].slice(),a[t]=[];for(let o of t.dataChanged){let t=YI(n,r,o);for(let n in e)a[n].push(BF({data:i[n],getIndex:e=>e.__source.index,dataRange:o,replace:t[n]}))}}else i=YI(n,r);let o=tL(i,a);this.setState({features:i,featuresDiff:a,layerProps:o})}getPickingInfo(e){let t=super.getPickingInfo(e),{index:n,sourceLayer:r}=t;return t.featureType=rL.find(e=>r.id.startsWith(`${this.id}-${e}-`)),n>=0&&r.id.startsWith(`${this.id}-points-text`)&&this.state.binary&&(t.index=this.props.data.points.globalFeatureIds.value[n]),t}_updateAutoHighlight(e){let t=`${this.id}-points-`,n=e.featureType===`points`;for(let r of this.getSubLayers())r.id.startsWith(t)===n&&r.updateAutoHighlight(e)}_renderPolygonLayer(){let{extruded:e,wireframe:t}=this.props,{layerProps:n}=this.state,r=`polygons-fill`,i=this.shouldRenderSubLayer(r,n.polygons?.data)&&this.getSubLayerClass(r,GI.type);if(i){let a=qI(this,GI.props),o=e&&t;return o||delete a.getLineColor,a.updateTriggers.lineColors=o,new i(a,this.getSubLayerProps({id:r,updateTriggers:a.updateTriggers}),n.polygons)}return null}_renderLineLayers(){let{extruded:e,stroked:t}=this.props,{layerProps:n}=this.state,r=`polygons-stroke`,i=`linestrings`,a=!e&&t&&this.shouldRenderSubLayer(r,n.polygonsOutline?.data)&&this.getSubLayerClass(r,WI.type),o=this.shouldRenderSubLayer(i,n.lines?.data)&&this.getSubLayerClass(i,WI.type);if(a||o){let e=qI(this,WI.props);return[a&&new a(e,this.getSubLayerProps({id:r,updateTriggers:e.updateTriggers}),n.polygonsOutline),o&&new o(e,this.getSubLayerProps({id:i,updateTriggers:e.updateTriggers}),n.lines)]}return null}_renderPointLayers(){let{pointType:e}=this.props,{layerProps:t,binary:n}=this.state,{highlightedObjectIndex:r}=this.props;!n&&Number.isFinite(r)&&(r=t.points.data.findIndex(e=>e.__source.index===r));let i=new Set(e.split(`+`)),a=[];for(let e of i){let i=`points-${e}`,o=UI[e],s=o&&this.shouldRenderSubLayer(i,t.points?.data)&&this.getSubLayerClass(i,o.type);if(s){let c=qI(this,o.props),l=t.points;if(e===`text`&&n){let{instancePickingColors:e,...t}=l.data.attributes;l={...l,data:{...l.data,attributes:t}}}a.push(new s(c,this.getSubLayerProps({id:i,updateTriggers:c.updateTriggers,highlightedObjectIndex:r}),l))}}return a}renderLayers(){let{extruded:e}=this.props,t=this._renderPolygonLayer(),n=this._renderLineLayers(),r=this._renderPointLayers();return[!e&&t,n,r,e&&t]}getSubLayerAccessor(e){let{binary:t}=this.state;return!t||typeof e!=`function`?super.getSubLayerAccessor(e):(t,n)=>{let{data:r,index:i}=n;return e(WF(r,i),n)}}};aL.layerName=`GeoJsonLayer`,aL.defaultProps=iL;var oL=n({ArcLayer:()=>mN,BitmapLayer:()=>TN,ColumnLayer:()=>JP,GeoJsonLayer:()=>aL,GridCellLayer:()=>XP,IconLayer:()=>FN,LineLayer:()=>LN,PathLayer:()=>uF,PointCloudLayer:()=>VN,PolygonLayer:()=>UF,ScatterplotLayer:()=>WN,SolidPolygonLayer:()=>zF,TextLayer:()=>HI,_MultiIconLayer:()=>tI,_TextBackgroundLayer:()=>LI}),sL={...UF.defaultProps},cL=class extends fx{indexToBounds(){return null}renderLayers(){let{elevationScale:e,extruded:t,wireframe:n,filled:r,stroked:i,lineWidthUnits:a,lineWidthScale:o,lineWidthMinPixels:s,lineWidthMaxPixels:c,lineJointRounded:l,lineMiterLimit:u,lineDashJustified:d,getElevation:f,getFillColor:p,getLineColor:m,getLineWidth:h}=this.props,{updateTriggers:g,material:_,transitions:v}=this.props,y=this.getSubLayerClass(`cell`,UF),{updateTriggers:b,...x}=this.indexToBounds()||{};return new y({filled:r,wireframe:n,extruded:t,elevationScale:e,stroked:i,lineWidthUnits:a,lineWidthScale:o,lineWidthMinPixels:s,lineWidthMaxPixels:c,lineJointRounded:l,lineMiterLimit:u,lineDashJustified:d,material:_,transitions:v,getElevation:f,getFillColor:p,getLineColor:m,getLineWidth:h},this.getSubLayerProps({id:`cell`,updateTriggers:g&&{...b,getElevation:g.getElevation,getFillColor:g.getFillColor,getLineColor:g.getLineColor,getLineWidth:g.getLineWidth}}),x)}};cL.layerName=`GeoCellLayer`,cL.defaultProps=sL;var lL=Object.defineProperty,uL=(e,t)=>{for(var n in t)lL(e,n,{get:t[n],enumerable:!0})},dL={};uL(dL,{ARRAY_TYPE:()=>pL,EPSILON:()=>fL,RANDOM:()=>mL,equals:()=>vL,setMatrixArrayType:()=>hL,toRadian:()=>_L});var fL=1e-6,pL=typeof Float32Array<`u`?Float32Array:Array,mL=Math.random;function hL(e){pL=e}var gL=Math.PI/180;function _L(e){return e*gL}function vL(e,t){return Math.abs(e-t)<=fL*Math.max(1,Math.abs(e),Math.abs(t))}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var yL={};uL(yL,{LDU:()=>LL,add:()=>RL,adjoint:()=>OL,clone:()=>xL,copy:()=>SL,create:()=>bL,determinant:()=>kL,equals:()=>VL,exactEquals:()=>BL,frob:()=>IL,fromRotation:()=>NL,fromScaling:()=>PL,fromValues:()=>wL,identity:()=>CL,invert:()=>DL,mul:()=>WL,multiply:()=>AL,multiplyScalar:()=>HL,multiplyScalarAndAdd:()=>UL,rotate:()=>jL,scale:()=>ML,set:()=>TL,str:()=>FL,sub:()=>KL,subtract:()=>zL,transpose:()=>EL});function bL(){var e=new pL(4);return pL!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function xL(e){var t=new pL(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function SL(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function CL(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}function wL(e,t,n,r){var i=new pL(4);return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i}function TL(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function EL(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}function DL(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n*a-i*r;return o?(o=1/o,e[0]=a*o,e[1]=-r*o,e[2]=-i*o,e[3]=n*o,e):null}function OL(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}function kL(e){return e[0]*e[3]-e[2]*e[1]}function AL(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=n[0],c=n[1],l=n[2],u=n[3];return e[0]=r*s+a*c,e[1]=i*s+o*c,e[2]=r*l+a*u,e[3]=i*l+o*u,e}function jL(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c+a*s,e[1]=i*c+o*s,e[2]=r*-s+a*c,e[3]=i*-s+o*c,e}function ML(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=n[0],c=n[1];return e[0]=r*s,e[1]=i*s,e[2]=a*c,e[3]=o*c,e}function NL(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=-n,e[3]=r,e}function PL(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}function FL(e){return`mat2(`+e[0]+`, `+e[1]+`, `+e[2]+`, `+e[3]+`)`}function IL(e){return Math.hypot(e[0],e[1],e[2],e[3])}function LL(e,t,n,r){return e[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-e[2]*n[1],[e,t,n]}function RL(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function zL(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}function BL(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function VL(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],c=t[2],l=t[3];return Math.abs(n-o)<=fL*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-s)<=fL*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-c)<=fL*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(a-l)<=fL*Math.max(1,Math.abs(a),Math.abs(l))}function HL(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function UL(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e}var WL=AL,KL=zL;function qL(){var e=new pL(9);return pL!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}var JL={};uL(JL,{add:()=>Oz,calculateW:()=>pz,clone:()=>wz,conjugate:()=>bz,copy:()=>Ez,create:()=>iz,dot:()=>jz,equals:()=>zz,exactEquals:()=>Rz,exp:()=>mz,fromEuler:()=>Sz,fromMat3:()=>xz,fromValues:()=>Tz,getAngle:()=>cz,getAxisAngle:()=>sz,identity:()=>az,invert:()=>yz,len:()=>Pz,length:()=>Nz,lerp:()=>Mz,ln:()=>hz,mul:()=>kz,multiply:()=>lz,normalize:()=>Lz,pow:()=>gz,random:()=>vz,rotateX:()=>uz,rotateY:()=>dz,rotateZ:()=>fz,rotationTo:()=>Bz,scale:()=>Az,set:()=>Dz,setAxes:()=>Hz,setAxisAngle:()=>oz,slerp:()=>_z,sqlerp:()=>Vz,sqrLen:()=>Iz,squaredLength:()=>Fz,str:()=>Cz});var YL={};uL(YL,{add:()=>nR,angle:()=>jR,bezier:()=>CR,ceil:()=>oR,clone:()=>ZL,copy:()=>eR,create:()=>XL,cross:()=>bR,dist:()=>zR,distance:()=>pR,div:()=>RR,divide:()=>aR,dot:()=>yR,equals:()=>FR,exactEquals:()=>PR,floor:()=>sR,forEach:()=>UR,fromValues:()=>$L,hermite:()=>SR,inverse:()=>_R,len:()=>VR,length:()=>QL,lerp:()=>xR,max:()=>lR,min:()=>cR,mul:()=>LR,multiply:()=>iR,negate:()=>gR,normalize:()=>vR,random:()=>wR,rotateX:()=>OR,rotateY:()=>kR,rotateZ:()=>AR,round:()=>uR,scale:()=>dR,scaleAndAdd:()=>fR,set:()=>tR,sqrDist:()=>BR,sqrLen:()=>HR,squaredDistance:()=>mR,squaredLength:()=>hR,str:()=>NR,sub:()=>IR,subtract:()=>rR,transformMat3:()=>ER,transformMat4:()=>TR,transformQuat:()=>DR,zero:()=>MR});function XL(){var e=new pL(3);return pL!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function ZL(e){var t=new pL(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function QL(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function $L(e,t,n){var r=new pL(3);return r[0]=e,r[1]=t,r[2]=n,r}function eR(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function tR(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function nR(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function rR(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function iR(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function aR(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function oR(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function sR(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function cR(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function lR(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function uR(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}function dR(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function fR(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e}function pR(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return Math.hypot(n,r,i)}function mR(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i}function hR(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r}function gR(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function _R(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function vR(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function yR(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function bR(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],c=n[2];return e[0]=i*c-a*s,e[1]=a*o-r*c,e[2]=r*s-i*o,e}function xR(e,t,n,r){var i=t[0],a=t[1],o=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=o+r*(n[2]-o),e}function SR(e,t,n,r,i,a){var o=a*a,s=o*(2*a-3)+1,c=o*(a-2)+a,l=o*(a-1),u=o*(3-2*a);return e[0]=t[0]*s+n[0]*c+r[0]*l+i[0]*u,e[1]=t[1]*s+n[1]*c+r[1]*l+i[1]*u,e[2]=t[2]*s+n[2]*c+r[2]*l+i[2]*u,e}function CR(e,t,n,r,i,a){var o=1-a,s=o*o,c=a*a,l=s*o,u=3*a*s,d=3*c*o,f=c*a;return e[0]=t[0]*l+n[0]*u+r[0]*d+i[0]*f,e[1]=t[1]*l+n[1]*u+r[1]*d+i[1]*f,e[2]=t[2]*l+n[2]*u+r[2]*d+i[2]*f,e}function wR(e,t){t||=1;var n=mL()*2*Math.PI,r=mL()*2-1,i=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(n)*i,e[1]=Math.sin(n)*i,e[2]=r*t,e}function TR(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o||=1,e[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,e[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,e[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,e}function ER(e,t,n){var r=t[0],i=t[1],a=t[2];return e[0]=r*n[0]+i*n[3]+a*n[6],e[1]=r*n[1]+i*n[4]+a*n[7],e[2]=r*n[2]+i*n[5]+a*n[8],e}function DR(e,t,n){var r=n[0],i=n[1],a=n[2],o=n[3],s=t[0],c=t[1],l=t[2],u=i*l-a*c,d=a*s-r*l,f=r*c-i*s,p=i*f-a*d,m=a*u-r*f,h=r*d-i*u,g=o*2;return u*=g,d*=g,f*=g,p*=2,m*=2,h*=2,e[0]=s+u+p,e[1]=c+d+m,e[2]=l+f+h,e}function OR(e,t,n,r){var i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function kR(e,t,n,r){var i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function AR(e,t,n,r){var i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function jR(e,t){var n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],s=t[2],c=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(a*a+o*o+s*s),l=c&&yR(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}function MR(e){return e[0]=0,e[1]=0,e[2]=0,e}function NR(e){return`vec3(`+e[0]+`, `+e[1]+`, `+e[2]+`)`}function PR(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function FR(e,t){var n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],s=t[2];return Math.abs(n-a)<=fL*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=fL*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=fL*Math.max(1,Math.abs(i),Math.abs(s))}var IR=rR,LR=iR,RR=aR,zR=pR,BR=mR,VR=QL,HR=hR,UR=function(){var e=XL();return function(t,n,r,i,a,o){var s,c;for(n||=3,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;s0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=r*o,e[2]=i*o,e[3]=a*o,e}function ez(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function tz(e,t,n,r){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=o+r*(n[2]-o),e[3]=s+r*(n[3]-s),e}function nz(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function rz(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],c=t[2],l=t[3];return Math.abs(n-o)<=fL*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-s)<=fL*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-c)<=fL*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(a-l)<=fL*Math.max(1,Math.abs(a),Math.abs(l))}(function(){var e=WR();return function(t,n,r,i,a,o){var s,c;for(n||=4,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;sfL?(e[0]=t[0]/r,e[1]=t[1]/r,e[2]=t[2]/r):(e[0]=1,e[1]=0,e[2]=0),n}function cz(e,t){var n=jz(e,t);return Math.acos(2*n*n-1)}function lz(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=n[0],c=n[1],l=n[2],u=n[3];return e[0]=r*u+o*s+i*l-a*c,e[1]=i*u+o*c+a*s-r*l,e[2]=a*u+o*l+r*c-i*s,e[3]=o*u-r*s-i*c-a*l,e}function uz(e,t,n){n*=.5;var r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c+o*s,e[1]=i*c+a*s,e[2]=a*c-i*s,e[3]=o*c-r*s,e}function dz(e,t,n){n*=.5;var r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c-a*s,e[1]=i*c+o*s,e[2]=a*c+r*s,e[3]=o*c-i*s,e}function fz(e,t,n){n*=.5;var r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c+i*s,e[1]=i*c-r*s,e[2]=a*c+o*s,e[3]=o*c-a*s,e}function pz(e,t){var n=t[0],r=t[1],i=t[2];return e[0]=n,e[1]=r,e[2]=i,e[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),e}function mz(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=Math.sqrt(n*n+r*r+i*i),s=Math.exp(a),c=o>0?s*Math.sin(o)/o:0;return e[0]=n*c,e[1]=r*c,e[2]=i*c,e[3]=s*Math.cos(o),e}function hz(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=Math.sqrt(n*n+r*r+i*i),s=o>0?Math.atan2(o,a)/o:0;return e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=.5*Math.log(n*n+r*r+i*i+a*a),e}function gz(e,t,n){return hz(e,t),Az(e,e,n),mz(e,e),e}function _z(e,t,n,r){var i=t[0],a=t[1],o=t[2],s=t[3],c=n[0],l=n[1],u=n[2],d=n[3],f,p=i*c+a*l+o*u+s*d,m,h,g;return p<0&&(p=-p,c=-c,l=-l,u=-u,d=-d),1-p>fL?(f=Math.acos(p),m=Math.sin(f),h=Math.sin((1-r)*f)/m,g=Math.sin(r*f)/m):(h=1-r,g=r),e[0]=h*i+g*c,e[1]=h*a+g*l,e[2]=h*o+g*u,e[3]=h*s+g*d,e}function vz(e){var t=mL(),n=mL(),r=mL(),i=Math.sqrt(1-t),a=Math.sqrt(t);return e[0]=i*Math.sin(2*Math.PI*n),e[1]=i*Math.cos(2*Math.PI*n),e[2]=a*Math.sin(2*Math.PI*r),e[3]=a*Math.cos(2*Math.PI*r),e}function yz(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=a*s,e}function bz(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function xz(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+o]-t[o*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[o]=(t[o*3+i]+t[i*3+o])*r}return e}function Sz(e,t,n,r){var i=.5*Math.PI/180;t*=i,n*=i,r*=i;var a=Math.sin(t),o=Math.cos(t),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return e[0]=a*c*u-o*s*l,e[1]=o*s*u+a*c*l,e[2]=o*c*l-a*s*u,e[3]=o*c*u+a*s*l,e}function Cz(e){return`quat(`+e[0]+`, `+e[1]+`, `+e[2]+`, `+e[3]+`)`}var wz=GR,Tz=KR,Ez=qR,Dz=JR,Oz=YR,kz=lz,Az=XR,jz=ez,Mz=tz,Nz=ZR,Pz=Nz,Fz=QR,Iz=Fz,Lz=$R,Rz=nz,zz=rz,Bz=function(){var e=XL(),t=$L(1,0,0),n=$L(0,1,0);return function(r,i,a){var o=yR(i,a);return o<-.999999?(bR(e,t,i),VR(e)<1e-6&&bR(e,n,i),vR(e,e),oz(r,e,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(bR(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+o,Lz(r,r))}}(),Vz=function(){var e=iz(),t=iz();return function(n,r,i,a,o,s){return _z(e,r,o,s),_z(t,i,a,s),_z(n,e,t,2*s*(1-s)),n}}(),Hz=function(){var e=qL();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Lz(t,xz(t,e))}}(),Uz={};uL(Uz,{add:()=>Yz,angle:()=>SB,ceil:()=>$z,clone:()=>Gz,copy:()=>qz,create:()=>Wz,cross:()=>mB,dist:()=>jB,distance:()=>oB,div:()=>AB,divide:()=>Qz,dot:()=>pB,equals:()=>EB,exactEquals:()=>TB,floor:()=>eB,forEach:()=>PB,fromValues:()=>Kz,inverse:()=>dB,len:()=>DB,length:()=>cB,lerp:()=>hB,max:()=>nB,min:()=>tB,mul:()=>kB,multiply:()=>Zz,negate:()=>uB,normalize:()=>fB,random:()=>gB,rotate:()=>xB,round:()=>rB,scale:()=>iB,scaleAndAdd:()=>aB,set:()=>Jz,sqrDist:()=>MB,sqrLen:()=>NB,squaredDistance:()=>sB,squaredLength:()=>lB,str:()=>wB,sub:()=>OB,subtract:()=>Xz,transformMat2:()=>_B,transformMat2d:()=>vB,transformMat3:()=>yB,transformMat4:()=>bB,zero:()=>CB});function Wz(){var e=new pL(2);return pL!=Float32Array&&(e[0]=0,e[1]=0),e}function Gz(e){var t=new pL(2);return t[0]=e[0],t[1]=e[1],t}function Kz(e,t){var n=new pL(2);return n[0]=e,n[1]=t,n}function qz(e,t){return e[0]=t[0],e[1]=t[1],e}function Jz(e,t,n){return e[0]=t,e[1]=n,e}function Yz(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function Xz(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function Zz(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}function Qz(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}function $z(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function eB(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function tB(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function nB(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}function rB(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}function iB(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function aB(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e}function oB(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.hypot(n,r)}function sB(e,t){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function cB(e){var t=e[0],n=e[1];return Math.hypot(t,n)}function lB(e){var t=e[0],n=e[1];return t*t+n*n}function uB(e,t){return e[0]=-t[0],e[1]=-t[1],e}function dB(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function fB(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e}function pB(e,t){return e[0]*t[0]+e[1]*t[1]}function mB(e,t,n){var r=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=r,e}function hB(e,t,n,r){var i=t[0],a=t[1];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e}function gB(e,t){t||=1;var n=mL()*2*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e}function _B(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e}function vB(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e}function yB(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[3]*i+n[6],e[1]=n[1]*r+n[4]*i+n[7],e}function bB(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e}function xB(e,t,n,r){var i=t[0]-n[0],a=t[1]-n[1],o=Math.sin(r),s=Math.cos(r);return e[0]=i*s-a*o+n[0],e[1]=i*o+a*s+n[1],e}function SB(e,t){var n=e[0],r=e[1],i=t[0],a=t[1],o=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+a*a),s=o&&(n*i+r*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function CB(e){return e[0]=0,e[1]=0,e}function wB(e){return`vec2(`+e[0]+`, `+e[1]+`)`}function TB(e,t){return e[0]===t[0]&&e[1]===t[1]}function EB(e,t){var n=e[0],r=e[1],i=t[0],a=t[1];return Math.abs(n-i)<=fL*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=fL*Math.max(1,Math.abs(r),Math.abs(a))}var DB=cB,OB=Xz,kB=Zz,AB=Qz,jB=oB,MB=sB,NB=lB,PB=function(){var e=Wz();return function(t,n,r,i,a,o){var s,c;for(n||=2,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;s=0}getVertices(){return this.vertices}scale(e){for(let t of this.vertices)Uz.scale(t,t,e);return this}rotate180(){for(let e of this.vertices)Uz.negate(e,e);return this}reflectY(){for(let e of this.vertices)e[1]=-e[1];return this.vertices.reverse(),this}translate(e){for(let t of this.vertices)Uz.add(t,t,e);return this}transform(e){for(let t of this.vertices)Uz.transformMat2(t,t,e);return this}transform2d(e){for(let t of this.vertices)Uz.transformMat2d(t,t,e);return this}clone(){return new e(this.vertices.map(e=>Uz.clone(e)))}getCenter(){let e=this.vertices.length;return this.vertices.reduce((t,n)=>[t[0]+n[0]/e,t[1]+n[1]/e],[0,0])}containsPoint(e){if(!this.isWindingCorrect())throw Error(`Pentagon is not counter-clockwise`);let t=this.vertices.length,n=1;for(let r=0;r{Uz.scale(e,e,$B),Uz.rotate(e,e,[0,0],QB)});var eV=new GB([KB,qB,JB,YB,XB]),tV=Math.atan2(JB[1],JB[0])-LB,nV=[0,0],rV=VB/Math.cos(LB),iV=tV+LB,aV=[rV*Math.cos(iV),rV*Math.sin(iV)],oV=tV-LB,sV=[rV*Math.cos(oV),rV*Math.sin(oV)],cV=new GB([nV,aV,sV]),lV=yL.fromValues(aV[0],aV[1],sV[0],sV[1]);yL.invert(yL.create(),lV);var uV=new Float64Array([-.0022392098386786394,21308606513250217e-22,-2.559257686421274e-9,33701965267802837e-28,-4667545312611249e-30,667492870384816e-32]),dV=new Float64Array([.0022392089963541657,28831978048607556e-22,5.08622073997266e-9,102018123778161e-25,21912872306767718e-30,49284235482523806e-33]),fV=class{applyCoefficients(e,t){let n=Math.sin(e),r=Math.cos(e),i=2*(r-n)*(r+n),a,o;return a=i*t[5]+t[4],o=i*a+t[3],a=i*o-a+t[2],o=i*a-o+t[1],a=i*o-a+t[0],e+2*n*r*a}forward(e){return this.applyCoefficients(e,uV)}inverse(e){return this.applyCoefficients(e,dV)}};dL.setMatrixArrayType(Float64Array);var pV=new fV;function mV(e){return Math.PI/180*e}function hV(e){return 180/Math.PI*e}function gV(e){return[Uz.length(e),Math.atan2(e[1],e[0])]}function _V([e,t]){return[e*Math.cos(t),e*Math.sin(t)]}function vV(e,[t,n,r]){let i=[t[0]-r[0],t[1]-r[1]],a=[r[0]-n[0],r[1]-n[1]],o=[e[0]-r[0],e[1]-r[1]],s=a[0]*i[1]-a[1]*i[0],c=(a[0]*o[1]-a[1]*o[0])/s,l=(i[0]*o[1]-i[1]*o[0])/s;return[c,l,1-(c+l)]}function yV(e,[t,n,r]){return[e[0]*t[0]+e[1]*n[0]+e[2]*r[0],e[0]*t[1]+e[1]*n[1]+e[2]*r[1]]}function bV(e){let t=Math.atan2(e[1],e[0]),n=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);return[t,Math.acos(e[2]/n)]}function xV([e,t]){let n=Math.sin(t);return[n*Math.cos(e),n*Math.sin(e),Math.cos(t)]}var SV=93;function CV([e,t]){let n=mV(e+SV),r=mV(t),i=pV.forward(r);return[n,Math.PI/2-i]}function wV(e){return((e+180)%360+360)%360-180}function TV([e,t]){let n=wV(hV(e)-SV),r=Math.PI/2-t;return[n,hV(pV.inverse(r))]}function EV(e){let t=e.map(e=>xV(CV(e))),n=YL.create();for(let e of t)YL.add(n,n,e);YL.normalize(n,n);let[r,i]=TV(bV(n));return(i>89.99||i<-89.99)&&(r=e[0][0]),r=wV(r),e.map(e=>{let[t,n]=e;for(;t-r>180;)t-=360;for(;t-r<-180;)t+=360;return[t,n]})}dL.setMatrixArrayType(Float64Array);var DV=Math.sqrt(5),OV=Math.sqrt(.2),kV=Math.sqrt((1-OV)/2),AV=Math.sqrt((1+OV)/2),jV=.5,MV=Math.sqrt((2.5-DV)/10),NV=Math.sqrt((2.5+DV)/10),PV=Math.sqrt((1+OV)/8),FV=Math.sqrt((1-OV)/8),IV=Math.sqrt((3-DV)/8),LV=Math.sqrt((3+DV)/8),RV=[[0,0],[kV,0],[MV,jV],[-PV,IV],[-PV,-IV],[MV,-jV],[-AV,0],[-FV,-LV],[NV,-jV],[NV,jV],[-FV,LV],[0,0]].map(([e,t])=>[-t,e]).map((e,t)=>t===0?[0,0,0,1]:t===11?[0,-1,0,0]:[...e,0,t<6?AV:kV]);dL.setMatrixArrayType(Float64Array);var zV=[`vu`,`uw`,`vw`,`vw`,`vw`],BV=[`wu`,`uw`,`vw`,`vu`,`uw`],VV=[`wu`,`uv`,`wv`,`wu`,`uw`],HV=[`vu`,`uv`,`wv`,`wu`,`uw`],UV=[zV,HV,VV,BV,VV,HV,VV,BV,BV,BV,HV,HV],WV=[4,2,3,2,0,4,3,2,2,0,3,0],GV=[0,1,2,4,3,5,7,8,6,11,10,9],KV=[];function qV(){YV([0,0],0,RV[0]);for(let e=0;e<5;e++){let t=e*IB,n=t+LB;YV([t,BB],LB,RV[e+1]),YV([n,Math.PI-BB],LB,RV[(e+3)%5+6])}YV([0,Math.PI],0,RV[11])}var JV=0;function YV(e,t,n){if(JV>11)throw Error(`Too many origins: ${JV}`);let r=JL.create();JL.conjugate(r,n);let i={id:JV,axis:e,quat:n,inverseQuat:r,angle:t,orientation:UV[JV],firstQuintant:WV[JV]};KV.push(i),JV++}qV(),KV.sort((e,t)=>GV.indexOf(e.id)-GV.indexOf(t.id)),KV.forEach((e,t)=>e.id=t);function XV(e,t){let n=t.orientation,r=n===zV||n===BV?-1:1,i=(e-t.firstQuintant+5)%5,a=n[i];return{quintant:(t.firstQuintant+r*i+5)%5,orientation:a}}var ZV=class{forward([e,t]){return[Math.tan(t),e]}inverse([e,t]){return[t,Math.atan(e)]}},QV=YL.create(),$V=YL.create(),eH=YL.create(),tH=YL.create();function nH(e,t){YL.lerp(QV,e,t,.5),YL.normalize(QV,QV),YL.cross(QV,e,QV);let n=YL.length(QV);if(n<1e-8){let n=YL.subtract(YL.create(),e,t);return .5*YL.length(n)}return n}function rH(e,t,n){return YL.cross($V,t,n),YL.dot(e,$V)}function iH(e,t,n,r,i){YL.cross($V,r,i);let a=YL.dot(t,$V),o=YL.dot(n,$V);return YL.scale(eH,t,o),YL.scale(tH,n,a),YL.sub(e,tH,eH)}function aH(e,t,n,r){let i=YL.angle(t,n);if(i<1e-12)return YL.lerp(e,t,n,r);let a=Math.sin((1-r)*i)/Math.sin(i),o=Math.sin(r*i)/Math.sin(i),s=YL.scale(YL.create(),t,a),c=YL.scale(YL.create(),n,o);return YL.add(e,s,c)}dL.setMatrixArrayType(Float64Array);var oH=YL.create(),sH=YL.create(),cH=YL.create(),lH=YL.create(),uH=class{constructor(e){this._area=null,this.vertices=e,Object.freeze(this.vertices)}getBoundary(e=1,t=!0){let n=[],r=this.vertices.length;for(let t=0;t0))debugger}};dL.setMatrixArrayType(Float64Array);var dH=class extends uH{constructor(e){if(e.length!==3)throw Error(`SphericalTriangleShape requires exactly 3 vertices`);super(e)}};dL.setMatrixArrayType(Float64Array);var fH=class{forward(e,t,n){let[r,i,a]=t,o=new dH([r,i,a]),s=YL.subtract(YL.create(),e,r);YL.normalize(s,s);let c=iH(YL.create(),r,s,i,a);YL.normalize(c,c);let l=nH(r,e)/nH(r,c),u=l/o.getArea();return yV([1-l,u*new dH([r,c,a]).getArea(),u*new dH([r,i,c]).getArea()],n)}inverse(e,t,n){let[r,i,a]=n,o=new dH([r,i,a]),s=vV(e,t),c=.99999999999999;if(s[0]>c)return r;if(s[1]>c)return i;if(s[2]>c)return a;let l=YL.create();YL.cross(l,i,a);let u=o.getArea(),d=1-s[0],f=s[2]/d*u,p=Math.sin(f),m=Math.sin(f/2),h=2*m*m,g=YL.dot(r,i),_=YL.dot(i,a),v=YL.dot(a,r),y=YL.length(l),b=p*YL.dot(r,l)+h*(g*_-v),x=h*y*(1+g),S=2/Math.acos(_)*Math.atan2(x,b),C=aH(YL.create(),i,a,S),w=nH(r,C);return aH([0,0,0],r,C,this.safeAcos(d*w)/this.safeAcos(w))}safeAcos(e){return e<.001?2*e+e*e*e/3:Math.acos(1-2*e*e)}},pH=-1,mH=1;dL.setMatrixArrayType(Float64Array);var hH=([e,t])=>Uz.fromValues(e-t,t);dL.setMatrixArrayType(Float64Array);var gH=Uz.fromValues(1,0),_H=Uz.fromValues(0,1),vH=Uz.negate(Uz.create(),gH),yH=Uz.negate(Uz.create(),_H),bH=Uz.fromValues(0,0),xH=(e,[t,n])=>{let r=bH,i=bH;switch(t===mH&&n===mH?(r=gH,i=_H):t===pH&&n===mH?(r=yH,i=vH):t===mH&&n===pH?(r=_H,i=gH):t===pH&&n===pH&&(r=vH,i=yH),e){case 0:return bH;case 1:return r;case 2:return Uz.add(Uz.create(),i,r);case 3:return Uz.scaleAndAdd(Uz.create(),i,r,2);default:throw Error(`Invalid Quaternary value: ${e}`)}},SH=e=>[[mH,mH],[mH,pH],[mH,mH],[pH,mH]][e];function CH(e){return Array.from({length:e.length},(t,n)=>e.indexOf(n))}var wH=[0,1,3,4,5,6,7,2],TH=[0,1,2,7,3,4,5,6];CH(wH),CH(TH);var EH=(e,t,n,r,i)=>{if(t<=0)return;let a=e[t]||0,o=e[t-1],s=n[0]+n[1],c=!0,l=!0;if(r===(s===0)?(c=a<2,l=a===0):(c=a===1||a===2,l=a===1),!c)return;let u=l?o:o+4,d=i[u];e[t-1]=d%4,e[t]=(a+4+Math.floor(d/4)-Math.floor(u/4))%4};dL.setMatrixArrayType(Float64Array);var DH=Uz.fromValues(-1,1),OH=!0,kH=(e,t,n,r=OH)=>{let i=BigInt(e),a=n===`vu`||n===`wu`||n===`vw`,o=n===`wv`||n===`vw`,s=n===`wu`||n===`uw`;a&&(i=(1n<{let a=Uz.create(),o=[mH,mH],s=BigInt(e),c=[];for(;s>0n||c.length>=2n;let l=r?TH:wH;for(let e=c.length-1;e>=0;e--)i&&EH(c,e,o,n,l),Uz.multiply(o,o,SH(c[e]));o[0]=mH,o[1]=mH;for(let e=c.length-1;e>=0;e--){Uz.scale(a,a,2);let t=xH(c[e],o);Uz.add(a,a,t),Uz.multiply(o,o,SH(c[e]))}return{q:c[0]||0,offset:hH(a),flips:o}},jH=.1;jH*Math.cos(45*Math.PI/180),jH*Math.sin(45*Math.PI/180),jH*Math.cos(113*Math.PI/180),jH*Math.sin(113*Math.PI/180),jH*Math.cos(293*Math.PI/180),jH*Math.sin(293*Math.PI/180),jH*Math.cos(225*Math.PI/180),jH*Math.sin(225*Math.PI/180),dL.setMatrixArrayType(Float64Array);var MH=Uz.clone(sV),NH=Uz.negate(Uz.create(),sV),PH=[0,1,2,3,4].map(e=>{let t=yL.create();return yL.fromRotation(t,IB*e),t}),FH=Uz.create();function IH(e,t,n){let r=eV.clone();Uz.transformMat2(FH,n.offset,lV),n.flips[0]===mH&&n.flips[1]===pH&&r.rotate180();let{q:i}=n,a=n.flips[0]+n.flips[1];return((a===-2||a===2)&&i>1||a===0&&(i===0||i===3))&&r.reflectY(),n.flips[0]===pH&&n.flips[1]===pH?r.rotate180():n.flips[0]===pH?r.translate(NH):n.flips[1]===pH&&r.translate(MH),r.translate(FH),r.scale(1/2**e),r.transform(PH[t]),r}function LH(e){let t=cV.clone();return t.transform(PH[e]),t}function RH(){let e=[];for(let t of PH)e.push(Uz.transformMat2(Uz.create(),aV,t));return e.reverse(),new GB(e)}dL.setMatrixArrayType(Float64Array);var zH=class{constructor(){if(this.vertices=[],this.invocations=0,this.addFaceCenters(),this.addVertices(),this.addMidpoints(),this.vertices.length!==62)throw Error(`Failed to construct CRS: vertices length is not 62`);Object.freeze(this.vertices)}getVertex(e){this.invocations++,this.invocations===1e4&&console.warn(`Too many CRS invocations, results should be cached`);for(let t of this.vertices)if(YL.distance(e,t)<1e-5)return t;throw Error(`Failed to find vertex in CRS`)}addFaceCenters(){KV.forEach(e=>this.add(xV(e.axis)))}addVertices(){let e=Math.atan(HB);for(let t of KV)for(let n=0;n<5;n++){let r=xV([(2*n+1)*Math.PI/5+t.angle,e]);YL.transformQuat(r,r,t.quat),this.add(r)}}addMidpoints(){let e=Math.atan(VB);for(let t of KV)for(let n=0;n<5;n++){let r=xV([2*n*Math.PI/5+t.angle,e]);YL.transformQuat(r,r,t.quat),this.add(r)}}add(e){let t=YL.normalize(YL.create(),e);return this.vertices.find(e=>YL.distance(t,e)<1e-5)?!1:(this.vertices.push(t),!0)}};dL.setMatrixArrayType(Float64Array);var BH=new zH,VH=class{constructor(){this.faceTriangles=[],this.sphericalTriangles=[],this.polyhedral=new fH,this.gnomonic=new ZV}forward(e,t){let n=KV[t],r=xV(e),i=YL.create();YL.transformQuat(i,r,n.inverseQuat);let a=bV(i),o=this.gnomonic.forward(a);o[1]-=n.angle;let s=this.getFaceTriangleIndex(o),c=this.shouldReflect(o),l=this.getFaceTriangle(s,c,!1),u=this.getSphericalTriangle(s,t,c);return this.polyhedral.forward(r,u,l)}inverse(e,t){let n=gV(e),r=this.getFaceTriangleIndex(n),i=this.shouldReflect(n),a=this.getFaceTriangle(r,i,!1),o=this.getSphericalTriangle(r,t,i);return bV(this.polyhedral.inverse(e,a,o))}shouldReflect(e){let[t,n]=e;return _V([t,this.normalizeGamma(n)])[0]>VB}getFaceTriangleIndex([e,t]){return(Math.floor(t/LB)+10)%10}getFaceTriangle(e,t=!1,n=!1){let r=e;return t&&(r+=n?20:10),this.faceTriangles[r]?this.faceTriangles[r]:(this.faceTriangles[r]=t?this._getReflectedFaceTriangle(e,n):this._getFaceTriangle(e),Object.freeze(this.faceTriangles[r]),this.faceTriangles[r])}_getFaceTriangle(e){let[t,n,r]=LH(Math.floor((e+1)/2)%5).getVertices(),i=Uz.create();return Uz.lerp(i,n,r,.5),e%2==0?[t,i,n]:[t,r,i]}_getReflectedFaceTriangle(e,t=!1){let[n,r,i]=this._getFaceTriangle(e).map(e=>Uz.clone(e)),a=e%2==0;Uz.negate(n,n);let o=a?r:i;return Uz.scaleAndAdd(n,n,o,t?1+1/Math.cos(BB):2),[n,i,r]}getSphericalTriangle(e,t,n=!1){let r=10*t+e;return n&&(r+=120),this.sphericalTriangles[r]?this.sphericalTriangles[r]:(this.sphericalTriangles[r]=this._getSphericalTriangle(e,t,n),Object.freeze(this.sphericalTriangles[r]),this.sphericalTriangles[r])}_getSphericalTriangle(e,t,n=!1){let r=KV[t];return this.getFaceTriangle(e,n,!0).map(e=>{let[t,n]=gV(e),i=[t,n+r.angle],a=xV(this.gnomonic.inverse(i));return YL.transformQuat(a,a,r.quat),BH.getVertex(a)})}normalizeGamma(e){let t=e/IB;return(t-Math.round(t))*IB}},HH=2,UH=30,WH=58n;function GH(e){if(e===0n)return-1;if(e&1n||(e&7n)==4n||(e&31n)==16n)return UH;let t=UH-1,n=e>>1n;if(n===0n)return-1;let r=Number(n&4294967295n),i;for(r===0?(n>>=32n,t-=16,i=Number(n)):i=r,i&65535||(i>>=16,t-=8),t>=6&&!(i&255)&&(i>>=8,t-=4),t>=4&&!(i&15)&&(i>>=4,t-=2);t>-1&&!(i&1);)--t,i>>=t>n)+r,a,o;if(t===0?(a=KV[i],o=0):(a=KV[Math.floor(i/5)],o=(i+a.firstQuintant)%5),!a)throw Error(`Could not parse origin: ${i}`);if(t>n-c;return{origin:a,segment:o,S:l,resolution:t}}dL.setMatrixArrayType(Float64Array),yL.create();var qH=new VH;function JH({S:e,segment:t,origin:n,resolution:r}){let{quintant:i,orientation:a}=XV(t,n);if(r===HH-1)return LH(i);if(r===HH-2)return RH();let o=r-HH+1;return IH(o,i,kH(e,o,a))}function YH(e,{closedRing:t=!0,segments:n=`auto`}={closedRing:!0,segments:`auto`}){if(e===0n)return[];let{S:r,segment:i,origin:a,resolution:o}=KH(e);n===`auto`&&(n=Math.max(1,2**(6-o)));let s=EV(JH({S:r,segment:i,origin:a,resolution:o}).splitEdges(n).getVertices().map(e=>qH.inverse(e,a.id)).map(e=>TV(e)));return t&&s.push(s[0]),s.reverse(),s}function XH(e){return BigInt(`0x${e}`)}var ZH=2,QH=ZH*WB/Math.sqrt(15),$H=Array(31);$H[0]=ZH*WB/Math.sqrt(3);for(let e=1;e<=30;e++)$H[e]=QH/(1<>0]=t;break;case`i8`:k[e>>0]=t;break;case`i16`:j[e>>1]=t;break;case`i32`:M[e>>2]=t;break;case`i64`:be=[t>>>0,(H=t,+fe(H)>=1?H>0?(R(+me(H/4294967296),4294967295)|0)>>>0:~~+pe((H-+(~~H>>>0))/4294967296)>>>0:0)],M[e>>2]=be[0],M[e+4>>2]=be[1];break;case`float`:N[e>>2]=t;break;case`double`:P[e>>3]=t;break;default:Ge(`invalid type for setValue: `+n)}}function h(e,t,n){switch(t||=`i8`,t.charAt(t.length-1)===`*`&&(t=`i32`),t){case`i1`:return k[e>>0];case`i8`:return k[e>>0];case`i16`:return j[e>>1];case`i32`:return M[e>>2];case`i64`:return M[e>>2];case`float`:return N[e>>2];case`double`:return P[e>>3];default:Ge(`invalid type for getValue: `+t)}return null}var g=!1;function _(e,t){e||Ge(`Assertion failed: `+t)}function v(e){var n=t[`_`+e];return _(n,`Cannot call unknown function `+e+`, make sure it is exported`),n}function y(e,t,n,r,i){var a={string:function(e){var t=0;if(e!=null&&e!==0){var n=(e.length<<2)+1;t=Le(n),T(e,t,n)}return t},array:function(e){var t=Le(e.length);return E(e,t),t}};function o(e){return t===`string`?C(e):t===`boolean`?!!e:e}var s=v(e),c=[],l=0;if(r)for(var u=0;u=r);)++i;if(i-t>16&&e.subarray&&x)return x.decode(e.subarray(t,i));for(var a=``;t>10,56320|l&1023)}}return a}function C(e,t){return e?S(A,e,t):``}function w(e,t,n,r){if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o=55296&&s<=57343){var c=e.charCodeAt(++o);s=65536+((s&1023)<<10)|c&1023}if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63}}return t[n]=0,n-i}function T(e,t,n){return w(e,A,t,n)}typeof TextDecoder<`u`&&new TextDecoder(`utf-16le`);function E(e,t){k.set(e,t)}function D(e,t){return e%t>0&&(e+=t-e%t),e}var O,k,A,j,M,N,P;function ee(e){O=e,t.HEAP8=k=new Int8Array(e),t.HEAP16=j=new Int16Array(e),t.HEAP32=M=new Int32Array(e),t.HEAPU8=A=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=new Uint32Array(e),t.HEAPF32=N=new Float32Array(e),t.HEAPF64=P=new Float64Array(e)}var F=5271536,I=28624,te=t.TOTAL_MEMORY||33554432;O=t.buffer?t.buffer:new ArrayBuffer(te),te=O.byteLength,ee(O),M[I>>2]=F;function ne(e){for(;e.length>0;){var n=e.shift();if(typeof n==`function`){n();continue}var r=n.func;typeof r==`number`?n.arg===void 0?t.dynCall_v(r):t.dynCall_vi(r,n.arg):r(n.arg===void 0?null:n.arg)}}var re=[],ie=[],ae=[],L=[];function oe(){if(t.preRun)for(typeof t.preRun==`function`&&(t.preRun=[t.preRun]);t.preRun.length;)ue(t.preRun.shift());ne(re)}function se(){ne(ie)}function ce(){ne(ae)}function le(){if(t.postRun)for(typeof t.postRun==`function`&&(t.postRun=[t.postRun]);t.postRun.length;)de(t.postRun.shift());ne(L)}function ue(e){re.unshift(e)}function de(e){L.unshift(e)}var fe=Math.abs,pe=Math.ceil,me=Math.floor,R=Math.min,z=0,he=null,ge=null;function _e(e){z++,t.monitorRunDependencies&&t.monitorRunDependencies(z)}function ve(e){if(z--,t.monitorRunDependencies&&t.monitorRunDependencies(z),z==0&&(he!==null&&(clearInterval(he),he=null),ge)){var n=ge;ge=null,n()}}t.preloadedImages={},t.preloadedAudios={};var B=null,ye=`data:application/octet-stream;base64,`;function V(e){return String.prototype.startsWith?e.startsWith(ye):e.indexOf(ye)===0}var H,be;B=`data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAA6B6FaUp9QQTPXMuL4myJBraiDfBwx9UBYJseitzTIQOL5if9jqZtAnXX+Z+ycb0C3pucbhRBCQG8wJBYqpRRAlWbDCzCY5z/eFWBUEve6P/+qo4Q50Y4/D9YM3iCcYT8fcA2QJSA0P4ADxu0qAAc/BNcGolVJ2j5d9FACqwquPh9z7MthtI9CSUSYJke/YUJQ/64OyjU0Qpi0+HCmFQdCm3GfIVdh2kHsJ11kAyauQYC3UDFJOoFBSJsFV1OwU0FK5fcxX4AmQWhy/zZIt/lACqaCPsBjzUDbdUNIScugQMYQlVJ4MXNANiuq8GTvRUDxTXnulxEZQFZ8QX5kpuw/qmG/JwYFlEAluh3Q6DB+QKn4vyNq0GZAKOXekas+UUB8xabXXhI6QG63C2pLtSNAdDBtyNfLDUDyOcu67ID2P0rCMvRXAeE/Ki2TSVyzyT9Dk+8Sz2uzP5J+w5ARWp0/NQAoOiMuhj9YnP+RyMJwPxgW7TvQVFk/KgsLYF0kQz9g5dAC6IwzQcgHPVvDex1B1XjppodHBkHJq3OMM9fwQNvcmJ7wddlAInGPpQs/w0BRobq5EBmtQJZ2ai7n+ZVAtv2G5E+bgECG+gIfKBlpQK5f8jdI91JAL39sL/WpPEB8rGxhDqklQK6yUf43XhBAxL9y/tK8+D86XyZpgrHiPwAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAP////8AAAAAAAAAAAAAAAABAAAAAAAAAAAAAAD/////AAAAAAAAAAABAAAAAQAAAAAAAAAAAAAA/////wAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAP////8FAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQAAAAAAAQABAAABAQAAAAAAAQAAAAEAAAABAAEAAAAAAAAAAAAAAAAAAAAAquJYWJZl+D9jaeZNtj/zPwwdI9KqaeO/qGefXwdHdz+q4lhYlmX4P+OrlPMN3PI/DB0j0qpp47+7SQLV4VIEQKriWFiWZfg/r2kma3tz8T82eQmLqNIGwMRIWXMqSvo/fcCszPux9j+jara6ozTwP6hnn18HR3c/MSoKLequ8r+SabgA2nj0P7jBLbDOHO8/1Ym/ICfH4T+6lxjvlFXHv73m373LRPU/0vXyDVxo7T+ToKRHJXMAQF/33578aPE/pAyy64tD9T8+U/hCvyruPwxv8Y7YYwLAuXYr8NAiCEB4+LDK0Sn0P1Qeuy4j+eo/OMx50n7K7L+TrGB/nyf8v5ehC2fbYPM/aXMKexiT6z8mFRIMjg/zP7yUVwGGBNw/E6opHERf8z/z0wR2g9DqPw4pBpcOhvu/NbA29uWAA8DMaTExyXzyP02biiQ+Ruk/S8jz2/FKBEB1pzZnpbb9P7pQU4wLfPI//7ZcQXeG6D9CqEQvAYoIwDB2VB6sSgRAVyv8H5We8T+EHWF8XNPmPzB2wT8Nrrg/SEi+cX+w4L8of+GtdSDxP1sjk5AdouU/6ZjOVru13r8K0obqI6bxvwVbdNXyhfA/w5GG024n5z+rwmtMzP8BwLw9pSX49QXABe/2uQxP8D+b6wCzCvXkP7uGT87fK+Q/pz/JWw4coj+qoBf2J0nwP/yE3PUo0+I/vFJeHcaC+D96luSIqvntP/bf8sHUYu8/gZNN41mL4z9bhOqVOF4FwO6lmAh1hQhAbCVxbdhk7z+1C8NdDcfiPwG36x/0OQBAx0WJ76c2+D9nlSHXANfuP2HlfZ3gqOE/EwnVlVPg9r96+oHzEH//v5bXzdT1Auw/DM3GwLsA4D9p/8uoKcr+v+U9x5DQVAPAehjSdghb7D9sc1IetODgP8MVwwB1pu6/azPk6OGe978W8t/TUc3rP+0QMvYfP+A/RsG/QpSE8D+l3uwScxzgPwQaifgujuw/k1Vti1I43z8MAwLnSh0GQH5nYnwwZgJAiGUzWC5s6j8WyyI/BbLgPw4iUapGeQJAB3W+imnp/j9BLWR4ssrpP2t+gG5Pstk/cpBsfm6DCMCOpU9dOZsFQEv8nFypHeo/ehJ6i+6S2D9jqlGEmarLv7STC5TRiOa/bC+x8WZD6D9H3yUkWpDZP8gZvmCMuQLAreY19/eRBsCoPOc8UzzpP6KI/QV+y9g/t/MoboyWzT+Hv5q3Zu3Mvy2xROCT4uY/9gQitMMg1T9abAqhWMDkv1oLTavoUfG/PMUJP9CD5j+fHRX3t6fSPz7W2gk6bvs/WRnuHwqN9D8YFturGCTmP1EZczv0b9I/5t4exabB5D/1ESLh5fTEP9X2z6SYweQ/6lv3I2zT0D9zkRGNUNMAQKoSvc4EIfs/Xggt8wQI5T+mJHHg/w/SP4lhT/9t8vQ/DrZ/DbwH7D+XlhbYZrjkP34LIpFt6c4/lwfp8fLX9L+j96CTTf76v3WdNhEv9uM/d8c3o4lV0D/vFdCHVcsFwAHeDq0F1QhApbYqcZiN5D9KoilqByXLPwX0/diA0vq/0fo0GxnxAMBbaTkvlCzjP/RrFrWXrMs/UYTrky7jA0DB9f4FiZYAQEGAk/3QzeE/r/TeqE8t0D/OqjlsnPbvvz8RKU8JOfW/smSEbK/O4T8MzuyPm3DDP/rFtctq9gZAfb1EVEaSA0Dts5dVInnhP18SFMc79MM/7y34cw6LAMDFrRJsZO0DwC2KLvLSYuA/hx5wcUHewz+49SnK/4ruPyeS0PX9a+E/ZxaaLvvZ3z8WPu5T2QS8Pygo4RIvMqa/BJ0Kqsd0279cKW4ay8jdP3b05bmZ364/10/qtdxk2r+Bcz6CDMvpv54qOw+Amdw/qLV71pW7sT/YKc80nIPUP8OfIaBJ77G/LyTuD1un2z+diYu8efWzP1wU7ACkfwjAZroyPL1yBkAmv3lKJJbbPysKSE4W+p0/dIgqY79TA8ATLTOQ3tsGwJ2zweD/Xdg/XO/jXeFUaL8VW2qLFKfov1cA9Aa6XfK/tIa7YGgI2T+f3hu/sxqPv2nXdPpf3Pc/jkw8Jbda8j+tT/z8tGPVP1yBHpJd35k/KYvYOy1s8j/yz+kCQjPrP9+agH7x59g/PZfJ9aBhpr/rDKzvYBb+PwtkiaGCt/c/vb1mVr+f1T/JIHwHc8Govw7aeF6+9vG/Xv7kD6fp979isYioQYHVP7AIQZuSFrG/3z1AdUTnAUDN3XY9O7f9P0AdQ9ljYNQ/dJANJPTOrb8kLECUiiPlP4yF7UgmStA/9xGmXxCG1T9qZzix4W2zv2SGJRJVrPe/Fh9a2M/B/b8IexzFCoPSP9y1QFD2bLe/Q86cWLJe/b+mOOfYm78BwOTjkPAGE9E/8aPCUKu/ub9pPZyLCiUGwBA7Mev/BQlALOmrlRi+0j+AMJ/dKULBv7iLtL6a6QRAEMDV/yajAUDa62dE3crJP1P70RgBUbq/38hVnR6esT/s1tG10Z/Ov/zLwalHPss/dTS9NKTXx78nMcRzCIEHQAabxDsAmQRA0tyLK3gSyT+Aui7nOhDGv5Gs58z3WgHATN3forJuBMCAui7nOhDGP9Lciyt4Esm/WAJyHQ4c7z8UP5HFIs3iP3U0vTSk18c//MvBqUc+y7+cvv8HLg/Kvy1I/mHsI+K/U/vRGAFRuj/a62dE3crJv8p+WV8KlQjAuQ/nOP43B0CAMJ/dKULBPyzpq5UYvtK/ZoU+VoLh4L9etLlRUfvtv/GjwlCrv7k/5OOQ8AYT0b9DfT9FhufXPwUX8hJp+4u/3LVAUPZstz8IexzFCoPSv9+L609E5fQ/q9Fz7X2J7T9qZzix4W2zP/cRpl8QhtW/vtNilqGX+j8MOy7QJoL0P3SQDST0zq0/QB1D2WNg1L8IIjSvGNkDwGB8Jou2GAfAsAhBm5IWsT9isYioQYHVvyS9D3zb6uy/gnwRa7uM9L/JIHwHc8GoP729Zla/n9W/CsAHJZwmAEDEW6OYT1r6Pz2XyfWgYaY/35qAfvHn2L83Tdy4lS30vxf2/gZ0jPq/XIEekl3fmb+tT/z8tGPVvybPr2zJ1/+/K7mJ0ypVAsCf3hu/sxqPPwCGu2BoCNm/5oITrpZn+r+UDUyDP+n/v1zv413hVGg/nbPB4P9d2L9MlmkxNvgCQMtZlKE85v8/KwpIThb6nb8mv3lKJJbbv8+SZsTvOOc/pQCIIOYw0j+diYu8efWzvy8k7g9bp9u/kxYDa+pKtD9XlYvA8HnVv6i1e9aVu7G/nio7D4CZ3L/WR6rNh5EGwCkgQweBkghAdvTluZnfrr9cKW4ay8jdvxbjhr1f1QVAR5C0MzivAkAWPu5T2QS8v2cWmi772d+/cKj4lzLJCEBx2QJfYrMFQIcecHFB3sO/LYou8tJi4L+jr7lhO38BwIcI0Nb7xgTAXxIUxzv0w7/ts5dVInnhv0T+l8DZLfE/MP3FoFvS5D8MzuyPm3DDv7JkhGyvzuG/tzhzRIRc0b9Ovv3/0z7mv6/03qhPLdC/m4CT/dDN4b9dwjU5VCQBQBBJX1ntCv0/9GsWtZesy79baTkvlCzjv1mjYgEz++S/oW6KnOQW8b9KoilqByXLv6W2KnGYjeS/SmaKz3Vx9z+BZB5yxGHwP3fHN6OJVdC/dZ02ES/2478PuaBjLrXaP4/JU81pPaO/fgsikW3pzr+XlhbYZrjkv4tSn7YDbP0/f2LnFKlF9z+mJHHg/w/Sv14ILfMECOW/mfg4qYhR/b+OP+RQDCACwOpb9yNs09C/1fbPpJjB5L9pN2WOVZ3wv3hHy9nxIve/URlzO/Rv0r8YFturGCTmv1d1/KKR8QPA8gsy9qzSB8CfHRX3t6fSvzzFCT/Qg+a/EYStnrzV9r/2QJqI7Lb9v/YEIrTDINW/LbFE4JPi5r/7kQEs5fEDQHunnf4GeQBAooj9BX7L2L+oPOc8Uzzpv+ydYY2SSAfAL4HK6CRTB0BH3yUkWpDZv2wvsfFmQ+i/Ik0Yzruh6T8fM3LoGoDUP3oSeovukti/S/ycXKkd6r9rEv+7UWcHQCRIQe/GfwNAa36Abk+y2b9BLWR4ssrpv9KT87qa0bM/FTyktw823L8WyyI/BbLgv4hlM1gubOq/DizMp9Ki6r8b5ckdjVrzv5NVbYtSON+/BBqJ+C6O7L/dUBFqgyXYv00Wh18r7+q/7RAy9h8/4L8W8t/TUc3rv4RM5DKx3wDAfvWIj94aBcBsc1IetODgv3oY0nYIW+y/oGcTFF54AUDkJqS/FKX6PwzNxsC7AOC/ltfN1PUC7L+5Wrz/zHnzP6688w2rNOc/YeV9neCo4b9nlSHXANfuvw9RsxKjY/s/1V8GteXE8j+1C8NdDcfiv2wlcW3YZO+/IOywaA7Q8b9bFP+4Tg36v4GTTeNZi+O/9t/ywdRi77+tRc3yFR7eP2bkcHXJkLO//ITc9SjT4r+qoBf2J0nwv2YHKoswwfm/iQcLspCjAcCb6wCzCvXkvwXv9rkMT/C/YkuwYAMXBMApCNUai9kIwMORhtNuJ+e/BVt01fKF8L+ZqWEfvIjsP6h693QZYNk/WyOTkB2i5b8of+GtdSDxvwpaaulDSwVADMQAX+lOAECEHWF8XNPmv1cr/B+VnvG/XyFG6opcCMD/mtR32/UEQP+2XEF3hui/ulBTjAt88r/imfCfRP+yP9zbvtc8XeO/TZuKJD5G6b/MaTExyXzyvxiTQeElXOO/rbJRQVGN9L/z0wR2g9DqvxOqKRxEX/O/FDGCEei99j9x8zV4VYTmP2lzCnsYk+u/l6ELZ9tg878pRXacaDT/v3k6GZRqoQXAVB67LiP56r94+LDK0Sn0vwO6pZ9b7wFAvK0nKVcc9j8+U/hCvyruv6QMsuuLQ/W/FPhKFYv46j8MyxaDTOW/v9L18g1caO2/vebfvctE9b/7GD8ZrF3xv3gx1AR9bQDAuMEtsM4c77+SabgA2nj0v5xKFIwxsATArKNSBaKsB0Cjara6ozTwv33ArMz7sfa/dF2U0FcWCcDxL357DJX/P69pJmt7c/G/quJYWJZl+L/YntVJlnrSP4sRLzXM+fe/46uU8w3c8r+q4lhYlmX4v85lu5+QRwRAsI0H/WU8479jaeZNtj/zv6riWFiWZfi/sI0H/WU847/OZbufkEcEQHAoPUBrnss/9exKzDtFtT88wM8kax+gP9OqeKeAYog/MW0ItiZvcj+ph+smvt5bP2lCaV5dEUU/StaUmQDaLz+kK9y22BMYP0O3whZuMwI/IIbgZGWE6z7UkjYaEM3UPuezxwa9cr8+LybxRMnFpz6E1N8DbPiRPsYjySMvK3s+//////8fAAj//////zMQCP////9/MiAI/////28yMAj/////YzJACP///z9iMlAI////N2IyYAj///8zYjJwCP//vzNiMoAI//+rM2IykAj/f6szYjKgCP8PqzNiMrAI/wOrM2IywAi/A6szYjLQCJ8DqzNiMuAImQOrM2Iy8Aj//////z8PCP//////Kx8I/////38pLwj/////Pyk/CP////85KU8I////PzgpXwj///8POClvCP///w44KX8I//8fDjgpjwj//w8OOCmfCP9/DQ44Ka8I/w8NDjgpvwj/DQ0OOCnPCP8MDQ44Kd8IxwwNDjgp7wjEDA0OOCn/CAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+b8YLURU+yEJQBgtRFT7IQnAYWxnb3MuYwBoM05laWdoYm9yUm90YXRpb25zAGNvb3JkaWprLmMAX3VwQXA3Q2hlY2tlZABfdXBBcDdyQ2hlY2tlZABkaXJlY3RlZEVkZ2UuYwBkaXJlY3RlZEVkZ2VUb0JvdW5kYXJ5AGFkamFjZW50RmFjZURpclt0bXBGaWprLmZhY2VdW2ZpamsuZmFjZV0gPT0gS0kAZmFjZWlqay5jAF9mYWNlSWprUGVudFRvQ2VsbEJvdW5kYXJ5AGFkamFjZW50RmFjZURpcltjZW50ZXJJSksuZmFjZV1bZmFjZTJdID09IEtJAF9mYWNlSWprVG9DZWxsQm91bmRhcnkAaDNJbmRleC5jAGNvbXBhY3RDZWxscwBsYXRMbmdUb0NlbGwAY2VsbFRvQ2hpbGRQb3MAdmFsaWRhdGVDaGlsZFBvcwBsYXRMbmcuYwBjZWxsQXJlYVJhZHMyAHBvbHlnb24tPm5leHQgPT0gTlVMTABsaW5rZWRHZW8uYwBhZGROZXdMaW5rZWRQb2x5Z29uAG5leHQgIT0gTlVMTABsb29wICE9IE5VTEwAYWRkTmV3TGlua2VkTG9vcABwb2x5Z29uLT5maXJzdCA9PSBOVUxMAGFkZExpbmtlZExvb3AAY29vcmQgIT0gTlVMTABhZGRMaW5rZWRDb29yZABsb29wLT5maXJzdCA9PSBOVUxMAGlubmVyTG9vcHMgIT0gTlVMTABub3JtYWxpemVNdWx0aVBvbHlnb24AYmJveGVzICE9IE5VTEwAY2FuZGlkYXRlcyAhPSBOVUxMAGZpbmRQb2x5Z29uRm9ySG9sZQBjYW5kaWRhdGVCQm94ZXMgIT0gTlVMTAByZXZEaXIgIT0gSU5WQUxJRF9ESUdJVABsb2NhbGlqLmMAY2VsbFRvTG9jYWxJamsAYmFzZUNlbGwgIT0gb3JpZ2luQmFzZUNlbGwAIShvcmlnaW5PblBlbnQgJiYgaW5kZXhPblBlbnQpAGJhc2VDZWxsID09IG9yaWdpbkJhc2VDZWxsAGJhc2VDZWxsICE9IElOVkFMSURfQkFTRV9DRUxMAGxvY2FsSWprVG9DZWxsACFfaXNCYXNlQ2VsbFBlbnRhZ29uKGJhc2VDZWxsKQBiYXNlQ2VsbFJvdGF0aW9ucyA+PSAwAGdyaWRQYXRoQ2VsbHMAcG9seWZpbGwuYwBpdGVyU3RlcFBvbHlnb25Db21wYWN0ADAAdmVydGV4LmMAdmVydGV4Um90YXRpb25zAGNlbGxUb1ZlcnRleABncmFwaC0+YnVja2V0cyAhPSBOVUxMAHZlcnRleEdyYXBoLmMAaW5pdFZlcnRleEdyYXBoAG5vZGUgIT0gTlVMTABhZGRWZXJ0ZXhOb2Rl`;var xe=28640;function Se(e){return e}function Ce(e){return e.replace(/\b__Z[\w\d_]+/g,function(e){var t=Se(e);return e===t?e:t+` [`+e+`]`})}function we(){var e=Error();if(!e.stack){try{throw Error(0)}catch(t){e=t}if(!e.stack)return`(no stack trace available)`}return e.stack.toString()}function Te(){var e=we();return t.extraStackTrace&&(e+=` +`+t.extraStackTrace()),Ce(e)}function Ee(e,t,n,r){Ge(`Assertion failed: `+C(e)+`, at: `+[t?C(t):`unknown filename`,n,r?C(r):`unknown function`])}function De(){return k.length}function Oe(e,t,n){A.set(A.subarray(t,t+n),e)}function ke(e){return t.___errno_location&&(M[t.___errno_location()>>2]=e),e}function Ae(e){Ge(`OOM`)}function je(e){try{var t=new ArrayBuffer(e);return t.byteLength==e?(new Int8Array(t).set(k),Ie(t),ee(t),1):void 0}catch{}}function Me(e){var t=De(),n=16777216,r=2147483648-n;if(e>r)return!1;for(var i=Math.max(t,16777216);i>4,i=(s&15)<<4|c>>2,a=(c&3)<<6|l,n+=String.fromCharCode(r),c!==64&&(n+=String.fromCharCode(i)),l!==64&&(n+=String.fromCharCode(a));while(u13780509?(t=_n(15,t)|0,t|0):(n=((e|0)<0)<<31>>31,a=Pr(e|0,n|0,3,0)|0,r=T()|0,n=K(e|0,n|0,1,0)|0,n=Pr(a|0,r|0,n|0,T()|0)|0,n=K(n|0,T()|0,1,0)|0,e=T()|0,i[t>>2]=n,i[t+4>>2]=e,t=0,t|0)}function ne(e,t,n,r){return e|=0,t|=0,n|=0,r|=0,re(e,t,n,r,0)|0}function re(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var o=0,s=0,c=0,l=0,u=0;if(l=M,M=M+16|0,s=l,!(ie(e,t,n,r,a)|0))return r=0,M=l,r|0;do if((n|0)>=0){if((n|0)>13780509){if(o=_n(15,s)|0,o|0)break;c=s,s=i[c>>2]|0,c=i[c+4>>2]|0}else o=((n|0)<0)<<31>>31,u=Pr(n|0,o|0,3,0)|0,c=T()|0,o=K(n|0,o|0,1,0)|0,o=Pr(u|0,c|0,o|0,T()|0)|0,o=K(o|0,T()|0,1,0)|0,c=T()|0,i[s>>2]=o,i[s+4>>2]=c,s=o;if(Ur(r|0,0,s<<3|0)|0,a|0){Ur(a|0,0,s<<2|0)|0,o=ae(e,t,n,r,a,s,c,0)|0;break}o=Or(s,4)|0,o?(u=ae(e,t,n,r,o,s,c,0)|0,Dr(o),o=u):o=13}else o=2;while(0);return u=o,M=l,u|0}function ie(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0;if(g=M,M=M+16|0,m=g,h=g+8|0,p=m,i[p>>2]=e,i[p+4>>2]=t,(n|0)<0)return h=2,M=g,h|0;if(o=r,i[o>>2]=e,i[o+4>>2]=t,o=(a|0)!=0,o&&(i[a>>2]=0),kt(e,t)|0)return h=9,M=g,h|0;i[h>>2]=0;a:do if((n|0)>=1)if(o)for(d=1,u=0,f=0,p=1,o=e;;){if(!(u|f)){if(o=L(o,t,4,h,m)|0,o|0)break a;if(t=m,o=i[t>>2]|0,t=i[t+4>>2]|0,kt(o,t)|0){o=9;break a}}if(o=L(o,t,i[26800+(f<<2)>>2]|0,h,m)|0,o|0)break a;if(t=m,o=i[t>>2]|0,t=i[t+4>>2]|0,e=r+(d<<3)|0,i[e>>2]=o,i[e+4>>2]=t,i[a+(d<<2)>>2]=p,e=u+1|0,s=(e|0)==(p|0),c=f+1|0,l=(c|0)==6,kt(o,t)|0){o=9;break a}if(p=p+(l&s&1)|0,(p|0)>(n|0)){o=0;break}else d=d+1|0,u=s?0:e,f=s?l?0:c:f}else for(d=1,u=0,f=0,p=1,o=e;;){if(!(u|f)){if(o=L(o,t,4,h,m)|0,o|0)break a;if(t=m,o=i[t>>2]|0,t=i[t+4>>2]|0,kt(o,t)|0){o=9;break a}}if(o=L(o,t,i[26800+(f<<2)>>2]|0,h,m)|0,o|0)break a;if(t=m,o=i[t>>2]|0,t=i[t+4>>2]|0,e=r+(d<<3)|0,i[e>>2]=o,i[e+4>>2]=t,e=u+1|0,s=(e|0)==(p|0),c=f+1|0,l=(c|0)==6,kt(o,t)|0){o=9;break a}if(p=p+(l&s&1)|0,(p|0)>(n|0)){o=0;break}else d=d+1|0,u=s?0:e,f=s?l?0:c:f}else o=0;while(0);return h=o,M=g,h|0}function ae(e,t,n,r,a,o,s,c){e|=0,t|=0,n|=0,r|=0,a|=0,o|=0,s|=0,c|=0;var l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;if(g=M,M=M+16|0,m=g+8|0,h=g,l=Ir(e|0,t|0,o|0,s|0)|0,d=T()|0,f=r+(l<<3)|0,_=f,v=i[_>>2]|0,_=i[_+4>>2]|0,u=(v|0)==(e|0)&(_|0)==(t|0),!((v|0)==0&(_|0)==0|u))do l=K(l|0,d|0,1,0)|0,l=Fr(l|0,T()|0,o|0,s|0)|0,d=T()|0,f=r+(l<<3)|0,v=f,_=i[v>>2]|0,v=i[v+4>>2]|0,u=(_|0)==(e|0)&(v|0)==(t|0);while(!((_|0)==0&(v|0)==0|u));if(l=a+(l<<2)|0,u&&(i[l>>2]|0)<=(c|0)||(v=f,i[v>>2]=e,i[v+4>>2]=t,i[l>>2]=c,(c|0)>=(n|0)))return v=0,M=g,v|0;switch(u=c+1|0,i[m>>2]=0,l=L(e,t,2,m,h)|0,l|0){case 9:p=9;break;case 0:l=h,l=ae(i[l>>2]|0,i[l+4>>2]|0,n,r,a,o,s,u)|0,l||(p=9);break;default:}a:do if((p|0)==9){switch(i[m>>2]=0,l=L(e,t,3,m,h)|0,l|0){case 9:break;case 0:if(l=h,l=ae(i[l>>2]|0,i[l+4>>2]|0,n,r,a,o,s,u)|0,l|0)break a;break;default:break a}switch(i[m>>2]=0,l=L(e,t,1,m,h)|0,l|0){case 9:break;case 0:if(l=h,l=ae(i[l>>2]|0,i[l+4>>2]|0,n,r,a,o,s,u)|0,l|0)break a;break;default:break a}switch(i[m>>2]=0,l=L(e,t,5,m,h)|0,l|0){case 9:break;case 0:if(l=h,l=ae(i[l>>2]|0,i[l+4>>2]|0,n,r,a,o,s,u)|0,l|0)break a;break;default:break a}switch(i[m>>2]=0,l=L(e,t,4,m,h)|0,l|0){case 9:break;case 0:if(l=h,l=ae(i[l>>2]|0,i[l+4>>2]|0,n,r,a,o,s,u)|0,l|0)break a;break;default:break a}switch(i[m>>2]=0,l=L(e,t,6,m,h)|0,l|0){case 9:break;case 0:if(l=h,l=ae(i[l>>2]|0,i[l+4>>2]|0,n,r,a,o,s,u)|0,l|0)break a;break;default:break a}return v=0,M=g,v|0}while(0);return v=l,M=g,v|0}function L(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0;if(n>>>0>6)return a=1,a|0;if(f=(i[r>>2]|0)%6|0,i[r>>2]=f,(f|0)>0){o=0;do n=G(n)|0,o=o+1|0;while((o|0)<(i[r>>2]|0))}if(f=q(e|0,t|0,45)|0,T()|0,d=f&127,d>>>0>121)return a=5,a|0;l=Lt(e,t)|0,o=q(e|0,t|0,52)|0,T()|0,o&=15;a:do if(!o)u=8;else{for(;;){if(s=(15-o|0)*3|0,c=q(e|0,t|0,s|0)|0,T()|0,c&=7,(c|0)==7){t=5;break}if(h=(Ut(o)|0)==0,o=o+-1|0,p=J(7,0,s|0)|0,t&=~(T()|0),m=J(i[(h?432:16)+(c*28|0)+(n<<2)>>2]|0,0,s|0)|0,s=T()|0,n=i[(h?640:224)+(c*28|0)+(n<<2)>>2]|0,e=m|e&~p,t=s|t,!n){n=0;break a}if(!o){u=8;break a}}return t|0}while(0);(u|0)==8&&(h=i[848+(d*28|0)+(n<<2)>>2]|0,m=J(h|0,0,45)|0,e=m|e,t=T()|0|t&-1040385,n=i[4272+(d*28|0)+(n<<2)>>2]|0,(h&127|0)==127&&(h=J(i[848+(d*28|0)+20>>2]|0,0,45)|0,t=T()|0|t&-1040385,n=i[4272+(d*28|0)+20>>2]|0,e=zt(h|e,t)|0,t=T()|0,i[r>>2]=(i[r>>2]|0)+1)),c=q(e|0,t|0,45)|0,T()|0,c&=127;b:do if(R(c)|0){c:do if((Lt(e,t)|0)==1){if((d|0)!=(c|0))if(B(c,i[7696+(d*28|0)>>2]|0)|0){e=Vt(e,t)|0,s=1,t=T()|0;break}else E(27795,26864,533,26872);switch(l|0){case 3:e=zt(e,t)|0,t=T()|0,i[r>>2]=(i[r>>2]|0)+1,s=0;break c;case 5:e=Vt(e,t)|0,t=T()|0,i[r>>2]=(i[r>>2]|0)+5,s=0;break c;case 0:return h=9,h|0;default:return h=1,h|0}}else s=0;while(0);if((n|0)>0){o=0;do e=Rt(e,t)|0,t=T()|0,o=o+1|0;while((o|0)!=(n|0))}if((d|0)!=(c|0)){if(!(z(c)|0)){if((s|0)!=0|(Lt(e,t)|0)!=5)break;i[r>>2]=(i[r>>2]|0)+1;break}switch(f&127){case 8:case 118:break b;default:}(Lt(e,t)|0)!=3&&(i[r>>2]=(i[r>>2]|0)+1)}}else if((n|0)>0){o=0;do e=zt(e,t)|0,t=T()|0,o=o+1|0;while((o|0)!=(n|0))}while(0);return i[r>>2]=((i[r>>2]|0)+n|0)%6|0,h=a,i[h>>2]=e,i[h+4>>2]=t,h=0,h|0}function oe(e,t,n,r){return e|=0,t|=0,n|=0,r|=0,se(e,t,n,r)|0?(Ur(r|0,0,n*48|0)|0,r=ce(e,t,n,r)|0,r|0):(r=0,r|0)}function se(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0;if(h=M,M=M+16|0,p=h,m=h+8|0,f=p,i[f>>2]=e,i[f+4>>2]=t,(n|0)<0)return m=2,M=h,m|0;if(!n)return m=r,i[m>>2]=e,i[m+4>>2]=t,m=0,M=h,m|0;i[m>>2]=0;a:do if(kt(e,t)|0)e=9;else{a=0,f=e;do{if(e=L(f,t,4,m,p)|0,e|0)break a;if(t=p,f=i[t>>2]|0,t=i[t+4>>2]|0,a=a+1|0,kt(f,t)|0){e=9;break a}}while((a|0)<(n|0));d=r,i[d>>2]=f,i[d+4>>2]=t,d=n+-1|0,u=0,e=1;do{if(a=26800+(u<<2)|0,(u|0)==5)for(s=i[a>>2]|0,o=0,a=e;;){if(e=p,e=L(i[e>>2]|0,i[e+4>>2]|0,s,m,p)|0,e|0)break a;if((o|0)!=(d|0))if(l=p,c=i[l>>2]|0,l=i[l+4>>2]|0,e=r+(a<<3)|0,i[e>>2]=c,i[e+4>>2]=l,!(kt(c,l)|0))e=a+1|0;else{e=9;break a}else e=a;if(o=o+1|0,(o|0)>=(n|0))break;a=e}else for(s=p,l=i[a>>2]|0,c=0,a=e,o=i[s>>2]|0,s=i[s+4>>2]|0;;){if(e=L(o,s,l,m,p)|0,e|0)break a;if(s=p,o=i[s>>2]|0,s=i[s+4>>2]|0,e=r+(a<<3)|0,i[e>>2]=o,i[e+4>>2]=s,e=a+1|0,kt(o,s)|0){e=9;break a}if(c=c+1|0,(c|0)>=(n|0))break;a=e}u=u+1|0}while(u>>>0<6);e=p,e=(f|0)==(i[e>>2]|0)&&(t|0)==(i[e+4>>2]|0)?0:9}while(0);return m=e,M=h,m|0}function ce(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0;if(f=M,M=M+16|0,s=f,!n)return i[r>>2]=e,i[r+4>>2]=t,r=0,M=f,r|0;do if((n|0)>=0){if((n|0)>13780509){if(a=_n(15,s)|0,a|0)break;o=s,a=i[o>>2]|0,o=i[o+4>>2]|0}else a=((n|0)<0)<<31>>31,d=Pr(n|0,a|0,3,0)|0,o=T()|0,a=K(n|0,a|0,1,0)|0,a=Pr(d|0,o|0,a|0,T()|0)|0,a=K(a|0,T()|0,1,0)|0,o=T()|0,d=s,i[d>>2]=a,i[d+4>>2]=o;if(u=Or(a,8)|0,!u)a=13;else{if(d=Or(a,4)|0,!d){Dr(u),a=13;break}if(a=ae(e,t,n,u,d,a,o,0)|0,a|0){Dr(u),Dr(d);break}if(t=i[s>>2]|0,s=i[s+4>>2]|0,(s|0)>0|(s|0)==0&t>>>0>0){a=0,c=0,l=0;do e=u+(c<<3)|0,o=i[e>>2]|0,e=i[e+4>>2]|0,!((o|0)==0&(e|0)==0)&&(i[d+(c<<2)>>2]|0)==(n|0)&&(p=r+(a<<3)|0,i[p>>2]=o,i[p+4>>2]=e,a=a+1|0),c=K(c|0,l|0,1,0)|0,l=T()|0;while((l|0)<(s|0)|(l|0)==(s|0)&c>>>0>>0)}Dr(u),Dr(d),a=0}}else a=2;while(0);return p=a,M=f,p|0}function le(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0,l=0,u=0;for(c=M,M=M+16|0,o=c,s=c+8|0,a=(kt(e,t)|0)==0,a=a?1:2;;){if(i[s>>2]=0,u=(L(e,t,a,s,o)|0)==0,l=o,u&((i[l>>2]|0)==(n|0)?(i[l+4>>2]|0)==(r|0):0)){e=4;break}if(a=a+1|0,a>>>0>=7){a=7,e=4;break}}return(e|0)==4?(M=c,a|0):0}function ue(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0,l=0,u=0;if(c=M,M=M+48|0,a=c+16|0,o=c+8|0,s=c,n=Kn(n)|0,n|0)return s=n,M=c,s|0;if(u=e,l=i[u+4>>2]|0,n=o,i[n>>2]=i[u>>2],i[n+4>>2]=l,Gn(o,a),n=ke(a,t,s)|0,!n){if(t=i[o>>2]|0,o=i[e+8>>2]|0,(o|0)>0){a=i[e+12>>2]|0,n=0;do t=(i[a+(n<<3)>>2]|0)+t|0,n=n+1|0;while((n|0)<(o|0))}n=s,a=i[n>>2]|0,n=i[n+4>>2]|0,o=((t|0)<0)<<31>>31,(n|0)<(o|0)|(n|0)==(o|0)&a>>>0>>0?(n=s,i[n>>2]=t,i[n+4>>2]=o,n=o):t=a,l=K(t|0,n|0,12,0)|0,u=T()|0,n=s,i[n>>2]=l,i[n+4>>2]=u,n=r,i[n>>2]=l,i[n+4>>2]=u,n=0}return u=n,M=c,u|0}function de(e,t,n,r,o,s,c){e|=0,t|=0,n|=0,r|=0,o|=0,s|=0,c|=0;var l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,E=0,D=0,O=0,k=0,A=0,j=0,N=0,P=0,ee=0,F=0,I=0,te=0,ne=0;if(ee=M,M=M+64|0,A=ee+48|0,j=ee+32|0,N=ee+24|0,C=ee+8|0,w=ee,u=i[e>>2]|0,(u|0)<=0)return P=0,M=ee,P|0;for(E=e+4|0,D=A+8|0,O=j+8|0,k=C+8|0,l=0,x=0;;){d=i[E>>2]|0,b=d+(x<<4)|0,i[A>>2]=i[b>>2],i[A+4>>2]=i[b+4>>2],i[A+8>>2]=i[b+8>>2],i[A+12>>2]=i[b+12>>2],(x|0)==(u+-1|0)?(i[j>>2]=i[d>>2],i[j+4>>2]=i[d+4>>2],i[j+8>>2]=i[d+8>>2],i[j+12>>2]=i[d+12>>2]):(b=d+(x+1<<4)|0,i[j>>2]=i[b>>2],i[j+4>>2]=i[b+4>>2],i[j+8>>2]=i[b+8>>2],i[j+12>>2]=i[b+12>>2]),u=Ae(A,j,r,N)|0;a:do if(u)d=0,l=u;else if(u=N,d=i[u>>2]|0,u=i[u+4>>2]|0,(u|0)>0|(u|0)==0&d>>>0>0){y=0,b=0;b:for(;;){if(I=1/(+(d>>>0)+4294967296*(u|0)),ne=+a[A>>3],u=kr(d|0,u|0,y|0,b|0)|0,te=+(u>>>0)+4294967296*(T()|0),F=+(y>>>0)+4294967296*(b|0),a[C>>3]=ne*te*I+I*(+a[j>>3]*F),a[k>>3]=I*(+a[D>>3]*te)+I*(+a[O>>3]*F),u=Wt(C,r,w)|0,u|0){l=u;break}v=w,_=i[v>>2]|0,v=i[v+4>>2]|0,m=Ir(_|0,v|0,t|0,n|0)|0,f=T()|0,u=c+(m<<3)|0,p=u,d=i[p>>2]|0,p=i[p+4>>2]|0;c:do if((d|0)==0&(p|0)==0)S=u,P=16;else for(h=0,g=0;;){if((h|0)>(n|0)|(h|0)==(n|0)&g>>>0>t>>>0){l=1;break b}if((d|0)==(_|0)&(p|0)==(v|0))break c;if(u=K(m|0,f|0,1,0)|0,m=Fr(u|0,T()|0,t|0,n|0)|0,f=T()|0,g=K(g|0,h|0,1,0)|0,h=T()|0,u=c+(m<<3)|0,p=u,d=i[p>>2]|0,p=i[p+4>>2]|0,(d|0)==0&(p|0)==0){S=u,P=16;break}}while(0);if((P|0)==16&&(P=0,!((_|0)==0&(v|0)==0))&&(g=S,i[g>>2]=_,i[g+4>>2]=v,g=s+(i[o>>2]<<3)|0,i[g>>2]=_,i[g+4>>2]=v,g=o,g=K(i[g>>2]|0,i[g+4>>2]|0,1,0)|0,_=T()|0,v=o,i[v>>2]=g,i[v+4>>2]=_),y=K(y|0,b|0,1,0)|0,b=T()|0,u=N,d=i[u>>2]|0,u=i[u+4>>2]|0,!((u|0)>(b|0)|(u|0)==(b|0)&d>>>0>y>>>0)){d=1;break a}}d=0}else d=1;while(0);if(x=x+1|0,!d){P=21;break}if(u=i[e>>2]|0,(x|0)>=(u|0)){l=0,P=21;break}}return(P|0)==21?(M=ee,l|0):0}function fe(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,E=0,D=0,O=0,k=0,A=0,j=0,N=0,P=0,ee=0,F=0,I=0;if(I=M,M=M+112|0,N=I+80|0,l=I+72|0,P=I,ee=I+56|0,a=Kn(n)|0,a|0)return F=a,M=I,F|0;if(u=e+8|0,F=Er((i[u>>2]<<5)+32|0)|0,!F)return F=13,M=I,F|0;if(qn(e,F),a=Kn(n)|0,!a){if(A=e,j=i[A+4>>2]|0,a=l,i[a>>2]=i[A>>2],i[a+4>>2]=j,Gn(l,N),a=ke(N,t,P)|0,a)A=0,j=0;else{if(a=i[l>>2]|0,o=i[u>>2]|0,(o|0)>0){s=i[e+12>>2]|0,n=0;do a=(i[s+(n<<3)>>2]|0)+a|0,n=n+1|0;while((n|0)!=(o|0));n=a}else n=a;a=P,o=i[a>>2]|0,a=i[a+4>>2]|0,s=((n|0)<0)<<31>>31,(a|0)<(s|0)|(a|0)==(s|0)&o>>>0>>0?(a=P,i[a>>2]=n,i[a+4>>2]=s,a=s):n=o,A=K(n|0,a|0,12,0)|0,j=T()|0,a=P,i[a>>2]=A,i[a+4>>2]=j,a=0}if(!a){if(n=Or(A,8)|0,!n)return Dr(F),F=13,M=I,F|0;if(c=Or(A,8)|0,!c)return Dr(F),Dr(n),F=13,M=I,F|0;O=N,i[O>>2]=0,i[O+4>>2]=0,O=e,k=i[O+4>>2]|0,a=l,i[a>>2]=i[O>>2],i[a+4>>2]=k,a=de(l,A,j,t,N,n,c)|0;a:do if(a)Dr(n),Dr(c),Dr(F);else{b:do if((i[u>>2]|0)>0){for(s=e+12|0,o=0;a=de((i[s>>2]|0)+(o<<3)|0,A,j,t,N,n,c)|0,o=o+1|0,!(a|0);)if((o|0)>=(i[u>>2]|0))break b;Dr(n),Dr(c),Dr(F);break a}while(0);(j|0)>0|(j|0)==0&A>>>0>0&&Ur(c|0,0,A<<3|0)|0,k=N,O=i[k+4>>2]|0;c:do if((O|0)>0|(O|0)==0&(i[k>>2]|0)>>>0>0){w=n,E=c,D=n,O=c,k=n,a=n,x=n,S=c,C=c,n=c;d:for(;;){for(_=0,v=0,y=0,b=0,o=0,s=0;;){c=P,l=c+56|0;do i[c>>2]=0,c=c+4|0;while((c|0)<(l|0));if(t=w+(_<<3)|0,u=i[t>>2]|0,t=i[t+4>>2]|0,ie(u,t,1,P,0)|0){c=P,l=c+56|0;do i[c>>2]=0,c=c+4|0;while((c|0)<(l|0));c=Or(7,4)|0,c|0&&(ae(u,t,1,P,c,7,0,0)|0,Dr(c))}for(g=0;;){h=P+(g<<3)|0,m=i[h>>2]|0,h=i[h+4>>2]|0;e:do if((m|0)==0&(h|0)==0)c=o,l=s;else{if(d=Ir(m|0,h|0,A|0,j|0)|0,u=T()|0,c=r+(d<<3)|0,t=c,l=i[t>>2]|0,t=i[t+4>>2]|0,!((l|0)==0&(t|0)==0)){f=0,p=0;do{if((f|0)>(j|0)|(f|0)==(j|0)&p>>>0>A>>>0)break d;if((l|0)==(m|0)&(t|0)==(h|0)){c=o,l=s;break e}c=K(d|0,u|0,1,0)|0,d=Fr(c|0,T()|0,A|0,j|0)|0,u=T()|0,p=K(p|0,f|0,1,0)|0,f=T()|0,c=r+(d<<3)|0,t=c,l=i[t>>2]|0,t=i[t+4>>2]|0}while(!((l|0)==0&(t|0)==0))}if((m|0)==0&(h|0)==0){c=o,l=s;break}qt(m,h,ee)|0,Jn(e,F,ee)|0&&(p=K(o|0,s|0,1,0)|0,s=T()|0,f=c,i[f>>2]=m,i[f+4>>2]=h,o=E+(o<<3)|0,i[o>>2]=m,i[o+4>>2]=h,o=p),c=o,l=s}while(0);if(g=g+1|0,g>>>0>=7)break;o=c,s=l}if(_=K(_|0,v|0,1,0)|0,v=T()|0,y=K(y|0,b|0,1,0)|0,b=T()|0,s=N,o=i[s>>2]|0,s=i[s+4>>2]|0,(b|0)<(s|0)|(b|0)==(s|0)&y>>>0>>0)o=c,s=l;else break}if((s|0)>0|(s|0)==0&o>>>0>0){o=0,s=0;do b=w+(o<<3)|0,i[b>>2]=0,i[b+4>>2]=0,o=K(o|0,s|0,1,0)|0,s=T()|0,b=N,y=i[b+4>>2]|0;while((s|0)<(y|0)|((s|0)==(y|0)?o>>>0<(i[b>>2]|0)>>>0:0))}if(b=N,i[b>>2]=c,i[b+4>>2]=l,(l|0)>0|(l|0)==0&c>>>0>0)g=n,_=C,v=k,y=S,b=E,n=x,C=a,S=D,x=g,a=_,k=O,O=v,D=y,E=w,w=b;else break c}Dr(D),Dr(O),Dr(F),a=1;break a}else a=c;while(0);Dr(F),Dr(n),Dr(a),a=0}while(0);return F=a,M=I,F|0}}return Dr(F),F=a,M=I,F|0}function pe(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0;if(d=M,M=M+176|0,l=d,(t|0)<1)return _r(n,0,0),u=0,M=d,u|0;for(c=e,c=q(i[c>>2]|0,i[c+4>>2]|0,52)|0,T()|0,_r(n,(t|0)>6?t:6,c&15),c=0;r=e+(c<<3)|0,r=Jt(i[r>>2]|0,i[r+4>>2]|0,l)|0,!(r|0);){if(r=i[l>>2]|0,(r|0)>0){s=0;do o=l+8+(s<<4)|0,s=s+1|0,r=l+8+(((s|0)%(r|0)|0)<<4)|0,a=Sr(n,r,o)|0,a?br(n,a)|0:xr(n,o,r)|0,r=i[l>>2]|0;while((s|0)<(r|0))}if(c=c+1|0,(c|0)>=(t|0)){r=0,u=13;break}}return(u|0)==13?(M=d,r|0):(vr(n),u=r,M=d,u|0)}function me(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0,s=0;if(o=M,M=M+32|0,r=o,a=o+16|0,e=pe(e,t,a)|0,e|0)return n=e,M=o,n|0;if(i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,e=yr(a)|0,e|0)do{t=Tn(n)|0;do En(t,e)|0,s=e+16|0,i[r>>2]=i[s>>2],i[r+4>>2]=i[s+4>>2],i[r+8>>2]=i[s+8>>2],i[r+12>>2]=i[s+12>>2],br(a,e)|0,e=Cr(a,r)|0;while(e|0);e=yr(a)|0}while(e|0);return vr(a),e=On(n)|0,e?(Dn(n),s=e,M=o,s|0):(s=0,M=o,s|0)}function R(e){return e|=0,e>>>0>121?(e=0,e|0):(e=i[7696+(e*28|0)+16>>2]|0,e|0)}function z(e){return e|=0,(e|0)==4|(e|0)==117|0}function he(e){return e|=0,i[11120+((i[e>>2]|0)*216|0)+((i[e+4>>2]|0)*72|0)+((i[e+8>>2]|0)*24|0)+(i[e+12>>2]<<3)>>2]|0}function ge(e){return e|=0,i[11120+((i[e>>2]|0)*216|0)+((i[e+4>>2]|0)*72|0)+((i[e+8>>2]|0)*24|0)+(i[e+12>>2]<<3)+4>>2]|0}function _e(e,t){e|=0,t|=0,e=7696+(e*28|0)|0,i[t>>2]=i[e>>2],i[t+4>>2]=i[e+4>>2],i[t+8>>2]=i[e+8>>2],i[t+12>>2]=i[e+12>>2]}function ve(e,t){e|=0,t|=0;var n=0,r=0;if(t>>>0>20)return t=-1,t|0;do if((i[11120+(t*216|0)>>2]|0)!=(e|0))if((i[11120+(t*216|0)+8>>2]|0)!=(e|0))if((i[11120+(t*216|0)+16>>2]|0)!=(e|0))if((i[11120+(t*216|0)+24>>2]|0)!=(e|0))if((i[11120+(t*216|0)+32>>2]|0)!=(e|0))if((i[11120+(t*216|0)+40>>2]|0)!=(e|0))if((i[11120+(t*216|0)+48>>2]|0)!=(e|0))if((i[11120+(t*216|0)+56>>2]|0)!=(e|0))if((i[11120+(t*216|0)+64>>2]|0)!=(e|0))if((i[11120+(t*216|0)+72>>2]|0)!=(e|0))if((i[11120+(t*216|0)+80>>2]|0)!=(e|0))if((i[11120+(t*216|0)+88>>2]|0)!=(e|0))if((i[11120+(t*216|0)+96>>2]|0)!=(e|0))if((i[11120+(t*216|0)+104>>2]|0)!=(e|0))if((i[11120+(t*216|0)+112>>2]|0)!=(e|0))if((i[11120+(t*216|0)+120>>2]|0)!=(e|0))if((i[11120+(t*216|0)+128>>2]|0)!=(e|0))if((i[11120+(t*216|0)+136>>2]|0)==(e|0))e=2,n=1,r=2;else{if((i[11120+(t*216|0)+144>>2]|0)==(e|0)){e=0,n=2,r=0;break}if((i[11120+(t*216|0)+152>>2]|0)==(e|0)){e=0,n=2,r=1;break}if((i[11120+(t*216|0)+160>>2]|0)==(e|0)){e=0,n=2,r=2;break}if((i[11120+(t*216|0)+168>>2]|0)==(e|0)){e=1,n=2,r=0;break}if((i[11120+(t*216|0)+176>>2]|0)==(e|0)){e=1,n=2,r=1;break}if((i[11120+(t*216|0)+184>>2]|0)==(e|0)){e=1,n=2,r=2;break}if((i[11120+(t*216|0)+192>>2]|0)==(e|0)){e=2,n=2,r=0;break}if((i[11120+(t*216|0)+200>>2]|0)==(e|0)){e=2,n=2,r=1;break}if((i[11120+(t*216|0)+208>>2]|0)==(e|0)){e=2,n=2,r=2;break}else e=-1;return e|0}else e=2,n=1,r=1;else e=2,n=1,r=0;else e=1,n=1,r=2;else e=1,n=1,r=1;else e=1,n=1,r=0;else e=0,n=1,r=2;else e=0,n=1,r=1;else e=0,n=1,r=0;else e=2,n=0,r=2;else e=2,n=0,r=1;else e=2,n=0,r=0;else e=1,n=0,r=2;else e=1,n=0,r=1;else e=1,n=0,r=0;else e=0,n=0,r=2;else e=0,n=0,r=1;else e=0,n=0,r=0;while(0);return t=i[11120+(t*216|0)+(n*72|0)+(e*24|0)+(r<<3)+4>>2]|0,t|0}function B(e,t){return e|=0,t|=0,(i[7696+(e*28|0)+20>>2]|0)==(t|0)?(t=1,t|0):(t=(i[7696+(e*28|0)+24>>2]|0)==(t|0),t|0)}function ye(e,t){return e|=0,t|=0,i[848+(e*28|0)+(t<<2)>>2]|0}function V(e,t){return e|=0,t|=0,(i[848+(e*28|0)>>2]|0)==(t|0)?(t=0,t|0):(i[848+(e*28|0)+4>>2]|0)==(t|0)?(t=1,t|0):(i[848+(e*28|0)+8>>2]|0)==(t|0)?(t=2,t|0):(i[848+(e*28|0)+12>>2]|0)==(t|0)?(t=3,t|0):(i[848+(e*28|0)+16>>2]|0)==(t|0)?(t=4,t|0):(i[848+(e*28|0)+20>>2]|0)==(t|0)?(t=5,t|0):((i[848+(e*28|0)+24>>2]|0)==(t|0)?6:7)|0}function H(){return 122}function be(e){e|=0;var t=0,n=0,r=0;t=0;do J(t|0,0,45)|0,r=T()|134225919,n=e+(t<<3)|0,i[n>>2]=-1,i[n+4>>2]=r,t=t+1|0;while((t|0)!=122);return 0}function xe(e){e|=0;var t=0,n=0,r=0;return r=+a[e+16>>3],n=+a[e+24>>3],t=r-n,+(r>3]<+a[e+24>>3]|0}function Ce(e){return e|=0,+(a[e>>3]-+a[e+8>>3])}function we(e,t){e|=0,t|=0;var n=0,r=0,i=0;return n=+a[t>>3],!(n>=+a[e+8>>3])||!(n<=+a[e>>3])?(t=0,t|0):(r=+a[e+16>>3],n=+a[e+24>>3],i=+a[t+8>>3],t=i>=n,e=i<=r&1,r>3]<+a[t+8>>3]||+a[e+8>>3]>+a[t>>3]?(r=0,r|0):(o=+a[e+16>>3],n=e+24|0,d=+a[n>>3],s=o>3],i=t+24|0,l=+a[i>>3],c=u>3],t)||(d=+sn(+a[n>>3],e),d>+sn(+a[r>>3],t))?(c=0,c|0):(c=1,c|0))}function Ee(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var o=0,s=0,c=0,l=0,u=0;s=+a[e+16>>3],u=+a[e+24>>3],e=s>3],c=+a[t+24>>3],o=l>2]=e?o|t?1:2:0,i[r>>2]=o?e?1:t?2:1:0}function De(e,t){e|=0,t|=0;var n=0,r=0,i=0,o=0,s=0,c=0,l=0,u=0,d=0;return+a[e>>3]<+a[t>>3]||+a[e+8>>3]>+a[t+8>>3]?(r=0,r|0):(r=e+16|0,l=+a[r>>3],o=+a[e+24>>3],s=l>3],i=t+24|0,u=+a[i>>3],c=d>3],t)?(d=+sn(+a[r>>3],e),c=d>=+sn(+a[n>>3],t),c|0):(c=0,c|0))}function Oe(e,t){e|=0,t|=0;var n=0,r=0,o=0,s=0,c=0,l=0;o=M,M=M+176|0,r=o,i[r>>2]=4,l=+a[t>>3],a[r+8>>3]=l,s=+a[t+16>>3],a[r+16>>3]=s,a[r+24>>3]=l,l=+a[t+24>>3],a[r+32>>3]=l,c=+a[t+8>>3],a[r+40>>3]=c,a[r+48>>3]=l,a[r+56>>3]=c,a[r+64>>3]=s,t=r+72|0,n=t+96|0;do i[t>>2]=0,t=t+4|0;while((t|0)<(n|0));Hr(e|0,r|0,168)|0,M=o}function ke(e,t,n){e|=0,t|=0,n|=0;var r=0,s=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,b=0,S=0,C=0;b=M,M=M+288|0,h=b+264|0,g=b+96|0,m=b,f=m,p=f+96|0;do i[f>>2]=0,f=f+4|0;while((f|0)<(p|0));return t=Qt(t,m)|0,t|0?(v=t,M=b,v|0):(p=m,m=i[p>>2]|0,p=i[p+4>>2]|0,qt(m,p,h)|0,Jt(m,p,g)|0,d=+ln(h,g+8|0),a[h>>3]=+a[e>>3],p=h+8|0,a[p>>3]=+a[e+16>>3],a[g>>3]=+a[e+8>>3],m=g+8|0,a[m>>3]=+a[e+24>>3],s=+ln(h,g),C=a[p>>3]-+a[m>>3],u=+l(+C),S=a[h>>3]-+a[g>>3],r=+l(+S),!(C==0|S==0)&&(C=+zr(+u,+r),C=+y(+(s*s/+Br(+(C/+Br(+u,+r)),3)/(d*2.59807621135*d*.8))),a[o>>3]=C,_=~~C>>>0,v=+l(C)>=1?C>0?~~+x(+c(C/4294967296),4294967295)>>>0:~~+y((C-+(~~C>>>0))/4294967296)>>>0:0,(i[o+4>>2]&2146435072|0)!=2146435072)?(g=(_|0)==0&(v|0)==0,t=n,i[t>>2]=g?1:_,i[t+4>>2]=g?0:v,t=0):t=1,v=t,M=b,v|0)}function Ae(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var s=0,u=0,d=0,f=0,p=0,m=0,h=0;m=M,M=M+288|0,d=m+264|0,f=m+96|0,p=m,s=p,u=s+96|0;do i[s>>2]=0,s=s+4|0;while((s|0)<(u|0));return n=Qt(n,p)|0,n|0?(r=n,M=m,r|0):(n=p,s=i[n>>2]|0,n=i[n+4>>2]|0,qt(s,n,d)|0,Jt(s,n,f)|0,h=+ln(d,f+8|0),h=+y(+(ln(e,t)/(h*2))),a[o>>3]=h,n=~~h>>>0,s=+l(h)>=1?h>0?~~+x(+c(h/4294967296),4294967295)>>>0:~~+y((h-+(~~h>>>0))/4294967296)>>>0:0,(i[o+4>>2]&2146435072|0)==2146435072?(r=1,M=m,r|0):(p=(n|0)==0&(s|0)==0,i[r>>2]=p?1:n,i[r+4>>2]=p?0:s,r=0,M=m,r|0))}function je(e,t){e|=0,t=+t;var n=0,r=0,i=0,o=0,s=0,c=0,l=0,u=0,d=0;o=e+16|0,s=+a[o>>3],n=e+24|0,i=+a[n>>3],r=s-i,r=s>3],c=e+8|0,l=+a[c>>3],d=u-l,r=(r*t-r)*.5,t=(d*t-d)*.5,u+=t,a[e>>3]=u>1.5707963267948966?1.5707963267948966:u,t=l-t,a[c>>3]=t<-1.5707963267948966?-1.5707963267948966:t,t=s+r,t=t>3.141592653589793?t+-6.283185307179586:t,a[o>>3]=t<-3.141592653589793?t+6.283185307179586:t,t=i-r,t=t>3.141592653589793?t+-6.283185307179586:t,a[n>>3]=t<-3.141592653589793?t+6.283185307179586:t}function Me(e,t,n,r){e|=0,t|=0,n|=0,r|=0,i[e>>2]=t,i[e+4>>2]=n,i[e+8>>2]=r}function Ne(e,t){e|=0,t|=0;var n=0,r=0,o=0,s=0,c=0,u=0,d=0,f=0,p=0,m=0,h=0;m=t+8|0,i[m>>2]=0,d=+a[e>>3],c=+l(+d),f=+a[e+8>>3],u=l(+f)*1.1547005383792515,c+=u*.5,n=~~c,e=~~u,c-=+(n|0),u-=+(e|0);do if(c<.5)if(c<.3333333333333333)if(i[t>>2]=n,u<(c+1)*.5){i[t+4>>2]=e;break}else{e=e+1|0,i[t+4>>2]=e;break}else if(h=1-c,e=(!(u>2]=e,h<=u&u>2]=n;break}else{i[t>>2]=n;break}else{if(!(c<.6666666666666666))if(n=n+1|0,i[t>>2]=n,u>2]=e;break}else{e=e+1|0,i[t+4>>2]=e;break}if(u<1-c){if(i[t+4>>2]=e,c*2+-1>2]=n;break}}else e=e+1|0,i[t+4>>2]=e;n=n+1|0,i[t>>2]=n}while(0);do if(d<0)if(e&1){p=(e+1|0)/2|0,p=kr(n|0,((n|0)<0)<<31>>31|0,p|0,((p|0)<0)<<31>>31|0)|0,n=~~((n|0)-((+(p>>>0)+4294967296*(T()|0))*2+1)),i[t>>2]=n;break}else{p=(e|0)/2|0,p=kr(n|0,((n|0)<0)<<31>>31|0,p|0,((p|0)<0)<<31>>31|0)|0,n=~~((n|0)-(+(p>>>0)+4294967296*(T()|0))*2),i[t>>2]=n;break}while(0);p=t+4|0,f<0&&(n=n-((e<<1|1)/2|0)|0,i[t>>2]=n,e=0-e|0,i[p>>2]=e),r=e-n|0,(n|0)<0?(o=0-n|0,i[p>>2]=r,i[m>>2]=o,i[t>>2]=0,e=r,n=0):o=0,(e|0)<0&&(n=n-e|0,i[t>>2]=n,o=o-e|0,i[m>>2]=o,i[p>>2]=0,e=0),s=n-o|0,r=e-o|0,(o|0)<0&&(i[t>>2]=s,i[p>>2]=r,i[m>>2]=0,e=r,n=s,o=0),r=(e|0)<(n|0)?e:n,r=(o|0)<(r|0)?o:r,!((r|0)<=0)&&(i[t>>2]=n-r,i[p>>2]=e-r,i[m>>2]=o-r)}function Pe(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0;t=i[e>>2]|0,s=e+4|0,n=i[s>>2]|0,(t|0)<0&&(n=n-t|0,i[s>>2]=n,o=e+8|0,i[o>>2]=(i[o>>2]|0)-t,i[e>>2]=0,t=0),(n|0)<0?(t=t-n|0,i[e>>2]=t,o=e+8|0,a=(i[o>>2]|0)-n|0,i[o>>2]=a,i[s>>2]=0,n=0):(a=e+8|0,o=a,a=i[a>>2]|0),(a|0)<0&&(t=t-a|0,i[e>>2]=t,n=n-a|0,i[s>>2]=n,i[o>>2]=0,a=0),r=(n|0)<(t|0)?n:t,r=(a|0)<(r|0)?a:r,!((r|0)<=0)&&(i[e>>2]=t-r,i[s>>2]=n-r,i[o>>2]=a-r)}function Fe(e,t){e|=0,t|=0;var n=0,r=0;r=i[e+8>>2]|0,n=+((i[e+4>>2]|0)-r|0),a[t>>3]=((i[e>>2]|0)-r|0)-n*.5,a[t+8>>3]=n*.8660254037844386}function U(e,t,n){e|=0,t|=0,n|=0,i[n>>2]=(i[t>>2]|0)+(i[e>>2]|0),i[n+4>>2]=(i[t+4>>2]|0)+(i[e+4>>2]|0),i[n+8>>2]=(i[t+8>>2]|0)+(i[e+8>>2]|0)}function Ie(e,t,n){e|=0,t|=0,n|=0,i[n>>2]=(i[e>>2]|0)-(i[t>>2]|0),i[n+4>>2]=(i[e+4>>2]|0)-(i[t+4>>2]|0),i[n+8>>2]=(i[e+8>>2]|0)-(i[t+8>>2]|0)}function Le(e,t){e|=0,t|=0;var n=0,r=0;n=b(i[e>>2]|0,t)|0,i[e>>2]=n,n=e+4|0,r=b(i[n>>2]|0,t)|0,i[n>>2]=r,e=e+8|0,t=b(i[e>>2]|0,t)|0,i[e>>2]=t}function Re(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0;s=i[e>>2]|0,c=(s|0)<0,r=(i[e+4>>2]|0)-(c?s:0)|0,o=(r|0)<0,a=(o?0-r|0:0)+((i[e+8>>2]|0)-(c?s:0))|0,n=(a|0)<0,e=n?0:a,t=(o?0:r)-(n?a:0)|0,a=(c?0:s)-(o?r:0)-(n?a:0)|0,n=(t|0)<(a|0)?t:a,n=(e|0)<(n|0)?e:n,r=(n|0)>0,e=e-(r?n:0)|0,t=t-(r?n:0)|0;a:do switch(a-(r?n:0)|0){case 0:switch(t|0){case 0:return c=e|0?(e|0)==1?1:7:0,c|0;case 1:return c=e|0?(e|0)==1?3:7:2,c|0;default:break a}case 1:switch(t|0){case 0:return c=e|0?(e|0)==1?5:7:4,c|0;case 1:if(!e)e=6;else break a;return e|0;default:break a}default:}while(0);return c=7,c|0}function W(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0,l=0,u=0;if(l=e+8|0,s=i[l>>2]|0,c=(i[e>>2]|0)-s|0,u=e+4|0,s=(i[u>>2]|0)-s|0,c>>>0>715827881|s>>>0>715827881){if(r=(c|0)>0,a=2147483647-c|0,o=-2147483648-c|0,(r?(a|0)<(c|0):(o|0)>(c|0))||(n=c<<1,r?(2147483647-n|0)<(c|0):(-2147483648-n|0)>(c|0))||((s|0)>0?(2147483647-s|0)<(s|0):(-2147483648-s|0)>(s|0))||(t=c*3|0,n=s<<1,(r?(a|0)<(n|0):(o|0)>(n|0))||((c|0)>-1?(t|-2147483648)>=(s|0):(t^-2147483648|0)<(s|0))))return u=1,u|0}else n=s<<1,t=c*3|0;return r=Tr((t-s|0)*.14285714285714285)|0,i[e>>2]=r,a=Tr((n+c|0)*.14285714285714285)|0,i[u>>2]=a,i[l>>2]=0,n=(a|0)<(r|0),t=n?r:a,n=n?a:r,(n|0)<0&&(((n|0)==-2147483648||((t|0)>0?(2147483647-t|0)<(n|0):(-2147483648-t|0)>(n|0)))&&E(27795,26892,354,26903),((t|0)>-1?(t|-2147483648)>=(n|0):(t^-2147483648|0)<(n|0))&&E(27795,26892,354,26903)),t=a-r|0,(r|0)<0?(n=0-r|0,i[u>>2]=t,i[l>>2]=n,i[e>>2]=0,r=0):(t=a,n=0),(t|0)<0&&(r=r-t|0,i[e>>2]=r,n=n-t|0,i[l>>2]=n,i[u>>2]=0,t=0),o=r-n|0,a=t-n|0,(n|0)<0?(i[e>>2]=o,i[u>>2]=a,i[l>>2]=0,t=a,a=o,n=0):a=r,r=(t|0)<(a|0)?t:a,r=(n|0)<(r|0)?n:r,(r|0)<=0?(u=0,u|0):(i[e>>2]=a-r,i[u>>2]=t-r,i[l>>2]=n-r,u=0,u|0)}function ze(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0,l=0;if(s=e+8|0,a=i[s>>2]|0,o=(i[e>>2]|0)-a|0,c=e+4|0,a=(i[c>>2]|0)-a|0,o>>>0>715827881|a>>>0>715827881){if(n=(o|0)>0,(n?(2147483647-o|0)<(o|0):(-2147483648-o|0)>(o|0))||(t=o<<1,r=(a|0)>0,r?(2147483647-a|0)<(a|0):(-2147483648-a|0)>(a|0)))return c=1,c|0;if(l=a<<1,(r?(2147483647-l|0)<(a|0):(-2147483648-l|0)>(a|0))||(n?(2147483647-t|0)<(a|0):(-2147483648-t|0)>(a|0))||(n=a*3|0,(a|0)>-1?(n|-2147483648)>=(o|0):(n^-2147483648|0)<(o|0)))return l=1,l|0}else n=a*3|0,t=o<<1;return r=Tr((t+a|0)*.14285714285714285)|0,i[e>>2]=r,a=Tr((n-o|0)*.14285714285714285)|0,i[c>>2]=a,i[s>>2]=0,n=(a|0)<(r|0),t=n?r:a,n=n?a:r,(n|0)<0&&(((n|0)==-2147483648||((t|0)>0?(2147483647-t|0)<(n|0):(-2147483648-t|0)>(n|0)))&&E(27795,26892,402,26917),((t|0)>-1?(t|-2147483648)>=(n|0):(t^-2147483648|0)<(n|0))&&E(27795,26892,402,26917)),t=a-r|0,(r|0)<0?(n=0-r|0,i[c>>2]=t,i[s>>2]=n,i[e>>2]=0,r=0):(t=a,n=0),(t|0)<0&&(r=r-t|0,i[e>>2]=r,n=n-t|0,i[s>>2]=n,i[c>>2]=0,t=0),o=r-n|0,a=t-n|0,(n|0)<0?(i[e>>2]=o,i[c>>2]=a,i[s>>2]=0,t=a,a=o,n=0):a=r,r=(t|0)<(a|0)?t:a,r=(n|0)<(r|0)?n:r,(r|0)<=0?(l=0,l|0):(i[e>>2]=a-r,i[c>>2]=t-r,i[s>>2]=n-r,l=0,l|0)}function Be(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0;s=e+8|0,n=i[s>>2]|0,t=(i[e>>2]|0)-n|0,c=e+4|0,n=(i[c>>2]|0)-n|0,r=Tr(((t*3|0)-n|0)*.14285714285714285)|0,i[e>>2]=r,t=Tr(((n<<1)+t|0)*.14285714285714285)|0,i[c>>2]=t,i[s>>2]=0,n=t-r|0,(r|0)<0?(o=0-r|0,i[c>>2]=n,i[s>>2]=o,i[e>>2]=0,t=n,r=0,n=o):n=0,(t|0)<0&&(r=r-t|0,i[e>>2]=r,n=n-t|0,i[s>>2]=n,i[c>>2]=0,t=0),o=r-n|0,a=t-n|0,(n|0)<0?(i[e>>2]=o,i[c>>2]=a,i[s>>2]=0,t=a,a=o,n=0):a=r,r=(t|0)<(a|0)?t:a,r=(n|0)<(r|0)?n:r,!((r|0)<=0)&&(i[e>>2]=a-r,i[c>>2]=t-r,i[s>>2]=n-r)}function Ve(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0;s=e+8|0,n=i[s>>2]|0,t=(i[e>>2]|0)-n|0,c=e+4|0,n=(i[c>>2]|0)-n|0,r=Tr(((t<<1)+n|0)*.14285714285714285)|0,i[e>>2]=r,t=Tr(((n*3|0)-t|0)*.14285714285714285)|0,i[c>>2]=t,i[s>>2]=0,n=t-r|0,(r|0)<0?(o=0-r|0,i[c>>2]=n,i[s>>2]=o,i[e>>2]=0,t=n,r=0,n=o):n=0,(t|0)<0&&(r=r-t|0,i[e>>2]=r,n=n-t|0,i[s>>2]=n,i[c>>2]=0,t=0),o=r-n|0,a=t-n|0,(n|0)<0?(i[e>>2]=o,i[c>>2]=a,i[s>>2]=0,t=a,a=o,n=0):a=r,r=(t|0)<(a|0)?t:a,r=(n|0)<(r|0)?n:r,!((r|0)<=0)&&(i[e>>2]=a-r,i[c>>2]=t-r,i[s>>2]=n-r)}function He(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0;t=i[e>>2]|0,s=e+4|0,n=i[s>>2]|0,c=e+8|0,r=i[c>>2]|0,a=n+(t*3|0)|0,i[e>>2]=a,n=r+(n*3|0)|0,i[s>>2]=n,t=(r*3|0)+t|0,i[c>>2]=t,r=n-a|0,(a|0)<0?(t=t-a|0,i[s>>2]=r,i[c>>2]=t,i[e>>2]=0,n=r,r=0):r=a,(n|0)<0&&(r=r-n|0,i[e>>2]=r,t=t-n|0,i[c>>2]=t,i[s>>2]=0,n=0),o=r-t|0,a=n-t|0,(t|0)<0?(i[e>>2]=o,i[s>>2]=a,i[c>>2]=0,r=o,t=0):a=n,n=(a|0)<(r|0)?a:r,n=(t|0)<(n|0)?t:n,!((n|0)<=0)&&(i[e>>2]=r-n,i[s>>2]=a-n,i[c>>2]=t-n)}function Ue(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0;a=i[e>>2]|0,s=e+4|0,t=i[s>>2]|0,c=e+8|0,n=i[c>>2]|0,r=(t*3|0)+a|0,a=n+(a*3|0)|0,i[e>>2]=a,i[s>>2]=r,t=(n*3|0)+t|0,i[c>>2]=t,n=r-a|0,(a|0)<0?(t=t-a|0,i[s>>2]=n,i[c>>2]=t,i[e>>2]=0,a=0):n=r,(n|0)<0&&(a=a-n|0,i[e>>2]=a,t=t-n|0,i[c>>2]=t,i[s>>2]=0,n=0),o=a-t|0,r=n-t|0,(t|0)<0?(i[e>>2]=o,i[s>>2]=r,i[c>>2]=0,a=o,t=0):r=n,n=(r|0)<(a|0)?r:a,n=(t|0)<(n|0)?t:n,!((n|0)<=0)&&(i[e>>2]=a-n,i[s>>2]=r-n,i[c>>2]=t-n)}function We(e,t){e|=0,t|=0;var n=0,r=0,a=0,o=0,s=0,c=0;(t+-1|0)>>>0>=6||(a=(i[15440+(t*12|0)>>2]|0)+(i[e>>2]|0)|0,i[e>>2]=a,c=e+4|0,r=(i[15440+(t*12|0)+4>>2]|0)+(i[c>>2]|0)|0,i[c>>2]=r,s=e+8|0,t=(i[15440+(t*12|0)+8>>2]|0)+(i[s>>2]|0)|0,i[s>>2]=t,n=r-a|0,(a|0)<0?(t=t-a|0,i[c>>2]=n,i[s>>2]=t,i[e>>2]=0,r=0):(n=r,r=a),(n|0)<0&&(r=r-n|0,i[e>>2]=r,t=t-n|0,i[s>>2]=t,i[c>>2]=0,n=0),o=r-t|0,a=n-t|0,(t|0)<0?(i[e>>2]=o,i[c>>2]=a,i[s>>2]=0,r=o,t=0):a=n,n=(a|0)<(r|0)?a:r,n=(t|0)<(n|0)?t:n,!((n|0)<=0)&&(i[e>>2]=r-n,i[c>>2]=a-n,i[s>>2]=t-n))}function Ge(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0;a=i[e>>2]|0,s=e+4|0,t=i[s>>2]|0,c=e+8|0,n=i[c>>2]|0,r=t+a|0,a=n+a|0,i[e>>2]=a,i[s>>2]=r,t=n+t|0,i[c>>2]=t,n=r-a|0,(a|0)<0?(t=t-a|0,i[s>>2]=n,i[c>>2]=t,i[e>>2]=0,r=0):(n=r,r=a),(n|0)<0&&(r=r-n|0,i[e>>2]=r,t=t-n|0,i[c>>2]=t,i[s>>2]=0,n=0),o=r-t|0,a=n-t|0,(t|0)<0?(i[e>>2]=o,i[s>>2]=a,i[c>>2]=0,r=o,t=0):a=n,n=(a|0)<(r|0)?a:r,n=(t|0)<(n|0)?t:n,!((n|0)<=0)&&(i[e>>2]=r-n,i[s>>2]=a-n,i[c>>2]=t-n)}function Ke(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0;t=i[e>>2]|0,s=e+4|0,r=i[s>>2]|0,c=e+8|0,n=i[c>>2]|0,a=r+t|0,i[e>>2]=a,r=n+r|0,i[s>>2]=r,t=n+t|0,i[c>>2]=t,n=r-a|0,(a|0)<0?(t=t-a|0,i[s>>2]=n,i[c>>2]=t,i[e>>2]=0,r=0):(n=r,r=a),(n|0)<0&&(r=r-n|0,i[e>>2]=r,t=t-n|0,i[c>>2]=t,i[s>>2]=0,n=0),o=r-t|0,a=n-t|0,(t|0)<0?(i[e>>2]=o,i[s>>2]=a,i[c>>2]=0,r=o,t=0):a=n,n=(a|0)<(r|0)?a:r,n=(t|0)<(n|0)?t:n,!((n|0)<=0)&&(i[e>>2]=r-n,i[s>>2]=a-n,i[c>>2]=t-n)}function G(e){switch(e|=0,e|0){case 1:e=5;break;case 5:e=4;break;case 4:e=6;break;case 6:e=2;break;case 2:e=3;break;case 3:e=1;break;default:}return e|0}function qe(e){switch(e|=0,e|0){case 1:e=3;break;case 3:e=2;break;case 2:e=6;break;case 6:e=4;break;case 4:e=5;break;case 5:e=1;break;default:}return e|0}function Je(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0;t=i[e>>2]|0,s=e+4|0,n=i[s>>2]|0,c=e+8|0,r=i[c>>2]|0,a=n+(t<<1)|0,i[e>>2]=a,n=r+(n<<1)|0,i[s>>2]=n,t=(r<<1)+t|0,i[c>>2]=t,r=n-a|0,(a|0)<0?(t=t-a|0,i[s>>2]=r,i[c>>2]=t,i[e>>2]=0,n=r,r=0):r=a,(n|0)<0&&(r=r-n|0,i[e>>2]=r,t=t-n|0,i[c>>2]=t,i[s>>2]=0,n=0),o=r-t|0,a=n-t|0,(t|0)<0?(i[e>>2]=o,i[s>>2]=a,i[c>>2]=0,r=o,t=0):a=n,n=(a|0)<(r|0)?a:r,n=(t|0)<(n|0)?t:n,!((n|0)<=0)&&(i[e>>2]=r-n,i[s>>2]=a-n,i[c>>2]=t-n)}function Ye(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0;a=i[e>>2]|0,s=e+4|0,t=i[s>>2]|0,c=e+8|0,n=i[c>>2]|0,r=(t<<1)+a|0,a=n+(a<<1)|0,i[e>>2]=a,i[s>>2]=r,t=(n<<1)+t|0,i[c>>2]=t,n=r-a|0,(a|0)<0?(t=t-a|0,i[s>>2]=n,i[c>>2]=t,i[e>>2]=0,a=0):n=r,(n|0)<0&&(a=a-n|0,i[e>>2]=a,t=t-n|0,i[c>>2]=t,i[s>>2]=0,n=0),o=a-t|0,r=n-t|0,(t|0)<0?(i[e>>2]=o,i[s>>2]=r,i[c>>2]=0,a=o,t=0):r=n,n=(r|0)<(a|0)?r:a,n=(t|0)<(n|0)?t:n,!((n|0)<=0)&&(i[e>>2]=a-n,i[s>>2]=r-n,i[c>>2]=t-n)}function Xe(e,t){e|=0,t|=0;var n=0,r=0,a=0,o=0,s=0,c=0;return s=(i[e>>2]|0)-(i[t>>2]|0)|0,c=(s|0)<0,r=(i[e+4>>2]|0)-(i[t+4>>2]|0)-(c?s:0)|0,o=(r|0)<0,a=(c?0-s|0:0)+(i[e+8>>2]|0)-(i[t+8>>2]|0)+(o?0-r|0:0)|0,e=(a|0)<0,t=e?0:a,n=(o?0:r)-(e?a:0)|0,a=(c?0:s)-(o?r:0)-(e?a:0)|0,e=(n|0)<(a|0)?n:a,e=(t|0)<(e|0)?t:e,r=(e|0)>0,t=t-(r?e:0)|0,n=n-(r?e:0)|0,e=a-(r?e:0)|0,e=(e|0)>-1?e:0-e|0,n=(n|0)>-1?n:0-n|0,t=(t|0)>-1?t:0-t|0,t=(n|0)>(t|0)?n:t,((e|0)>(t|0)?e:t)|0}function Ze(e,t){e|=0,t|=0;var n=0;n=i[e+8>>2]|0,i[t>>2]=(i[e>>2]|0)-n,i[t+4>>2]=(i[e+4>>2]|0)-n}function Qe(e,t){e|=0,t|=0;var n=0,r=0,a=0,o=0,s=0,c=0;return r=i[e>>2]|0,i[t>>2]=r,a=i[e+4>>2]|0,s=t+4|0,i[s>>2]=a,c=t+8|0,i[c>>2]=0,n=(a|0)<(r|0),e=n?r:a,n=n?a:r,(n|0)<0&&((n|0)==-2147483648||((e|0)>0?(2147483647-e|0)<(n|0):(-2147483648-e|0)>(n|0))||((e|0)>-1?(e|-2147483648)>=(n|0):(e^-2147483648|0)<(n|0)))?(t=1,t|0):(e=a-r|0,(r|0)<0?(n=0-r|0,i[s>>2]=e,i[c>>2]=n,i[t>>2]=0,r=0):(e=a,n=0),(e|0)<0&&(r=r-e|0,i[t>>2]=r,n=n-e|0,i[c>>2]=n,i[s>>2]=0,e=0),o=r-n|0,a=e-n|0,(n|0)<0?(i[t>>2]=o,i[s>>2]=a,i[c>>2]=0,e=a,a=o,n=0):a=r,r=(e|0)<(a|0)?e:a,r=(n|0)<(r|0)?n:r,(r|0)<=0?(t=0,t|0):(i[t>>2]=a-r,i[s>>2]=e-r,i[c>>2]=n-r,t=0,t|0))}function $e(e){e|=0;var t=0,n=0,r=0,a=0;t=e+8|0,a=i[t>>2]|0,n=a-(i[e>>2]|0)|0,i[e>>2]=n,r=e+4|0,e=(i[r>>2]|0)-a|0,i[r>>2]=e,i[t>>2]=0-(e+n)}function et(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0;n=i[e>>2]|0,t=0-n|0,i[e>>2]=t,s=e+8|0,i[s>>2]=0,c=e+4|0,r=i[c>>2]|0,a=r+n|0,(n|0)>0?(i[c>>2]=a,i[s>>2]=n,i[e>>2]=0,t=0,r=a):n=0,(r|0)<0?(o=t-r|0,i[e>>2]=o,n=n-r|0,i[s>>2]=n,i[c>>2]=0,a=o-n|0,t=0-n|0,(n|0)<0?(i[e>>2]=a,i[c>>2]=t,i[s>>2]=0,r=t,n=0):(r=0,a=o)):a=t,t=(r|0)<(a|0)?r:a,t=(n|0)<(t|0)?n:t,!((t|0)<=0)&&(i[e>>2]=a-t,i[c>>2]=r-t,i[s>>2]=n-t)}function tt(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var o=0,s=0,c=0,l=0,u=0,d=0,f=0;if(f=M,M=M+64|0,d=f,c=f+56|0,!(!0&(t&2013265920|0)==134217728&(!0&(r&2013265920|0)==134217728)))return a=5,M=f,a|0;if((e|0)==(n|0)&(t|0)==(r|0))return i[a>>2]=0,a=0,M=f,a|0;if(s=q(e|0,t|0,52)|0,T()|0,s&=15,u=q(n|0,r|0,52)|0,T()|0,(s|0)!=(u&15|0))return a=12,M=f,a|0;if(o=s+-1|0,s>>>0>1){Dt(e,t,o,d)|0,Dt(n,r,o,c)|0,u=d,l=i[u>>2]|0,u=i[u+4>>2]|0;a:do if((l|0)==(i[c>>2]|0)&&(u|0)==(i[c+4>>2]|0)){s=(s^15)*3|0,o=q(e|0,t|0,s|0)|0,T()|0,o&=7,s=q(n|0,r|0,s|0)|0,T()|0,s&=7;do if((o|0)==0|(s|0)==0)i[a>>2]=1,o=0;else if((o|0)==7)o=5;else{if((o|0)==1|(s|0)==1&&kt(l,u)|0){o=5;break}if((i[15536+(o<<2)>>2]|0)!=(s|0)&&(i[15568+(o<<2)>>2]|0)!=(s|0))break a;i[a>>2]=1,o=0}while(0);return a=o,M=f,a|0}while(0)}o=d,s=o+56|0;do i[o>>2]=0,o=o+4|0;while((o|0)<(s|0));return ne(e,t,1,d)|0,t=d,!((i[t>>2]|0)==(n|0)&&(i[t+4>>2]|0)==(r|0))&&(t=d+8|0,!((i[t>>2]|0)==(n|0)&&(i[t+4>>2]|0)==(r|0)))&&(t=d+16|0,!((i[t>>2]|0)==(n|0)&&(i[t+4>>2]|0)==(r|0)))&&(t=d+24|0,!((i[t>>2]|0)==(n|0)&&(i[t+4>>2]|0)==(r|0)))&&(t=d+32|0,!((i[t>>2]|0)==(n|0)&&(i[t+4>>2]|0)==(r|0)))&&(t=d+40|0,!((i[t>>2]|0)==(n|0)&&(i[t+4>>2]|0)==(r|0)))?(o=d+48|0,o=((i[o>>2]|0)==(n|0)?(i[o+4>>2]|0)==(r|0):0)&1):o=1,i[a>>2]=o,a=0,M=f,a|0}function nt(e,t,n,r,a){return e|=0,t|=0,n|=0,r|=0,a|=0,n=le(e,t,n,r)|0,(n|0)==7?(a=11,a|0):(r=J(n|0,0,56)|0,t=t&-2130706433|T()|268435456,i[a>>2]=e|r,i[a+4>>2]=t,a=0,a|0)}function rt(e,t,n){return e|=0,t|=0,n|=0,!0&(t&2013265920|0)==268435456?(i[n>>2]=e,i[n+4>>2]=t&-2130706433|134217728,n=0,n|0):(n=6,n|0)}function it(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0;return a=M,M=M+16|0,r=a,i[r>>2]=0,!0&(t&2013265920|0)==268435456?(o=q(e|0,t|0,56)|0,T()|0,r=L(e,t&-2130706433|134217728,o&7,r,n)|0,M=a,r|0):(r=6,M=a,r|0)}function at(e,t){e|=0,t|=0;var n=0;switch(n=q(e|0,t|0,56)|0,T()|0,n&7){case 0:case 7:return n=0,n|0;default:}return n=t&-2130706433|134217728,!(!0&(t&2013265920|0)==268435456)||!0&(t&117440512|0)==16777216&(kt(e,n)|0)!=0?(n=0,n|0):(n=wt(e,n)|0,n|0)}function ot(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0,s=0;return a=M,M=M+16|0,r=a,!0&(t&2013265920|0)==268435456?(o=t&-2130706433|134217728,s=n,i[s>>2]=e,i[s+4>>2]=o,i[r>>2]=0,t=q(e|0,t|0,56)|0,T()|0,r=L(e,o,t&7,r,n+8|0)|0,M=a,r|0):(r=6,M=a,r|0)}function st(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0;return a=(kt(e,t)|0)==0,t&=-2130706433,r=n,i[r>>2]=a?e:0,i[r+4>>2]=a?t|285212672:0,r=n+8|0,i[r>>2]=e,i[r+4>>2]=t|301989888,r=n+16|0,i[r>>2]=e,i[r+4>>2]=t|318767104,r=n+24|0,i[r>>2]=e,i[r+4>>2]=t|335544320,r=n+32|0,i[r>>2]=e,i[r+4>>2]=t|352321536,n=n+40|0,i[n>>2]=e,i[n+4>>2]=t|369098752,0}function ct(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0,s=0;return s=M,M=M+16|0,a=s,o=t&-2130706433|134217728,!0&(t&2013265920|0)==268435456?(r=q(e|0,t|0,56)|0,T()|0,r=dr(e,o,r&7)|0,(r|0)==-1?(i[n>>2]=0,o=6,M=s,o|0):(Kt(e,o,a)|0&&E(27795,26932,282,26947),t=q(e|0,t|0,52)|0,T()|0,t&=15,kt(e,o)|0?mt(a,t,r,2,n):vt(a,t,r,2,n),o=0,M=s,o|0)):(o=6,M=s,o|0)}function lt(e,t,n){e|=0,t|=0,n|=0;var r=0,i=0;r=M,M=M+16|0,i=r,ut(e,t,n,i),Ne(i,n+4|0),M=r}function ut(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var o=0,s=0,c=0,l=0,u=0;if(l=M,M=M+16|0,u=l,dt(e,n,u),s=+h(+(1-a[u>>3]*.5)),s<1e-16){i[r>>2]=0,i[r+4>>2]=0,i[r+8>>2]=0,i[r+12>>2]=0,M=l;return}if(u=i[n>>2]|0,o=+a[15920+(u*24|0)>>3],o=+an(o-+an(+dn(15600+(u<<4)|0,e))),c=Ut(t)|0?+an(o+-.3334731722518321):o,o=m(+s)*2.618033988749896,(t|0)>0){e=0;do o*=2.6457513110645907,e=e+1|0;while((e|0)!=(t|0))}s=+f(+c)*o,a[r>>3]=s,c=+p(+c)*o,a[r+8>>3]=c,M=l}function dt(e,t,n){e|=0,t|=0,n|=0;var r=0,o=0,s=0;if(s=M,M=M+32|0,o=s,ur(e,o),i[t>>2]=0,a[n>>3]=5,r=+lr(16400,o),r<+a[n>>3]&&(i[t>>2]=0,a[n>>3]=r),r=+lr(16424,o),r<+a[n>>3]&&(i[t>>2]=1,a[n>>3]=r),r=+lr(16448,o),r<+a[n>>3]&&(i[t>>2]=2,a[n>>3]=r),r=+lr(16472,o),r<+a[n>>3]&&(i[t>>2]=3,a[n>>3]=r),r=+lr(16496,o),r<+a[n>>3]&&(i[t>>2]=4,a[n>>3]=r),r=+lr(16520,o),r<+a[n>>3]&&(i[t>>2]=5,a[n>>3]=r),r=+lr(16544,o),r<+a[n>>3]&&(i[t>>2]=6,a[n>>3]=r),r=+lr(16568,o),r<+a[n>>3]&&(i[t>>2]=7,a[n>>3]=r),r=+lr(16592,o),r<+a[n>>3]&&(i[t>>2]=8,a[n>>3]=r),r=+lr(16616,o),r<+a[n>>3]&&(i[t>>2]=9,a[n>>3]=r),r=+lr(16640,o),r<+a[n>>3]&&(i[t>>2]=10,a[n>>3]=r),r=+lr(16664,o),r<+a[n>>3]&&(i[t>>2]=11,a[n>>3]=r),r=+lr(16688,o),r<+a[n>>3]&&(i[t>>2]=12,a[n>>3]=r),r=+lr(16712,o),r<+a[n>>3]&&(i[t>>2]=13,a[n>>3]=r),r=+lr(16736,o),r<+a[n>>3]&&(i[t>>2]=14,a[n>>3]=r),r=+lr(16760,o),r<+a[n>>3]&&(i[t>>2]=15,a[n>>3]=r),r=+lr(16784,o),r<+a[n>>3]&&(i[t>>2]=16,a[n>>3]=r),r=+lr(16808,o),r<+a[n>>3]&&(i[t>>2]=17,a[n>>3]=r),r=+lr(16832,o),r<+a[n>>3]&&(i[t>>2]=18,a[n>>3]=r),r=+lr(16856,o),!(r<+a[n>>3])){M=s;return}i[t>>2]=19,a[n>>3]=r,M=s}function ft(e,t,n,r,o){e|=0,t|=0,n|=0,r|=0,o|=0;var s=0,c=0,l=0;if(s=+or(e),s<1e-16){t=15600+(t<<4)|0,i[o>>2]=i[t>>2],i[o+4>>2]=i[t+4>>2],i[o+8>>2]=i[t+8>>2],i[o+12>>2]=i[t+12>>2];return}if(c=+v(+ +a[e+8>>3],+ +a[e>>3]),(n|0)>0){e=0;do s*=.37796447300922725,e=e+1|0;while((e|0)!=(n|0))}l=s*.3333333333333333,r?(n=(Ut(n)|0)==0,s=+_(+((n?l:l*.37796447300922725)*.381966011250105))):(s=+_(+(s*.381966011250105)),Ut(n)|0&&(c=+an(c+.3334731722518321))),fn(15600+(t<<4)|0,+an(+a[15920+(t*24|0)>>3]-c),s,o)}function pt(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0;r=M,M=M+16|0,a=r,Fe(e+4|0,a),ft(a,i[e>>2]|0,t,0,n),M=r}function mt(e,t,n,r,o){e|=0,t|=0,n|=0,r|=0,o|=0;var s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,D=0,O=0,k=0,A=0,j=0,N=0,P=0,ee=0,F=0;if(P=M,M=M+272|0,s=P+256|0,b=P+240|0,A=P,j=P+224|0,N=P+208|0,x=P+176|0,S=P+160|0,C=P+192|0,w=P+144|0,T=P+128|0,D=P+112|0,O=P+96|0,k=P+80|0,i[s>>2]=t,i[b>>2]=i[e>>2],i[b+4>>2]=i[e+4>>2],i[b+8>>2]=i[e+8>>2],i[b+12>>2]=i[e+12>>2],ht(b,s,A),i[o>>2]=0,b=r+n+((r|0)==5&1)|0,(b|0)<=(n|0)){M=P;return}u=i[s>>2]|0,d=j+4|0,f=x+4|0,p=n+5|0,m=16880+(u<<2)|0,h=16960+(u<<2)|0,g=T+8|0,_=D+8|0,v=O+8|0,y=N+4|0,l=n;a:for(;;){c=A+(((l|0)%5|0)<<4)|0,i[N>>2]=i[c>>2],i[N+4>>2]=i[c+4>>2],i[N+8>>2]=i[c+8>>2],i[N+12>>2]=i[c+12>>2];do;while((gt(N,u,0,1)|0)==2);if((l|0)>(n|0)&(Ut(t)|0)!=0){if(i[x>>2]=i[N>>2],i[x+4>>2]=i[N+4>>2],i[x+8>>2]=i[N+8>>2],i[x+12>>2]=i[N+12>>2],Fe(d,S),r=i[x>>2]|0,s=i[17040+(r*80|0)+(i[j>>2]<<2)>>2]|0,i[x>>2]=i[18640+(r*80|0)+(s*20|0)>>2],c=i[18640+(r*80|0)+(s*20|0)+16>>2]|0,(c|0)>0){e=0;do Ge(f),e=e+1|0;while((e|0)<(c|0))}switch(c=18640+(r*80|0)+(s*20|0)+4|0,i[C>>2]=i[c>>2],i[C+4>>2]=i[c+4>>2],i[C+8>>2]=i[c+8>>2],Le(C,(i[m>>2]|0)*3|0),U(f,C,f),Pe(f),Fe(f,w),ee=+(i[h>>2]|0),a[T>>3]=ee*3,a[g>>3]=0,F=ee*-1.5,a[D>>3]=F,a[_>>3]=ee*2.598076211353316,a[O>>3]=F,a[v>>3]=ee*-2.598076211353316,i[17040+((i[x>>2]|0)*80|0)+(i[N>>2]<<2)>>2]|0){case 1:e=D,r=T;break;case 3:e=O,r=D;break;case 2:e=T,r=O;break;default:e=12;break a}sr(S,w,r,e,k),ft(k,i[x>>2]|0,u,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=(i[o>>2]|0)+1}if((l|0)<(p|0)&&(Fe(y,x),ft(x,i[N>>2]|0,u,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=(i[o>>2]|0)+1),i[j>>2]=i[N>>2],i[j+4>>2]=i[N+4>>2],i[j+8>>2]=i[N+8>>2],i[j+12>>2]=i[N+12>>2],l=l+1|0,(l|0)>=(b|0)){e=3;break}}if((e|0)==3){M=P;return}else(e|0)==12&&E(26970,27017,572,27027)}function ht(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0,s=0,c=0,l=0;l=M,M=M+128|0,r=l+64|0,a=l,o=r,s=20240,c=o+60|0;do i[o>>2]=i[s>>2],o=o+4|0,s=s+4|0;while((o|0)<(c|0));o=a,s=20304,c=o+60|0;do i[o>>2]=i[s>>2],o=o+4|0,s=s+4|0;while((o|0)<(c|0));c=(Ut(i[t>>2]|0)|0)==0,r=c?r:a,a=e+4|0,Je(a),Ye(a),Ut(i[t>>2]|0)|0&&(Ue(a),i[t>>2]=(i[t>>2]|0)+1),i[n>>2]=i[e>>2],t=n+4|0,U(a,r,t),Pe(t),i[n+16>>2]=i[e>>2],t=n+20|0,U(a,r+12|0,t),Pe(t),i[n+32>>2]=i[e>>2],t=n+36|0,U(a,r+24|0,t),Pe(t),i[n+48>>2]=i[e>>2],t=n+52|0,U(a,r+36|0,t),Pe(t),i[n+64>>2]=i[e>>2],n=n+68|0,U(a,r+48|0,n),Pe(n),M=l}function gt(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0;if(h=M,M=M+32|0,p=h+12|0,c=h,m=e+4|0,f=i[16960+(t<<2)>>2]|0,d=(r|0)!=0,f=d?f*3|0:f,a=i[m>>2]|0,u=e+8|0,s=i[u>>2]|0,d){if(o=e+12|0,r=i[o>>2]|0,a=s+a+r|0,(a|0)==(f|0))return m=1,M=h,m|0;l=o}else l=e+12|0,r=i[l>>2]|0,a=s+a+r|0;if((a|0)<=(f|0))return m=0,M=h,m|0;do if((r|0)>0){if(r=i[e>>2]|0,(s|0)>0){o=18640+(r*80|0)+60|0,r=e;break}r=18640+(r*80|0)+40|0,n?(Me(p,f,0,0),Ie(m,p,c),Ke(c),U(c,p,m),o=r,r=e):(o=r,r=e)}else o=18640+((i[e>>2]|0)*80|0)+20|0,r=e;while(0);if(i[r>>2]=i[o>>2],a=o+16|0,(i[a>>2]|0)>0){r=0;do Ge(m),r=r+1|0;while((r|0)<(i[a>>2]|0))}return e=o+4|0,i[p>>2]=i[e>>2],i[p+4>>2]=i[e+4>>2],i[p+8>>2]=i[e+8>>2],t=i[16880+(t<<2)>>2]|0,Le(p,d?t*3|0:t),U(m,p,m),Pe(m),r=d&&((i[u>>2]|0)+(i[m>>2]|0)+(i[l>>2]|0)|0)==(f|0)?1:2,m=r,M=h,m|0}function _t(e,t){e|=0,t|=0;var n=0;do n=gt(e,t,0,1)|0;while((n|0)==2);return n|0}function vt(e,t,n,r,o){e|=0,t|=0,n|=0,r|=0,o|=0;var s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,D=0,O=0,k=0,A=0;if(O=M,M=M+240|0,s=O+224|0,C=O+208|0,w=O,T=O+192|0,D=O+176|0,v=O+160|0,y=O+144|0,b=O+128|0,x=O+112|0,S=O+96|0,i[s>>2]=t,i[C>>2]=i[e>>2],i[C+4>>2]=i[e+4>>2],i[C+8>>2]=i[e+8>>2],i[C+12>>2]=i[e+12>>2],yt(C,s,w),i[o>>2]=0,_=r+n+((r|0)==6&1)|0,(_|0)<=(n|0)){M=O;return}u=i[s>>2]|0,d=n+6|0,f=16960+(u<<2)|0,p=y+8|0,m=b+8|0,h=x+8|0,g=T+4|0,c=0,l=n,r=-1;a:for(;;){if(s=(l|0)%6|0,e=w+(s<<4)|0,i[T>>2]=i[e>>2],i[T+4>>2]=i[e+4>>2],i[T+8>>2]=i[e+8>>2],i[T+12>>2]=i[e+12>>2],e=c,c=gt(T,u,0,1)|0,(l|0)>(n|0)&(Ut(t)|0)!=0&&(e|0)!=1&&(i[T>>2]|0)!=(r|0)){switch(Fe(w+(((s+5|0)%6|0)<<4)+4|0,D),Fe(w+(s<<4)+4|0,v),k=+(i[f>>2]|0),a[y>>3]=k*3,a[p>>3]=0,A=k*-1.5,a[b>>3]=A,a[m>>3]=k*2.598076211353316,a[x>>3]=A,a[h>>3]=k*-2.598076211353316,s=i[C>>2]|0,i[17040+(s*80|0)+(((r|0)==(s|0)?i[T>>2]|0:r)<<2)>>2]|0){case 1:e=b,r=y;break;case 3:e=x,r=b;break;case 2:e=y,r=x;break;default:e=8;break a}sr(D,v,r,e,S),!(cr(D,S)|0)&&!(cr(v,S)|0)&&(ft(S,i[C>>2]|0,u,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=(i[o>>2]|0)+1)}if((l|0)<(d|0)&&(Fe(g,D),ft(D,i[T>>2]|0,u,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=(i[o>>2]|0)+1),l=l+1|0,(l|0)>=(_|0)){e=3;break}else r=i[T>>2]|0}if((e|0)==3){M=O;return}else(e|0)==8&&E(27054,27017,737,27099)}function yt(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0,s=0,c=0,l=0;l=M,M=M+160|0,r=l+80|0,a=l,o=r,s=20368,c=o+72|0;do i[o>>2]=i[s>>2],o=o+4|0,s=s+4|0;while((o|0)<(c|0));o=a,s=20448,c=o+72|0;do i[o>>2]=i[s>>2],o=o+4|0,s=s+4|0;while((o|0)<(c|0));c=(Ut(i[t>>2]|0)|0)==0,r=c?r:a,a=e+4|0,Je(a),Ye(a),Ut(i[t>>2]|0)|0&&(Ue(a),i[t>>2]=(i[t>>2]|0)+1),i[n>>2]=i[e>>2],t=n+4|0,U(a,r,t),Pe(t),i[n+16>>2]=i[e>>2],t=n+20|0,U(a,r+12|0,t),Pe(t),i[n+32>>2]=i[e>>2],t=n+36|0,U(a,r+24|0,t),Pe(t),i[n+48>>2]=i[e>>2],t=n+52|0,U(a,r+36|0,t),Pe(t),i[n+64>>2]=i[e>>2],t=n+68|0,U(a,r+48|0,t),Pe(t),i[n+80>>2]=i[e>>2],n=n+84|0,U(a,r+60|0,n),Pe(n),M=l}function bt(e,t){return e|=0,t|=0,t=q(e|0,t|0,52)|0,T()|0,t&15|0}function xt(e,t){return e|=0,t|=0,t=q(e|0,t|0,45)|0,T()|0,t&127|0}function St(e,t,n,r){return e|=0,t|=0,n|=0,r|=0,(n+-1|0)>>>0>14?(r=4,r|0):(n=q(e|0,t|0,(15-n|0)*3|0)|0,T()|0,i[r>>2]=n&7,r=0,r|0)}function Ct(e,t,n,a){e|=0,t|=0,n|=0,a|=0;var o=0,s=0,c=0,l=0,u=0,d=0;if(e>>>0>15)return a=4,a|0;if(t>>>0>121)return a=17,a|0;c=J(e|0,0,52)|0,o=T()|0,l=J(t|0,0,45)|0,o=o|T()|134225919;a:do if((e|0)>=1){for(l=1,c=(r[20528+t>>0]|0)!=0,s=-1;;){if(t=i[n+(l+-1<<2)>>2]|0,t>>>0>6){o=18,t=10;break}if(!((t|0)==0|c^1))if((t|0)==1){o=19,t=10;break}else c=0;if(d=(15-l|0)*3|0,u=J(7,0,d|0)|0,o&=~(T()|0),t=J(t|0,((t|0)<0)<<31>>31|0,d|0)|0,s=t|s&~u,o=T()|0|o,(l|0)<(e|0))l=l+1|0;else break a}if((t|0)==10)return o|0}else s=-1;while(0);return d=a,i[d>>2]=s,i[d+4>>2]=o,d=0,d|0}function wt(e,t){e|=0,t|=0;var n=0,i=0,a=0,o=0,s=0;return!(!0&(t&-16777216|0)==134217728)||(i=q(e|0,t|0,52)|0,T()|0,i&=15,n=q(e|0,t|0,45)|0,T()|0,n&=127,n>>>0>121)?(e=0,e|0):(s=(i^15)*3|0,a=q(e|0,t|0,s|0)|0,s=J(a|0,T()|0,s|0)|0,a=T()|0,o=kr(-1227133514,-1171,s|0,a|0)|0,!((s&613566756&o|0)==0&(a&4681&(T()|0)|0)==0)||(s=(i*3|0)+19|0,o=J(~e|0,~t|0,s|0)|0,s=q(o|0,T()|0,s|0)|0,!((i|0)==15|(s|0)==0&(T()|0)==0))?(s=0,s|0):!(r[20528+n>>0]|0)||(t&=8191,(e|0)==0&(t|0)==0)?(s=1,s|0):(s=Rr(e|0,t|0,0)|0,T()|0,((63-s|0)%3|0)!=0|0))}function Tt(e,t){e|=0,t|=0;var n=0,i=0,a=0,o=0,s=0;return!0&(t&-16777216|0)==134217728&&(i=q(e|0,t|0,52)|0,T()|0,i&=15,n=q(e|0,t|0,45)|0,T()|0,n&=127,n>>>0<=121)&&(s=(i^15)*3|0,a=q(e|0,t|0,s|0)|0,s=J(a|0,T()|0,s|0)|0,a=T()|0,o=kr(-1227133514,-1171,s|0,a|0)|0,(s&613566756&o|0)==0&(a&4681&(T()|0)|0)==0)&&(s=(i*3|0)+19|0,o=J(~e|0,~t|0,s|0)|0,s=q(o|0,T()|0,s|0)|0,(i|0)==15|(s|0)==0&(T()|0)==0)&&(!(r[20528+n>>0]|0)||(n=t&8191,(e|0)==0&(n|0)==0)||(s=Rr(e|0,n|0,0)|0,T()|0,(63-s|0)%3|0))||at(e,t)|0?(s=1,s|0):(s=(gr(e,t)|0)!=0&1,s|0)}function Et(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0;if(a=J(t|0,0,52)|0,o=T()|0,n=J(n|0,0,45)|0,n=o|T()|134225919,(t|0)<1){o=-1,r=n,t=e,i[t>>2]=o,e=e+4|0,i[e>>2]=r;return}for(o=1,a=-1;s=(15-o|0)*3|0,c=J(7,0,s|0)|0,n&=~(T()|0),s=J(r|0,0,s|0)|0,a=a&~c|s,n=n|T()|0,(o|0)!=(t|0);)o=o+1|0;c=e,s=c,i[s>>2]=a,c=c+4|0,i[c>>2]=n}function Dt(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0;if(o=q(e|0,t|0,52)|0,T()|0,o&=15,n>>>0>15)return r=4,r|0;if((o|0)<(n|0))return r=12,r|0;if((o|0)==(n|0))return i[r>>2]=e,i[r+4>>2]=t,r=0,r|0;if(a=J(n|0,0,52)|0,a|=e,e=T()|0|t&-15728641,(o|0)>(n|0))do t=J(7,0,(14-n|0)*3|0)|0,n=n+1|0,a=t|a,e=T()|0|e;while((n|0)<(o|0));return i[r>>2]=a,i[r+4>>2]=e,r=0,r|0}function Ot(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0;if(o=q(e|0,t|0,52)|0,T()|0,o&=15,!((n|0)<16&(o|0)<=(n|0)))return r=4,r|0;a=n-o|0,n=q(e|0,t|0,45)|0,T()|0;a:do if(!(R(n&127)|0))n=Ln(7,0,a,((a|0)<0)<<31>>31)|0,a=T()|0;else{b:do if(o|0){for(n=1;s=J(7,0,(15-n|0)*3|0)|0,(s&e|0)==0&((T()|0)&t|0)==0;)if(n>>>0>>0)n=n+1|0;else break b;n=Ln(7,0,a,((a|0)<0)<<31>>31)|0,a=T()|0;break a}while(0);n=Ln(7,0,a,((a|0)<0)<<31>>31)|0,n=Pr(n|0,T()|0,5,0)|0,n=K(n|0,T()|0,-5,-1)|0,n=Mr(n|0,T()|0,6,0)|0,n=K(n|0,T()|0,1,0)|0,a=T()|0}while(0);return s=r,i[s>>2]=n,i[s+4>>2]=a,s=0,s|0}function kt(e,t){e|=0,t|=0;var n=0,r=0,i=0;if(i=q(e|0,t|0,45)|0,T()|0,!(R(i&127)|0))return i=0,i|0;i=q(e|0,t|0,52)|0,T()|0,i&=15;a:do if(!i)n=0;else for(r=1;;){if(n=q(e|0,t|0,(15-r|0)*3|0)|0,T()|0,n&=7,n|0)break a;if(r>>>0>>0)r=r+1|0;else{n=0;break}}while(0);return i=(n|0)==0&1,i|0}function At(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0;if(s=M,M=M+16|0,o=s,tn(o,e,t,n),t=o,e=i[t>>2]|0,t=i[t+4>>2]|0,(e|0)==0&(t|0)==0)return M=s,0;a=0,n=0;do c=r+(a<<3)|0,i[c>>2]=e,i[c+4>>2]=t,a=K(a|0,n|0,1,0)|0,n=T()|0,rn(o),c=o,e=i[c>>2]|0,t=i[c+4>>2]|0;while(!((e|0)==0&(t|0)==0));return M=s,0}function jt(e,t,n,r){return e|=0,t|=0,n|=0,r|=0,(r|0)<(n|0)?(n=t,r=e,w(n|0),r|0):(n=J(-1,-1,((r-n|0)*3|0)+3|0)|0,r=J(~n|0,~(T()|0)|0,(15-r|0)*3|0)|0,n=~(T()|0)&t,r=~r&e,w(n|0),r|0)}function Mt(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0;return a=q(e|0,t|0,52)|0,T()|0,a&=15,(n|0)<16&(a|0)<=(n|0)?((a|0)<(n|0)&&(a=J(-1,-1,((n+-1-a|0)*3|0)+3|0)|0,a=J(~a|0,~(T()|0)|0,(15-n|0)*3|0)|0,t=~(T()|0)&t,e=~a&e),a=J(n|0,0,52)|0,n=t&-15728641|T()|0,i[r>>2]=e|a,i[r+4>>2]=n,r=0,r|0):(r=4,r|0)}function Nt(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,D=0,O=0,k=0,A=0,j=0,M=0;if((n|0)==0&(r|0)==0)return M=0,M|0;if(a=e,o=i[a>>2]|0,a=i[a+4>>2]|0,!0&(a&15728640|0)==0){if(!((r|0)>0|(r|0)==0&n>>>0>0)||(M=t,i[M>>2]=o,i[M+4>>2]=a,(n|0)==1&(r|0)==0))return M=0,M|0;a=1,o=0;do A=e+(a<<3)|0,j=i[A+4>>2]|0,M=t+(a<<3)|0,i[M>>2]=i[A>>2],i[M+4>>2]=j,a=K(a|0,o|0,1,0)|0,o=T()|0;while((o|0)<(r|0)|(o|0)==(r|0)&a>>>0>>0);return a=0,a|0}if(k=n<<3,j=Er(k)|0,!j)return M=13,M|0;if(Hr(j|0,e|0,k|0)|0,A=Or(n,8)|0,!A)return Dr(j),M=13,M|0;a:for(;;){a=j,u=i[a>>2]|0,a=i[a+4>>2]|0,D=q(u|0,a|0,52)|0,T()|0,D&=15,O=D+-1|0,w=(D|0)!=0,C=(r|0)>0|(r|0)==0&n>>>0>0;b:do if(w&C){if(y=J(O|0,0,52)|0,b=T()|0,O>>>0>15){if(!((u|0)==0&(a|0)==0)){M=16;break a}for(o=0,e=0;;){if(o=K(o|0,e|0,1,0)|0,e=T()|0,!((e|0)<(r|0)|(e|0)==(r|0)&o>>>0>>0))break b;if(s=j+(o<<3)|0,S=i[s>>2]|0,s=i[s+4>>2]|0,!((S|0)==0&(s|0)==0)){a=s,M=16;break a}}}for(c=u,e=a,o=0,s=0;;){if(!((c|0)==0&(e|0)==0)){if(!(!0&(e&117440512|0)==0)){M=21;break a}if(d=q(c|0,e|0,52)|0,T()|0,d&=15,(d|0)<(O|0)){a=12,M=27;break a}if((d|0)!=(O|0)&&(c|=y,e=e&-15728641|b,d>>>0>=D>>>0)){l=O;do S=J(7,0,(14-l|0)*3|0)|0,l=l+1|0,c=S|c,e=T()|0|e;while(l>>>0>>0)}if(p=Ir(c|0,e|0,n|0,r|0)|0,m=T()|0,l=A+(p<<3)|0,d=l,f=i[d>>2]|0,d=i[d+4>>2]|0,!((f|0)==0&(d|0)==0)){_=0,v=0;do{if((_|0)>(r|0)|(_|0)==(r|0)&v>>>0>n>>>0){M=31;break a}if((f|0)==(c|0)&(d&-117440513|0)==(e|0)){h=q(f|0,d|0,56)|0,T()|0,h&=7,g=h+1|0,S=q(f|0,d|0,45)|0,T()|0;c:do if(!(R(S&127)|0))d=7;else{if(f=q(f|0,d|0,52)|0,T()|0,f&=15,!f){d=6;break}for(d=1;;){if(S=J(7,0,(15-d|0)*3|0)|0,!((S&c|0)==0&((T()|0)&e|0)==0)){d=7;break c}if(d>>>0>>0)d=d+1|0;else{d=6;break}}}while(0);if((h+2|0)>>>0>d>>>0){M=41;break a}S=J(g|0,0,56)|0,e=T()|0|e&-117440513,x=l,i[x>>2]=0,i[x+4>>2]=0,c=S|c}else p=K(p|0,m|0,1,0)|0,p=Fr(p|0,T()|0,n|0,r|0)|0,m=T()|0;v=K(v|0,_|0,1,0)|0,_=T()|0,l=A+(p<<3)|0,d=l,f=i[d>>2]|0,d=i[d+4>>2]|0}while(!((f|0)==0&(d|0)==0))}S=l,i[S>>2]=c,i[S+4>>2]=e}if(o=K(o|0,s|0,1,0)|0,s=T()|0,!((s|0)<(r|0)|(s|0)==(r|0)&o>>>0>>0))break b;e=j+(o<<3)|0,c=i[e>>2]|0,e=i[e+4>>2]|0}}while(0);if(S=K(n|0,r|0,5,0)|0,x=T()|0,x>>>0<0|(x|0)==0&S>>>0<11){M=85;break}if(S=Mr(n|0,r|0,6,0)|0,T()|0,S=Or(S,8)|0,!S){M=48;break}do if(C){for(g=0,e=0,h=0,_=0;;){if(d=A+(g<<3)|0,s=d,o=i[s>>2]|0,s=i[s+4>>2]|0,(o|0)==0&(s|0)==0)x=h;else{f=q(o|0,s|0,56)|0,T()|0,f&=7,c=f+1|0,p=s&-117440513,x=q(o|0,s|0,45)|0,T()|0;d:do if(R(x&127)|0){if(m=q(o|0,s|0,52)|0,T()|0,m&=15,m|0)for(l=1;;){if(x=J(7,0,(15-l|0)*3|0)|0,!((o&x|0)==0&(p&(T()|0)|0)==0))break d;if(l>>>0>>0)l=l+1|0;else break}s=J(c|0,0,56)|0,o=s|o,s=T()|0|p,c=d,i[c>>2]=o,i[c+4>>2]=s,c=f+2|0}while(0);(c|0)==7?(x=S+(e<<3)|0,i[x>>2]=o,i[x+4>>2]=s&-117440513,e=K(e|0,h|0,1,0)|0,x=T()|0):x=h}if(g=K(g|0,_|0,1,0)|0,_=T()|0,(_|0)<(r|0)|(_|0)==(r|0)&g>>>0>>0)h=x;else break}if(C){if(v=O>>>0>15,y=J(O|0,0,52)|0,b=T()|0,!w){for(o=0,l=0,c=0,s=0;(u|0)==0&(a|0)==0||(O=t+(o<<3)|0,i[O>>2]=u,i[O+4>>2]=a,o=K(o|0,l|0,1,0)|0,l=T()|0),c=K(c|0,s|0,1,0)|0,s=T()|0,(s|0)<(r|0)|(s|0)==(r|0)&c>>>0>>0;)a=j+(c<<3)|0,u=i[a>>2]|0,a=i[a+4>>2]|0;a=x;break}for(o=0,l=0,s=0,c=0;;){do if(!((u|0)==0&(a|0)==0)){if(m=q(u|0,a|0,52)|0,T()|0,m&=15,v|(m|0)<(O|0)){M=80;break a}if((m|0)!=(O|0)){if(d=u|y,f=a&-15728641|b,m>>>0>=D>>>0){p=O;do w=J(7,0,(14-p|0)*3|0)|0,p=p+1|0,d=w|d,f=T()|0|f;while(p>>>0>>0)}}else d=u,f=a;h=Ir(d|0,f|0,n|0,r|0)|0,p=0,m=0,_=T()|0;do{if((p|0)>(r|0)|(p|0)==(r|0)&m>>>0>n>>>0){M=81;break a}if(w=A+(h<<3)|0,g=i[w+4>>2]|0,(g&-117440513|0)==(f|0)&&(i[w>>2]|0)==(d|0)){M=65;break}w=K(h|0,_|0,1,0)|0,h=Fr(w|0,T()|0,n|0,r|0)|0,_=T()|0,m=K(m|0,p|0,1,0)|0,p=T()|0,w=A+(h<<3)|0}while(!((i[w>>2]|0)==(d|0)&&(i[w+4>>2]|0)==(f|0)));if((M|0)==65&&(M=0,!0&(g&117440512|0)==100663296))break;w=t+(o<<3)|0,i[w>>2]=u,i[w+4>>2]=a,o=K(o|0,l|0,1,0)|0,l=T()|0}while(0);if(s=K(s|0,c|0,1,0)|0,c=T()|0,!((c|0)<(r|0)|(c|0)==(r|0)&s>>>0>>0))break;a=j+(s<<3)|0,u=i[a>>2]|0,a=i[a+4>>2]|0}a=x}else o=0,a=x}else o=0,e=0,a=0;while(0);if(Ur(A|0,0,k|0)|0,Hr(j|0,S|0,e<<3|0)|0,Dr(S),(e|0)==0&(a|0)==0){M=89;break}else t=t+(o<<3)|0,r=a,n=e}if((M|0)==16)!0&(a&117440512|0)==0?(a=4,M=27):M=21;else if((M|0)==31)E(27795,27122,620,27132);else if((M|0)==41)return Dr(j),Dr(A),M=10,M|0;else if((M|0)==48)return Dr(j),Dr(A),M=13,M|0;else(M|0)==80?E(27795,27122,711,27132):(M|0)==81?E(27795,27122,723,27132):(M|0)==85&&(Hr(t|0,j|0,n<<3|0)|0,M=89);return(M|0)==21?(Dr(j),Dr(A),M=5,M|0):(M|0)==27?(Dr(j),Dr(A),M=a,M|0):(M|0)==89?(Dr(j),Dr(A),M=0,M|0):0}function Pt(e,t,n,r,a,o,s){e|=0,t|=0,n|=0,r|=0,a|=0,o|=0,s|=0;var c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0;if(g=M,M=M+16|0,h=g,!((n|0)>0|(n|0)==0&t>>>0>0))return h=0,M=g,h|0;if((s|0)>=16)return h=12,M=g,h|0;p=0,m=0,f=0,c=0;a:for(;;){if(u=e+(p<<3)|0,l=i[u>>2]|0,u=i[u+4>>2]|0,d=q(l|0,u|0,52)|0,T()|0,(d&15|0)>(s|0)){c=12,l=11;break}if(tn(h,l,u,s),d=h,u=i[d>>2]|0,d=i[d+4>>2]|0,(u|0)==0&(d|0)==0)l=f;else{l=f;do{if(!((c|0)<(o|0)|(c|0)==(o|0)&l>>>0>>0)){l=10;break a}f=r+(l<<3)|0,i[f>>2]=u,i[f+4>>2]=d,l=K(l|0,c|0,1,0)|0,c=T()|0,rn(h),f=h,u=i[f>>2]|0,d=i[f+4>>2]|0}while(!((u|0)==0&(d|0)==0))}if(p=K(p|0,m|0,1,0)|0,m=T()|0,(m|0)<(n|0)|(m|0)==(n|0)&p>>>0>>0)f=l;else{c=0,l=11;break}}return(l|0)==10?(h=14,M=g,h|0):(l|0)==11?(M=g,c|0):0}function Ft(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0;p=M,M=M+16|0,f=p;a:do if((n|0)>0|(n|0)==0&t>>>0>0){for(u=0,s=0,o=0,d=0;;){if(l=e+(u<<3)|0,c=i[l>>2]|0,l=i[l+4>>2]|0,!((c|0)==0&(l|0)==0)&&(l=(Ot(c,l,r,f)|0)==0,c=f,s=K(i[c>>2]|0,i[c+4>>2]|0,s|0,o|0)|0,o=T()|0,!l)){o=12;break}if(u=K(u|0,d|0,1,0)|0,d=T()|0,!((d|0)<(n|0)|(d|0)==(n|0)&u>>>0>>0))break a}return M=p,o|0}else s=0,o=0;while(0);return i[a>>2]=s,i[a+4>>2]=o,a=0,M=p,a|0}function It(e,t){return e|=0,t|=0,t=q(e|0,t|0,52)|0,T()|0,t&1|0}function Lt(e,t){e|=0,t|=0;var n=0,r=0,i=0;if(i=q(e|0,t|0,52)|0,T()|0,i&=15,!i)return i=0,i|0;for(r=1;;){if(n=q(e|0,t|0,(15-r|0)*3|0)|0,T()|0,n&=7,n|0){r=5;break}if(r>>>0>>0)r=r+1|0;else{n=0,r=5;break}}return(r|0)==5?n|0:0}function Rt(e,t){e|=0,t|=0;var n=0,r=0,i=0,a=0,o=0,s=0,c=0;if(c=q(e|0,t|0,52)|0,T()|0,c&=15,!c)return s=t,c=e,w(s|0),c|0;for(s=1,n=0;;){a=(15-s|0)*3|0,r=J(7,0,a|0)|0,i=T()|0,o=q(e|0,t|0,a|0)|0,T()|0,a=J(G(o&7)|0,0,a|0)|0,o=T()|0,e=a|e&~r,t=o|t&~i;a:do if(!n)if((a&r|0)==0&(o&i|0)==0)n=0;else if(r=q(e|0,t|0,52)|0,T()|0,r&=15,!r)n=1;else{n=1;b:for(;;){switch(o=q(e|0,t|0,(15-n|0)*3|0)|0,T()|0,o&7){case 1:break b;case 0:break;default:n=1;break a}if(n>>>0>>0)n=n+1|0;else{n=1;break a}}for(n=1;;)if(o=(15-n|0)*3|0,i=q(e|0,t|0,o|0)|0,T()|0,a=J(7,0,o|0)|0,t&=~(T()|0),o=J(G(i&7)|0,0,o|0)|0,e=e&~a|o,t=t|T()|0,n>>>0>>0)n=n+1|0;else{n=1;break}}while(0);if(s>>>0>>0)s=s+1|0;else break}return w(t|0),e|0}function zt(e,t){e|=0,t|=0;var n=0,r=0,i=0,a=0,o=0;if(r=q(e|0,t|0,52)|0,T()|0,r&=15,!r)return n=t,r=e,w(n|0),r|0;for(n=1;a=(15-n|0)*3|0,o=q(e|0,t|0,a|0)|0,T()|0,i=J(7,0,a|0)|0,t&=~(T()|0),a=J(G(o&7)|0,0,a|0)|0,e=a|e&~i,t=T()|0|t,n>>>0>>0;)n=n+1|0;return w(t|0),e|0}function Bt(e,t){e|=0,t|=0;var n=0,r=0,i=0,a=0,o=0,s=0,c=0;if(c=q(e|0,t|0,52)|0,T()|0,c&=15,!c)return s=t,c=e,w(s|0),c|0;for(s=1,n=0;;){a=(15-s|0)*3|0,r=J(7,0,a|0)|0,i=T()|0,o=q(e|0,t|0,a|0)|0,T()|0,a=J(qe(o&7)|0,0,a|0)|0,o=T()|0,e=a|e&~r,t=o|t&~i;a:do if(!n)if((a&r|0)==0&(o&i|0)==0)n=0;else if(r=q(e|0,t|0,52)|0,T()|0,r&=15,!r)n=1;else{n=1;b:for(;;){switch(o=q(e|0,t|0,(15-n|0)*3|0)|0,T()|0,o&7){case 1:break b;case 0:break;default:n=1;break a}if(n>>>0>>0)n=n+1|0;else{n=1;break a}}for(n=1;;)if(i=(15-n|0)*3|0,a=J(7,0,i|0)|0,o=t&~(T()|0),t=q(e|0,t|0,i|0)|0,T()|0,t=J(qe(t&7)|0,0,i|0)|0,e=e&~a|t,t=o|T()|0,n>>>0>>0)n=n+1|0;else{n=1;break}}while(0);if(s>>>0>>0)s=s+1|0;else break}return w(t|0),e|0}function Vt(e,t){e|=0,t|=0;var n=0,r=0,i=0,a=0,o=0;if(r=q(e|0,t|0,52)|0,T()|0,r&=15,!r)return n=t,r=e,w(n|0),r|0;for(n=1;o=(15-n|0)*3|0,a=J(7,0,o|0)|0,i=t&~(T()|0),t=q(e|0,t|0,o|0)|0,T()|0,t=J(qe(t&7)|0,0,o|0)|0,e=t|e&~a,t=T()|0|i,n>>>0>>0;)n=n+1|0;return w(t|0),e|0}function Ht(e,t){e|=0,t|=0;var n=0,r=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0;if(l=M,M=M+64|0,c=l+40|0,r=l+24|0,a=l+12|0,o=l,J(t|0,0,52)|0,n=T()|134225919,!t)return(i[e+4>>2]|0)>2||(i[e+8>>2]|0)>2||(i[e+12>>2]|0)>2?(s=0,c=0,w(s|0),M=l,c|0):(J(he(e)|0,0,45)|0,s=T()|0|n,c=-1,w(s|0),M=l,c|0);if(i[c>>2]=i[e>>2],i[c+4>>2]=i[e+4>>2],i[c+8>>2]=i[e+8>>2],i[c+12>>2]=i[e+12>>2],s=c+4|0,(t|0)>0)for(e=-1;i[r>>2]=i[s>>2],i[r+4>>2]=i[s+4>>2],i[r+8>>2]=i[s+8>>2],t&1?(Be(s),i[a>>2]=i[s>>2],i[a+4>>2]=i[s+4>>2],i[a+8>>2]=i[s+8>>2],He(a)):(Ve(s),i[a>>2]=i[s>>2],i[a+4>>2]=i[s+4>>2],i[a+8>>2]=i[s+8>>2],Ue(a)),Ie(r,a,o),Pe(o),d=(15-t|0)*3|0,u=J(7,0,d|0)|0,n&=~(T()|0),d=J(Re(o)|0,0,d|0)|0,e=d|e&~u,n=T()|0|n,(t|0)>1;)t=t+-1|0;else e=-1;a:do if((i[s>>2]|0)<=2&&(i[c+8>>2]|0)<=2&&(i[c+12>>2]|0)<=2){if(r=he(c)|0,t=J(r|0,0,45)|0,t|=e,e=T()|0|n&-1040385,o=ge(c)|0,!(R(r)|0)){if((o|0)<=0)break;for(a=0;;){if(r=q(t|0,e|0,52)|0,T()|0,r&=15,r)for(n=1;d=(15-n|0)*3|0,c=q(t|0,e|0,d|0)|0,T()|0,u=J(7,0,d|0)|0,e&=~(T()|0),d=J(G(c&7)|0,0,d|0)|0,t=t&~u|d,e=e|T()|0,n>>>0>>0;)n=n+1|0;if(a=a+1|0,(a|0)==(o|0))break a}}a=q(t|0,e|0,52)|0,T()|0,a&=15;b:do if(a){n=1;c:for(;;){switch(d=q(t|0,e|0,(15-n|0)*3|0)|0,T()|0,d&7){case 1:break c;case 0:break;default:break b}if(n>>>0>>0)n=n+1|0;else break b}if(B(r,i[c>>2]|0)|0)for(n=1;c=(15-n|0)*3|0,u=J(7,0,c|0)|0,d=e&~(T()|0),e=q(t|0,e|0,c|0)|0,T()|0,e=J(qe(e&7)|0,0,c|0)|0,t=t&~u|e,e=d|T()|0,n>>>0>>0;)n=n+1|0;else for(n=1;d=(15-n|0)*3|0,c=q(t|0,e|0,d|0)|0,T()|0,u=J(7,0,d|0)|0,e&=~(T()|0),d=J(G(c&7)|0,0,d|0)|0,t=t&~u|d,e=e|T()|0,n>>>0>>0;)n=n+1|0}while(0);if((o|0)>0){n=0;do t=Rt(t,e)|0,e=T()|0,n=n+1|0;while((n|0)!=(o|0))}}else t=0,e=0;while(0);return u=e,d=t,w(u|0),M=l,d|0}function Ut(e){return e|=0,(e|0)%2|0}function Wt(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0;return a=M,M=M+16|0,r=a,t>>>0>15?(r=4,M=a,r|0):(i[e+4>>2]&2146435072|0)==2146435072||(i[e+8+4>>2]&2146435072|0)==2146435072?(r=3,M=a,r|0):(lt(e,t,r),t=Ht(r,t)|0,r=T()|0,i[n>>2]=t,i[n+4>>2]=r,(t|0)==0&(r|0)==0&&E(27795,27122,1050,27145),r=0,M=a,r|0)}function Gt(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0,s=0;if(a=n+4|0,o=q(e|0,t|0,52)|0,T()|0,o&=15,s=q(e|0,t|0,45)|0,T()|0,r=(o|0)==0,!(R(s&127)|0)){if(r)return s=0,s|0;r=!(i[a>>2]|0)&&!(i[n+8>>2]|0)?(i[n+12>>2]|0)!=0&1:1}else if(r)return s=1,s|0;else r=1;for(n=1;n&1?He(a):Ue(a),s=q(e|0,t|0,(15-n|0)*3|0)|0,T()|0,We(a,s&7),n>>>0>>0;)n=n+1|0;return r|0}function Kt(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0;if(d=M,M=M+16|0,l=d,u=q(e|0,t|0,45)|0,T()|0,u&=127,u>>>0>121)return i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,i[n+12>>2]=0,u=5,M=d,u|0;a:do if(R(u)|0&&(o=q(e|0,t|0,52)|0,T()|0,o&=15,o|0)){r=1;b:for(;;){switch(c=q(e|0,t|0,(15-r|0)*3|0)|0,T()|0,c&7){case 5:break b;case 0:break;default:r=t;break a}if(r>>>0>>0)r=r+1|0;else{r=t;break a}}for(a=1,r=t;t=(15-a|0)*3|0,s=J(7,0,t|0)|0,c=r&~(T()|0),r=q(e|0,r|0,t|0)|0,T()|0,r=J(qe(r&7)|0,0,t|0)|0,e=e&~s|r,r=c|T()|0,a>>>0>>0;)a=a+1|0}else r=t;while(0);if(c=7696+(u*28|0)|0,i[n>>2]=i[c>>2],i[n+4>>2]=i[c+4>>2],i[n+8>>2]=i[c+8>>2],i[n+12>>2]=i[c+12>>2],!(Gt(e,r,n)|0))return u=0,M=d,u|0;if(s=n+4|0,i[l>>2]=i[s>>2],i[l+4>>2]=i[s+4>>2],i[l+8>>2]=i[s+8>>2],o=q(e|0,r|0,52)|0,T()|0,c=o&15,o&1?(Ue(s),o=c+1|0):o=c,!(R(u)|0))r=0;else{c:do if(!c)r=0;else for(t=1;;){if(a=q(e|0,r|0,(15-t|0)*3|0)|0,T()|0,a&=7,a|0){r=a;break c}if(t>>>0>>0)t=t+1|0;else{r=0;break}}while(0);r=(r|0)==4&1}if(!(gt(n,o,r,0)|0))(o|0)!=(c|0)&&(i[s>>2]=i[l>>2],i[s+4>>2]=i[l+4>>2],i[s+8>>2]=i[l+8>>2]);else{if(R(u)|0)do;while(gt(n,o,0,0)|0);(o|0)!=(c|0)&&Ve(s)}return u=0,M=d,u|0}function qt(e,t,n){e|=0,t|=0,n|=0;var r=0,i=0,a=0;return a=M,M=M+16|0,r=a,i=Kt(e,t,r)|0,i|0?(M=a,i|0):(i=q(e|0,t|0,52)|0,T()|0,pt(r,i&15,n),i=0,M=a,i|0)}function Jt(e,t,n){e|=0,t|=0,n|=0;var r=0,i=0,a=0,o=0,s=0;if(o=M,M=M+16|0,a=o,r=Kt(e,t,a)|0,r|0)return a=r,M=o,a|0;r=q(e|0,t|0,45)|0,T()|0,r=(R(r&127)|0)==0,i=q(e|0,t|0,52)|0,T()|0,i&=15;a:do if(!r){if(i|0)for(r=1;;){if(s=J(7,0,(15-r|0)*3|0)|0,!((s&e|0)==0&((T()|0)&t|0)==0))break a;if(r>>>0>>0)r=r+1|0;else break}return mt(a,i,0,5,n),s=0,M=o,s|0}while(0);return vt(a,i,0,6,n),s=0,M=o,s|0}function Yt(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0;if(a=q(e|0,t|0,45)|0,T()|0,!(R(a&127)|0))return a=2,i[n>>2]=a,0;if(a=q(e|0,t|0,52)|0,T()|0,a&=15,!a)return a=5,i[n>>2]=a,0;for(r=1;;){if(o=J(7,0,(15-r|0)*3|0)|0,!((o&e|0)==0&((T()|0)&t|0)==0)){r=2,e=6;break}if(r>>>0>>0)r=r+1|0;else{r=5,e=6;break}}return(e|0)==6&&(i[n>>2]=r),0}function Xt(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0;f=M,M=M+128|0,u=f+112|0,o=f+96|0,d=f,a=q(e|0,t|0,52)|0,T()|0,c=a&15,i[u>>2]=c,s=q(e|0,t|0,45)|0,T()|0,s&=127;a:do if(R(s)|0){if(c|0)for(r=1;;){if(l=J(7,0,(15-r|0)*3|0)|0,!((l&e|0)==0&((T()|0)&t|0)==0)){a=0;break a}if(r>>>0>>0)r=r+1|0;else break}if(a&1)a=1;else return l=J(c+1|0,0,52)|0,d=T()|0|t&-15728641,u=J(7,0,(14-c|0)*3|0)|0,d=Xt((l|e)&~u,d&~(T()|0),n)|0,M=f,d|0}else a=0;while(0);if(r=Kt(e,t,o)|0,!r){a?(ht(o,u,d),l=5):(yt(o,u,d),l=6);b:do if(R(s)|0)if(!c)e=5;else for(r=1;;){if(s=J(7,0,(15-r|0)*3|0)|0,!((s&e|0)==0&((T()|0)&t|0)==0)){e=2;break b}if(r>>>0>>0)r=r+1|0;else{e=5;break}}else e=2;while(0);Ur(n|0,-1,e<<2|0)|0;c:do if(a)for(o=0;;){if(s=d+(o<<4)|0,_t(s,i[u>>2]|0)|0,s=i[s>>2]|0,c=i[n>>2]|0,(c|0)==-1|(c|0)==(s|0))r=n;else{a=0;do{if(a=a+1|0,a>>>0>=e>>>0){r=1;break c}r=n+(a<<2)|0,c=i[r>>2]|0}while(!((c|0)==-1|(c|0)==(s|0)))}if(i[r>>2]=s,o=o+1|0,o>>>0>=l>>>0){r=0;break}}else for(o=0;;){if(s=d+(o<<4)|0,gt(s,i[u>>2]|0,0,1)|0,s=i[s>>2]|0,c=i[n>>2]|0,(c|0)==-1|(c|0)==(s|0))r=n;else{a=0;do{if(a=a+1|0,a>>>0>=e>>>0){r=1;break c}r=n+(a<<2)|0,c=i[r>>2]|0}while(!((c|0)==-1|(c|0)==(s|0)))}if(i[r>>2]=s,o=o+1|0,o>>>0>=l>>>0){r=0;break}}while(0)}return d=r,M=f,d|0}function Zt(){return 12}function Qt(e,t){e|=0,t|=0;var n=0,r=0,a=0,o=0,s=0,c=0,l=0;if(e>>>0>15)return c=4,c|0;if(J(e|0,0,52)|0,c=T()|134225919,!e){n=0,r=0;do R(r)|0&&(J(r|0,0,45)|0,s=c|T()|0,e=t+(n<<3)|0,i[e>>2]=-1,i[e+4>>2]=s,n=n+1|0),r=r+1|0;while((r|0)!=122);return n=0,n|0}n=0,s=0;do{if(R(s)|0){for(J(s|0,0,45)|0,r=1,a=-1,o=c|T()|0;l=J(7,0,(15-r|0)*3|0)|0,a&=~l,o&=~(T()|0),(r|0)!=(e|0);)r=r+1|0;l=t+(n<<3)|0,i[l>>2]=a,i[l+4>>2]=o,n=n+1|0}s=s+1|0}while((s|0)!=122);return n=0,n|0}function $t(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0;if(y=M,M=M+16|0,_=y,v=q(e|0,t|0,52)|0,T()|0,v&=15,n>>>0>15)return v=4,M=y,v|0;if((v|0)<(n|0))return v=12,M=y,v|0;if((v|0)!=(n|0))if(o=J(n|0,0,52)|0,o|=e,c=T()|0|t&-15728641,(v|0)>(n|0)){l=n;do g=J(7,0,(14-l|0)*3|0)|0,l=l+1|0,o=g|o,c=T()|0|c;while((l|0)<(v|0));g=o}else g=o;else g=e,c=t;h=q(g|0,c|0,45)|0,T()|0;a:do if(R(h&127)|0){if(l=q(g|0,c|0,52)|0,T()|0,l&=15,l|0)for(o=1;;){if(h=J(7,0,(15-o|0)*3|0)|0,!((h&g|0)==0&((T()|0)&c|0)==0)){u=33;break a}if(o>>>0>>0)o=o+1|0;else break}if(h=r,i[h>>2]=0,i[h+4>>2]=0,(v|0)>(n|0)){for(h=t&-15728641,m=v;;){if(p=m,m=m+-1|0,m>>>0>15|(v|0)<(m|0)){u=19;break}if((v|0)!=(m|0))if(o=J(m|0,0,52)|0,o|=e,l=T()|0|h,(v|0)<(p|0))f=o;else{u=m;do f=J(7,0,(14-u|0)*3|0)|0,u=u+1|0,o=f|o,l=T()|0|l;while((u|0)<(v|0));f=o}else f=e,l=t;if(d=q(f|0,l|0,45)|0,T()|0,!(R(d&127)|0))o=0;else{d=q(f|0,l|0,52)|0,T()|0,d&=15;b:do if(!d)o=0;else for(u=1;;){if(o=q(f|0,l|0,(15-u|0)*3|0)|0,T()|0,o&=7,o|0)break b;if(u>>>0>>0)u=u+1|0;else{o=0;break}}while(0);o=(o|0)==0&1}if(l=q(e|0,t|0,(15-p|0)*3|0)|0,T()|0,l&=7,(l|0)==7){a=5,u=42;break}if(o=(o|0)!=0,(l|0)==1&o){a=5,u=42;break}if(f=l+(((l|0)!=0&o)<<31>>31)|0,f|0&&(u=v-p|0,u=Ln(7,0,u,((u|0)<0)<<31>>31)|0,d=T()|0,o?(o=Pr(u|0,d|0,5,0)|0,o=K(o|0,T()|0,-5,-1)|0,o=Mr(o|0,T()|0,6,0)|0,o=K(o|0,T()|0,1,0)|0,l=T()|0):(o=u,l=d),p=f+-1|0,p=Pr(u|0,d|0,p|0,((p|0)<0)<<31>>31|0)|0,p=K(o|0,l|0,p|0,T()|0)|0,f=T()|0,d=r,d=K(p|0,f|0,i[d>>2]|0,i[d+4>>2]|0)|0,f=T()|0,p=r,i[p>>2]=d,i[p+4>>2]=f),(m|0)<=(n|0)){u=37;break}}if((u|0)==19)E(27795,27122,1367,27158);else if((u|0)==37){s=r,a=i[s+4>>2]|0,s=i[s>>2]|0;break}else if((u|0)==42)return M=y,a|0}else a=0,s=0}else u=33;while(0);c:do if((u|0)==33)if(h=r,i[h>>2]=0,i[h+4>>2]=0,(v|0)>(n|0)){for(o=v;;){if(a=q(e|0,t|0,(15-o|0)*3|0)|0,T()|0,a&=7,(a|0)==7){a=5;break}if(s=v-o|0,s=Ln(7,0,s,((s|0)<0)<<31>>31)|0,a=Pr(s|0,T()|0,a|0,0)|0,s=T()|0,h=r,s=K(i[h>>2]|0,i[h+4>>2]|0,a|0,s|0)|0,a=T()|0,h=r,i[h>>2]=s,i[h+4>>2]=a,o=o+-1|0,(o|0)<=(n|0))break c}return M=y,a|0}else a=0,s=0;while(0);return Ot(g,c,v,_)|0&&E(27795,27122,1327,27173),v=_,_=i[v+4>>2]|0,((a|0)>-1|(a|0)==-1&s>>>0>4294967295)&((_|0)>(a|0)|((_|0)==(a|0)?(i[v>>2]|0)>>>0>s>>>0:0))?(v=0,M=y,v|0):(E(27795,27122,1407,27158),0)}function en(e,t,n,r,a,o){e|=0,t|=0,n|=0,r|=0,a|=0,o|=0;var s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0;if(f=M,M=M+16|0,s=f,a>>>0>15)return o=4,M=f,o|0;if(c=q(n|0,r|0,52)|0,T()|0,c&=15,(c|0)>(a|0))return o=12,M=f,o|0;if(Ot(n,r,a,s)|0&&E(27795,27122,1327,27173),d=s,u=i[d+4>>2]|0,!(((t|0)>-1|(t|0)==-1&e>>>0>4294967295)&((u|0)>(t|0)|((u|0)==(t|0)?(i[d>>2]|0)>>>0>e>>>0:0))))return o=2,M=f,o|0;d=a-c|0,a=J(a|0,0,52)|0,l=T()|0|r&-15728641,u=o,i[u>>2]=a|n,i[u+4>>2]=l,u=q(n|0,r|0,45)|0,T()|0;a:do if(R(u&127)|0){if(c|0)for(s=1;;){if(u=J(7,0,(15-s|0)*3|0)|0,!((u&n|0)==0&((T()|0)&r|0)==0))break a;if(s>>>0>>0)s=s+1|0;else break}if((d|0)<1)return o=0,M=f,o|0;for(u=c^15,r=-1,l=1,s=1;;){c=d-l|0,c=Ln(7,0,c,((c|0)<0)<<31>>31)|0,n=T()|0;do if(s)if(s=Pr(c|0,n|0,5,0)|0,s=K(s|0,T()|0,-5,-1)|0,s=Mr(s|0,T()|0,6,0)|0,a=T()|0,(t|0)>(a|0)|(t|0)==(a|0)&e>>>0>s>>>0){t=K(e|0,t|0,-1,-1)|0,t=kr(t|0,T()|0,s|0,a|0)|0,s=T()|0,p=o,h=i[p>>2]|0,p=i[p+4>>2]|0,g=(u+r|0)*3|0,m=J(7,0,g|0)|0,p&=~(T()|0),r=Mr(t|0,s|0,c|0,n|0)|0,e=T()|0,a=K(r|0,e|0,2,0)|0,g=J(a|0,T()|0,g|0)|0,p=T()|0|p,a=o,i[a>>2]=g|h&~m,i[a+4>>2]=p,e=Pr(r|0,e|0,c|0,n|0)|0,e=kr(t|0,s|0,e|0,T()|0)|0,s=0,t=T()|0;break}else{g=o,m=i[g>>2]|0,g=i[g+4>>2]|0,h=J(7,0,(u+r|0)*3|0)|0,g&=~(T()|0),s=o,i[s>>2]=m&~h,i[s+4>>2]=g,s=1;break}else m=o,a=i[m>>2]|0,m=i[m+4>>2]|0,r=(u+r|0)*3|0,p=J(7,0,r|0)|0,m&=~(T()|0),g=Mr(e|0,t|0,c|0,n|0)|0,s=T()|0,r=J(g|0,s|0,r|0)|0,m=T()|0|m,h=o,i[h>>2]=r|a&~p,i[h+4>>2]=m,s=Pr(g|0,s|0,c|0,n|0)|0,e=kr(e|0,t|0,s|0,T()|0)|0,s=0,t=T()|0;while(0);if((d|0)>(l|0))r=~l,l=l+1|0;else{t=0;break}}return M=f,t|0}while(0);if((d|0)<1)return g=0,M=f,g|0;for(a=c^15,s=1;;)if(h=d-s|0,h=Ln(7,0,h,((h|0)<0)<<31>>31)|0,g=T()|0,l=o,n=i[l>>2]|0,l=i[l+4>>2]|0,c=(a-s|0)*3|0,r=J(7,0,c|0)|0,l&=~(T()|0),p=Mr(e|0,t|0,h|0,g|0)|0,m=T()|0,c=J(p|0,m|0,c|0)|0,l=T()|0|l,u=o,i[u>>2]=c|n&~r,i[u+4>>2]=l,g=Pr(p|0,m|0,h|0,g|0)|0,e=kr(e|0,t|0,g|0,T()|0)|0,t=T()|0,(d|0)<=(s|0)){t=0;break}else s=s+1|0;return M=f,t|0}function tn(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0;a=q(t|0,n|0,52)|0,T()|0,a&=15,(t|0)==0&(n|0)==0|((r|0)>15|(a|0)>(r|0))?(o=-1,t=-1,n=0,a=0):(t=jt(t,n,a+1|0,r)|0,s=(T()|0)&-15728641,n=J(r|0,0,52)|0,n=t|n,s=s|T()|0,t=(kt(n,s)|0)==0,o=a,t=t?-1:r,a=s),s=e,i[s>>2]=n,i[s+4>>2]=a,i[e+8>>2]=o,i[e+12>>2]=t}function nn(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0;if(a=q(e|0,t|0,52)|0,T()|0,a&=15,o=r+8|0,i[o>>2]=a,(e|0)==0&(t|0)==0|((n|0)>15|(a|0)>(n|0))){n=r,i[n>>2]=0,i[n+4>>2]=0,i[o>>2]=-1,i[r+12>>2]=-1;return}if(e=jt(e,t,a+1|0,n)|0,o=(T()|0)&-15728641,a=J(n|0,0,52)|0,a=e|a,o=o|T()|0,e=r,i[e>>2]=a,i[e+4>>2]=o,e=r+12|0,kt(a,o)|0){i[e>>2]=n;return}else{i[e>>2]=-1;return}}function rn(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0,l=0,u=0;if(n=e,t=i[n>>2]|0,n=i[n+4>>2]|0,!((t|0)==0&(n|0)==0)&&(r=q(t|0,n|0,52)|0,T()|0,r&=15,c=J(1,0,(r^15)*3|0)|0,t=K(c|0,T()|0,t|0,n|0)|0,n=T()|0,c=e,i[c>>2]=t,i[c+4>>2]=n,c=e+8|0,s=i[c>>2]|0,!((r|0)<(s|0)))){for(l=e+12|0,o=r;;){if((o|0)==(s|0)){r=5;break}if(u=(o|0)==(i[l>>2]|0),a=(15-o|0)*3|0,r=q(t|0,n|0,a|0)|0,T()|0,r&=7,u&(r|0)==1&!0){r=7;break}if(!((r|0)==7&!0)){r=10;break}if(u=J(1,0,a|0)|0,t=K(t|0,n|0,u|0,T()|0)|0,n=T()|0,u=e,i[u>>2]=t,i[u+4>>2]=n,(o|0)>(s|0))o=o+-1|0;else{r=10;break}}if((r|0)==5){u=e,i[u>>2]=0,i[u+4>>2]=0,i[c>>2]=-1,i[l>>2]=-1;return}else if((r|0)==7){s=J(1,0,a|0)|0,s=K(t|0,n|0,s|0,T()|0)|0,c=T()|0,u=e,i[u>>2]=s,i[u+4>>2]=c,i[l>>2]=o+-1;return}else if((r|0)==10)return}}function an(e){e=+e;var t=0;return t=e<0?e+6.283185307179586:e,+(e>=6.283185307179586?t+-6.283185307179586:t)}function on(e,t){return e|=0,t|=0,+l(+(a[e>>3]-+a[t>>3]))<17453292519943298e-27?(t=+l(+(a[e+8>>3]-+a[t+8>>3]))<17453292519943298e-27,t|0):(t=0,t|0)}function sn(e,t){switch(e=+e,t|=0,t|0){case 1:e=e<0?e+6.283185307179586:e;break;case 2:e=e>0?e+-6.283185307179586:e;break;default:}return+e}function cn(e,t){e|=0,t|=0;var n=0,r=0,i=0,o=0;return i=+a[t>>3],r=+a[e>>3],o=+p(+((i-r)*.5)),n=+p(+((a[t+8>>3]-+a[e+8>>3])*.5)),n=o*o+n*(f(+i)*+f(+r)*n),+(v(+ +u(+n),+ +u(+(1-n)))*2)}function ln(e,t){e|=0,t|=0;var n=0,r=0,i=0,o=0;return i=+a[t>>3],r=+a[e>>3],o=+p(+((i-r)*.5)),n=+p(+((a[t+8>>3]-+a[e+8>>3])*.5)),n=o*o+n*(f(+i)*+f(+r)*n),+(v(+ +u(+n),+ +u(+(1-n)))*2*6371.007180918475)}function un(e,t){e|=0,t|=0;var n=0,r=0,i=0,o=0;return i=+a[t>>3],r=+a[e>>3],o=+p(+((i-r)*.5)),n=+p(+((a[t+8>>3]-+a[e+8>>3])*.5)),n=o*o+n*(f(+i)*+f(+r)*n),+(v(+ +u(+n),+ +u(+(1-n)))*2*6371.007180918475*1e3)}function dn(e,t){e|=0,t|=0;var n=0,r=0,i=0,o=0,s=0;return o=+a[t>>3],r=+f(+o),i=a[t+8>>3]-+a[e+8>>3],s=r*+p(+i),n=+a[e>>3],+ +v(+s,+(p(+o)*+f(+n)-f(+i)*(r*+p(+n))))}function fn(e,t,n,r){e|=0,t=+t,n=+n,r|=0;var o=0,s=0,c=0,u=0;if(n<1e-16){i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2];return}s=t<0?t+6.283185307179586:t,s=t>=6.283185307179586?s+-6.283185307179586:s;do if(s<1e-16)t=+a[e>>3]+n,a[r>>3]=t,o=r;else{if(o=+l(+(s+-3.141592653589793))<1e-16,t=+a[e>>3],o){t-=n,a[r>>3]=t,o=r;break}if(c=+f(+n),n=+p(+n),t=c*+p(+t)+f(+s)*(n*+f(+t)),t=t>1?1:t,t=+g(+(t<-1?-1:t)),a[r>>3]=t,+l(+(t+-1.5707963267948966))<1e-16){a[r>>3]=1.5707963267948966,a[r+8>>3]=0;return}if(+l(+(t+1.5707963267948966))<1e-16){a[r>>3]=-1.5707963267948966,a[r+8>>3]=0;return}if(u=1/f(+t),s=n*+p(+s)*u,n=+a[e>>3],t=u*((c-p(+t)*+p(+n))/f(+n)),c=s>1?1:s,t=t>1?1:t,t=+a[e+8>>3]+ +v(+(c<-1?-1:c),+(t<-1?-1:t)),t>3.141592653589793)do t+=-6.283185307179586;while(t>3.141592653589793);if(t<-3.141592653589793)do t+=6.283185307179586;while(t<-3.141592653589793);a[r+8>>3]=t;return}while(0);if(+l(+(t+-1.5707963267948966))<1e-16){a[o>>3]=1.5707963267948966,a[r+8>>3]=0;return}if(+l(+(t+1.5707963267948966))<1e-16){a[o>>3]=-1.5707963267948966,a[r+8>>3]=0;return}if(t=+a[e+8>>3],t>3.141592653589793)do t+=-6.283185307179586;while(t>3.141592653589793);if(t<-3.141592653589793)do t+=6.283185307179586;while(t<-3.141592653589793);a[r+8>>3]=t}function pn(e,t){return e|=0,t|=0,e>>>0>15?(t=4,t|0):(a[t>>3]=+a[20656+(e<<3)>>3],t=0,t|0)}function mn(e,t){return e|=0,t|=0,e>>>0>15?(t=4,t|0):(a[t>>3]=+a[20784+(e<<3)>>3],t=0,t|0)}function hn(e,t){return e|=0,t|=0,e>>>0>15?(t=4,t|0):(a[t>>3]=+a[20912+(e<<3)>>3],t=0,t|0)}function gn(e,t){return e|=0,t|=0,e>>>0>15?(t=4,t|0):(a[t>>3]=+a[21040+(e<<3)>>3],t=0,t|0)}function _n(e,t){e|=0,t|=0;var n=0;return e>>>0>15?(t=4,t|0):(n=Ln(7,0,e,((e|0)<0)<<31>>31)|0,n=Pr(n|0,T()|0,120,0)|0,e=T()|0,i[t>>2]=n|2,i[t+4>>2]=e,t=0,t|0)}function vn(e,t,n){e|=0,t|=0,n|=0;var r=0,i=0,o=0,s=0,c=0,l=0,d=0,h=0,g=0,y=0;return y=+a[t>>3],h=+a[e>>3],l=+p(+((y-h)*.5)),o=+a[t+8>>3],d=+a[e+8>>3],s=+p(+((o-d)*.5)),c=+f(+h),g=+f(+y),s=l*l+s*(g*c*s),s=v(+ +u(+s),+ +u(+(1-s)))*2,l=+a[n>>3],y=+p(+((l-y)*.5)),r=+a[n+8>>3],o=+p(+((r-o)*.5)),i=+f(+l),o=y*y+o*(g*i*o),o=v(+ +u(+o),+ +u(+(1-o)))*2,l=+p(+((h-l)*.5)),r=+p(+((d-r)*.5)),r=l*l+r*(c*i*r),r=v(+ +u(+r),+ +u(+(1-r)))*2,i=(s+o+r)*.5,+(_(+ +u(+(m(+(i*.5))*+m(+((i-s)*.5))*m(+((i-o)*.5))*m(+((i-r)*.5)))))*4)}function yn(e,t,n){e|=0,t|=0,n|=0;var r=0,o=0,s=0,c=0,l=0;if(l=M,M=M+192|0,s=l+168|0,c=l,o=qt(e,t,s)|0,o|0)return n=o,M=l,n|0;if(Jt(e,t,c)|0&&E(27795,27190,415,27199),t=i[c>>2]|0,(t|0)>0){if(r=+vn(c+8|0,c+8+(((t|0)!=1&1)<<4)|0,s)+0,(t|0)!=1){e=1;do o=e,e=e+1|0,r+=+vn(c+8+(o<<4)|0,c+8+(((e|0)%(t|0)|0)<<4)|0,s);while((e|0)<(t|0))}}else r=0;return a[n>>3]=r,n=0,M=l,n|0}function bn(e,t,n){return e|=0,t|=0,n|=0,e=yn(e,t,n)|0,e|0||(a[n>>3]=a[n>>3]*6371.007180918475*6371.007180918475),e|0}function xn(e,t,n){return e|=0,t|=0,n|=0,e=yn(e,t,n)|0,e|0||(a[n>>3]=a[n>>3]*6371.007180918475*6371.007180918475*1e3*1e3),e|0}function Sn(e,t,n){e|=0,t|=0,n|=0;var r=0,o=0,s=0,c=0,l=0,d=0,m=0,h=0;if(l=M,M=M+176|0,c=l,e=ct(e,t,c)|0,e|0)return c=e,M=l,c|0;if(a[n>>3]=0,e=i[c>>2]|0,(e|0)<=1)return c=0,M=l,c|0;t=e+-1|0,e=0,r=+a[c+8>>3],o=+a[c+16>>3],s=0;do e=e+1|0,m=r,r=+a[c+8+(e<<4)>>3],h=+p(+((r-m)*.5)),d=o,o=+a[c+8+(e<<4)+8>>3],d=+p(+((o-d)*.5)),d=h*h+d*(f(+r)*+f(+m)*d),s+=v(+ +u(+d),+ +u(+(1-d)))*2;while((e|0)<(t|0));return a[n>>3]=s,c=0,M=l,c|0}function Cn(e,t,n){e|=0,t|=0,n|=0;var r=0,o=0,s=0,c=0,l=0,d=0,m=0,h=0;if(l=M,M=M+176|0,c=l,e=ct(e,t,c)|0,e|0)return c=e,s=+a[n>>3],s*=6371.007180918475,a[n>>3]=s,M=l,c|0;if(a[n>>3]=0,e=i[c>>2]|0,(e|0)<=1)return c=0,s=0,s*=6371.007180918475,a[n>>3]=s,M=l,c|0;t=e+-1|0,e=0,r=+a[c+8>>3],o=+a[c+16>>3],s=0;do e=e+1|0,m=r,r=+a[c+8+(e<<4)>>3],h=+p(+((r-m)*.5)),d=o,o=+a[c+8+(e<<4)+8>>3],d=+p(+((o-d)*.5)),d=h*h+d*(f(+m)*+f(+r)*d),s+=v(+ +u(+d),+ +u(+(1-d)))*2;while((e|0)!=(t|0));return a[n>>3]=s,c=0,h=s,h*=6371.007180918475,a[n>>3]=h,M=l,c|0}function wn(e,t,n){e|=0,t|=0,n|=0;var r=0,o=0,s=0,c=0,l=0,d=0,m=0,h=0;if(l=M,M=M+176|0,c=l,e=ct(e,t,c)|0,e|0)return c=e,s=+a[n>>3],s*=6371.007180918475,s*=1e3,a[n>>3]=s,M=l,c|0;if(a[n>>3]=0,e=i[c>>2]|0,(e|0)<=1)return c=0,s=0,s*=6371.007180918475,s*=1e3,a[n>>3]=s,M=l,c|0;t=e+-1|0,e=0,r=+a[c+8>>3],o=+a[c+16>>3],s=0;do e=e+1|0,m=r,r=+a[c+8+(e<<4)>>3],h=+p(+((r-m)*.5)),d=o,o=+a[c+8+(e<<4)+8>>3],d=+p(+((o-d)*.5)),d=h*h+d*(f(+m)*+f(+r)*d),s+=v(+ +u(+d),+ +u(+(1-d)))*2;while((e|0)!=(t|0));return a[n>>3]=s,c=0,h=s,h*=6371.007180918475,h*=1e3,a[n>>3]=h,M=l,c|0}function Tn(e){e|=0;var t=0,n=0,r=0;return t=Or(1,12)|0,t||E(27280,27235,49,27293),n=e+4|0,r=i[n>>2]|0,r|0?(r=r+8|0,i[r>>2]=t,i[n>>2]=t,t|0):(i[e>>2]|0&&E(27310,27235,61,27333),r=e,i[r>>2]=t,i[n>>2]=t,t|0)}function En(e,t){e|=0,t|=0;var n=0,r=0;return r=Er(24)|0,r||E(27347,27235,78,27361),i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],i[r+12>>2]=i[t+12>>2],i[r+16>>2]=0,t=e+4|0,n=i[t>>2]|0,n|0?(i[n+16>>2]=r,i[t>>2]=r,r|0):(i[e>>2]|0&&E(27376,27235,82,27361),i[e>>2]=r,i[t>>2]=r,r|0)}function Dn(e){e|=0;var t=0,n=0,r=0,a=0;if(e)for(r=1;;){if(t=i[e>>2]|0,t|0)do{if(n=i[t>>2]|0,n|0)do a=n,n=i[n+16>>2]|0,Dr(a);while(n|0);a=t,t=i[t+8>>2]|0,Dr(a)}while(t|0);if(t=e,e=i[e+8>>2]|0,r||Dr(t),e)r=0;else break}}function On(e){e|=0;var t=0,n=0,r=0,o=0,s=0,c=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,ee=0,F=0;if(o=e+8|0,i[o>>2]|0)return F=1,F|0;if(r=i[e>>2]|0,!r)return F=0,F|0;t=r,n=0;do n=n+1|0,t=i[t+8>>2]|0;while(t|0);if(n>>>0<2)return F=0,F|0;P=Er(n<<2)|0,P||E(27396,27235,317,27415),N=Er(n<<5)|0,N||E(27437,27235,321,27415),i[e>>2]=0,T=e+4|0,i[T>>2]=0,i[o>>2]=0,n=0,M=0,w=0,m=0;a:for(;;){if(p=i[r>>2]|0,p){s=0,c=p;do{if(d=+a[c+8>>3],t=c,c=i[c+16>>2]|0,f=(c|0)==0,o=f?p:c,u=+a[o+8>>3],+l(+(d-u))>3.141592653589793){F=14;break}s+=(u-d)*(+a[t>>3]+ +a[o>>3])}while(!f);if((F|0)==14){F=0,s=0,t=p;do C=+a[t+8>>3],j=t+16|0,A=i[j>>2]|0,A=A|0?A:p,S=+a[A+8>>3],s+=(+a[t>>3]+ +a[A>>3])*((S<0?S+6.283185307179586:S)-(C<0?C+6.283185307179586:C)),t=i[(t|0?j:r)>>2]|0;while(t|0)}s>0?(i[P+(M<<2)>>2]=r,M=M+1|0,o=w,t=m):F=19}else F=19;if((F|0)==19){F=0;do if(n){if(t=n+8|0,i[t>>2]|0){F=21;break a}if(n=Or(1,12)|0,!n){F=23;break a}i[t>>2]=n,o=n+4|0,c=n,t=m}else if(m){o=T,c=m+8|0,t=r,n=e;break}else if(i[e>>2]|0){F=27;break a}else{o=T,c=e,t=r,n=e;break}while(0);if(i[c>>2]=r,i[o>>2]=r,c=N+(w<<5)|0,f=i[r>>2]|0,f){for(p=N+(w<<5)+8|0,a[p>>3]=17976931348623157e292,m=N+(w<<5)+24|0,a[m>>3]=17976931348623157e292,a[c>>3]=-17976931348623157e292,h=N+(w<<5)+16|0,a[h>>3]=-17976931348623157e292,b=17976931348623157e292,x=-17976931348623157e292,o=0,g=f,d=17976931348623157e292,v=17976931348623157e292,y=-17976931348623157e292,u=-17976931348623157e292;s=+a[g>>3],C=+a[g+8>>3],g=i[g+16>>2]|0,_=(g|0)==0,S=+a[(_?f:g)+8>>3],s>3]=s,d=s),C>3]=C,v=C),s>y?a[c>>3]=s:s=y,C>u&&(a[h>>3]=C,u=C),b=C>0&Cx?C:x,o|=+l(+(C-S))>3.141592653589793,!_;)y=s;o&&(a[h>>3]=x,a[m>>3]=b)}else i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,i[c+12>>2]=0,i[c+16>>2]=0,i[c+20>>2]=0,i[c+24>>2]=0,i[c+28>>2]=0;o=w+1|0}if(j=r+8|0,r=i[j>>2]|0,i[j>>2]=0,r)w=o,m=t;else{F=45;break}}if((F|0)==21)E(27213,27235,35,27247);else if((F|0)==23)E(27267,27235,37,27247);else if((F|0)==27)E(27310,27235,61,27333);else if((F|0)==45){b:do if((M|0)>0){for(j=(o|0)==0,k=o<<2,A=(e|0)==0,O=0,t=0;;){if(D=i[P+(O<<2)>>2]|0,j)F=73;else{if(w=Er(k)|0,!w){F=50;break}if(T=Er(k)|0,!T){F=52;break}c:do if(A)n=0;else{for(o=0,n=0,c=e;r=N+(o<<5)|0,kn(i[c>>2]|0,r,i[D>>2]|0)|0?(i[w+(n<<2)>>2]=c,i[T+(n<<2)>>2]=r,_=n+1|0):_=n,c=i[c+8>>2]|0,c;)o=o+1|0,n=_;if((_|0)>0)if(r=i[w>>2]|0,(_|0)==1)n=r;else for(h=0,g=-1,n=r,m=r;;){for(f=i[m>>2]|0,r=0,c=0;o=i[i[w+(c<<2)>>2]>>2]|0,p=(o|0)==(f|0)?r:r+((kn(o,i[T+(c<<2)>>2]|0,i[f>>2]|0)|0)&1)|0,c=c+1|0,(c|0)!=(_|0);)r=p;if(o=(p|0)>(g|0),n=o?m:n,r=h+1|0,(r|0)==(_|0))break c;h=r,g=o?p:g,m=i[w+(r<<2)>>2]|0}else n=0}while(0);if(Dr(w),Dr(T),n){if(o=n+4|0,r=i[o>>2]|0,r)n=r+8|0;else if(i[n>>2]|0){F=70;break}i[n>>2]=D,i[o>>2]=D}else F=73}if((F|0)==73){if(F=0,t=i[D>>2]|0,t|0)do T=t,t=i[t+16>>2]|0,Dr(T);while(t|0);Dr(D),t=1}if(O=O+1|0,(O|0)>=(M|0)){ee=t;break b}}(F|0)==50?E(27452,27235,249,27471):(F|0)==52?E(27490,27235,252,27471):(F|0)==70&&E(27310,27235,61,27333)}else ee=0;while(0);return Dr(P),Dr(N),F=ee,F|0}return 0}function kn(e,t,n){e|=0,t|=0,n|=0;var r=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0;if(!(we(t,n)|0)||(t=Se(t)|0,r=+a[n>>3],o=+a[n+8>>3],o=t&o<0?o+6.283185307179586:o,e=i[e>>2]|0,!e))return e=0,e|0;if(t){t=0,d=o,n=e;a:for(;;){for(;c=+a[n>>3],o=+a[n+8>>3],n=n+16|0,f=i[n>>2]|0,f=f|0?f:e,s=+a[f>>3],l=+a[f+8>>3],c>s?(u=c,c=l):(u=s,s=c,c=o,o=l),r=r==s|r==u?r+2220446049250313e-31:r,ru;)if(n=i[n>>2]|0,!n){n=22;break a}if(l=c<0?c+6.283185307179586:c,c=o<0?o+6.283185307179586:o,d=l==d|c==d?d+-2220446049250313e-31:d,u=l+(c-l)*((r-s)/(u-s)),(u<0?u+6.283185307179586:u)>d&&(t^=1),n=i[n>>2]|0,!n){n=22;break}}if((n|0)==22)return t|0}else{t=0,d=o,n=e;b:for(;;){for(;c=+a[n>>3],o=+a[n+8>>3],n=n+16|0,f=i[n>>2]|0,f=f|0?f:e,s=+a[f>>3],l=+a[f+8>>3],c>s?(u=c,c=l):(u=s,s=c,c=o,o=l),r=r==s|r==u?r+2220446049250313e-31:r,ru;)if(n=i[n>>2]|0,!n){n=22;break b}if(d=c==d|o==d?d+-2220446049250313e-31:d,c+(o-c)*((r-s)/(u-s))>d&&(t^=1),n=i[n>>2]|0,!n){n=22;break}}if((n|0)==22)return t|0}return 0}function An(e,t,n,a,o){e|=0,t|=0,n|=0,a|=0,o|=0;var s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0;if(b=M,M=M+32|0,y=b+16|0,v=b,s=q(e|0,t|0,52)|0,T()|0,s&=15,h=q(n|0,a|0,52)|0,T()|0,(s|0)!=(h&15|0))return y=12,M=b,y|0;if(d=q(e|0,t|0,45)|0,T()|0,d&=127,f=q(n|0,a|0,45)|0,T()|0,f&=127,d>>>0>121|f>>>0>121)return y=5,M=b,y|0;if(h=(d|0)!=(f|0),h){if(l=V(d,f)|0,(l|0)==7)return y=1,M=b,y|0;u=V(f,d)|0,(u|0)==7?E(27514,27538,161,27548):(g=l,c=u)}else g=0,c=0;p=R(d)|0,m=R(f)|0,i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0;do if(g){if(f=i[4272+(d*28|0)+(g<<2)>>2]|0,l=(f|0)>0,!m)if(l){d=0,u=n,l=a;do u=Vt(u,l)|0,l=T()|0,c=qe(c)|0,d=d+1|0;while((d|0)!=(f|0));f=c,d=u,u=l}else f=c,d=n,u=a;else if(l){d=0,u=n,l=a;do u=Bt(u,l)|0,l=T()|0,c=qe(c)|0,(c|0)==1&&(c=qe(1)|0),d=d+1|0;while((d|0)!=(f|0));f=c,d=u,u=l}else f=c,d=n,u=a;if(Gt(d,u,y)|0,h||E(27563,27538,191,27548),l=(p|0)!=0,c=(m|0)!=0,l&c&&E(27590,27538,192,27548),l){if(c=Lt(e,t)|0,(c|0)==7){s=5;break}if(r[22e3+(c*7|0)+g>>0]|0){s=1;break}u=i[21168+(c*28|0)+(g<<2)>>2]|0,d=u}else if(c){if(c=Lt(d,u)|0,(c|0)==7){s=5;break}if(r[22e3+(c*7|0)+f>>0]|0){s=1;break}d=0,u=i[21168+(f*28|0)+(c<<2)>>2]|0}else d=0,u=0;if((d|u|0)<0)s=5;else{if((u|0)>0){l=y+4|0,c=0;do Ke(l),c=c+1|0;while((c|0)!=(u|0))}if(i[v>>2]=0,i[v+4>>2]=0,i[v+8>>2]=0,We(v,g),s|0)for(;Ut(s)|0?He(v):Ue(v),(s|0)>1;)s=s+-1|0;if((d|0)>0){s=0;do Ke(v),s=s+1|0;while((s|0)!=(d|0))}_=y+4|0,U(_,v,_),Pe(_),_=51}}else if(Gt(n,a,y)|0,(p|0)!=0&(m|0)!=0)if((f|0)!=(d|0)&&E(27621,27538,261,27548),c=Lt(e,t)|0,s=Lt(n,a)|0,(c|0)==7|(s|0)==7)s=5;else if(r[22e3+(c*7|0)+s>>0]|0)s=1;else if(c=i[21168+(c*28|0)+(s<<2)>>2]|0,(c|0)>0){l=y+4|0,s=0;do Ke(l),s=s+1|0;while((s|0)!=(c|0));_=51}else _=51;else _=51;while(0);return(_|0)==51&&(s=y+4|0,i[o>>2]=i[s>>2],i[o+4>>2]=i[s+4>>2],i[o+8>>2]=i[s+8>>2],s=0),y=s,M=b,y|0}function jn(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0;if(g=M,M=M+48|0,u=g+36|0,s=g+24|0,c=g+12|0,l=g,a=q(e|0,t|0,52)|0,T()|0,a&=15,p=q(e|0,t|0,45)|0,T()|0,p&=127,p>>>0>121)return r=5,M=g,r|0;if(d=R(p)|0,J(a|0,0,52)|0,_=T()|134225919,o=r,i[o>>2]=-1,i[o+4>>2]=_,!a)return a=Re(n)|0,(a|0)==7||(a=ye(p,a)|0,(a|0)==127)?(_=1,M=g,_|0):(m=J(a|0,0,45)|0,h=T()|0,p=r,h=i[p+4>>2]&-1040385|h,_=r,i[_>>2]=i[p>>2]|m,i[_+4>>2]=h,_=0,M=g,_|0);for(i[u>>2]=i[n>>2],i[u+4>>2]=i[n+4>>2],i[u+8>>2]=i[n+8>>2],n=a;;){if(o=n,n=n+-1|0,i[s>>2]=i[u>>2],i[s+4>>2]=i[u+4>>2],i[s+8>>2]=i[u+8>>2],Ut(o)|0){if(a=W(u)|0,a|0){n=13;break}i[c>>2]=i[u>>2],i[c+4>>2]=i[u+4>>2],i[c+8>>2]=i[u+8>>2],He(c)}else{if(a=ze(u)|0,a|0){n=13;break}i[c>>2]=i[u>>2],i[c+4>>2]=i[u+4>>2],i[c+8>>2]=i[u+8>>2],Ue(c)}if(Ie(s,c,l),Pe(l),a=r,y=i[a>>2]|0,a=i[a+4>>2]|0,b=(15-o|0)*3|0,v=J(7,0,b|0)|0,a&=~(T()|0),b=J(Re(l)|0,0,b|0)|0,a=T()|0|a,_=r,i[_>>2]=b|y&~v,i[_+4>>2]=a,(o|0)<=1){n=14;break}}a:do if((n|0)!=13&&(n|0)==14)if((i[u>>2]|0)<=1&&(i[u+4>>2]|0)<=1&&(i[u+8>>2]|0)<=1){n=Re(u)|0,a=ye(p,n)|0,l=(a|0)==127?0:R(a)|0;b:do if(n){if(d){if(a=Lt(e,t)|0,(a|0)==7){a=5;break a}if(o=i[21376+(a*28|0)+(n<<2)>>2]|0,(o|0)>0){a=n,n=0;do a=G(a)|0,n=n+1|0;while((n|0)!=(o|0))}else a=n;if((a|0)==1){a=9;break a}n=ye(p,a)|0,(n|0)==127&&E(27648,27538,411,27678),R(n)|0?E(27693,27538,412,27678):(h=n,m=o,f=a)}else h=a,m=0,f=n;if(c=i[4272+(p*28|0)+(f<<2)>>2]|0,(c|0)<=-1&&E(27724,27538,419,27678),!l){if((m|0)<0){a=5;break a}if(m|0){o=r,a=0,n=i[o>>2]|0,o=i[o+4>>2]|0;do n=zt(n,o)|0,o=T()|0,b=r,i[b>>2]=n,i[b+4>>2]=o,a=a+1|0;while((a|0)<(m|0))}if((c|0)<=0){a=h,n=58;break}for(o=r,a=0,n=i[o>>2]|0,o=i[o+4>>2]|0;;)if(n=zt(n,o)|0,o=T()|0,b=r,i[b>>2]=n,i[b+4>>2]=o,a=a+1|0,(a|0)==(c|0)){a=h,n=58;break b}}if(s=V(h,p)|0,(s|0)==7&&E(27514,27538,428,27678),a=r,n=i[a>>2]|0,a=i[a+4>>2]|0,(c|0)>0){o=0;do n=zt(n,a)|0,a=T()|0,b=r,i[b>>2]=n,i[b+4>>2]=a,o=o+1|0;while((o|0)!=(c|0))}if(a=Lt(n,a)|0,(a|0)==7&&E(27795,27538,440,27678),n=z(h)|0,n=i[(n?21792:21584)+(s*28|0)+(a<<2)>>2]|0,(n|0)<0&&E(27795,27538,454,27678),!n)a=h,n=58;else{s=r,a=0,o=i[s>>2]|0,s=i[s+4>>2]|0;do o=Rt(o,s)|0,s=T()|0,b=r,i[b>>2]=o,i[b+4>>2]=s,a=a+1|0;while((a|0)<(n|0));a=h,n=58}}else if((d|0)!=0&(l|0)!=0){if(n=Lt(e,t)|0,o=r,o=Lt(i[o>>2]|0,i[o+4>>2]|0)|0,(n|0)==7|(o|0)==7){a=5;break a}if(o=i[21376+(n*28|0)+(o<<2)>>2]|0,(o|0)<0){a=5;break a}if(!o)n=59;else{c=r,n=0,s=i[c>>2]|0,c=i[c+4>>2]|0;do s=zt(s,c)|0,c=T()|0,b=r,i[b>>2]=s,i[b+4>>2]=c,n=n+1|0;while((n|0)<(o|0));n=58}}else n=58;while(0);if((n|0)==58&&l&&(n=59),(n|0)==59&&(b=r,(Lt(i[b>>2]|0,i[b+4>>2]|0)|0)==1)){a=9;break}b=r,v=i[b>>2]|0,b=i[b+4>>2]&-1040385,y=J(a|0,0,45)|0,b=b|T()|0,a=r,i[a>>2]=v|y,i[a+4>>2]=b,a=0}else a=1;while(0);return b=a,M=g,b|0}function Mn(e,t,n,r,i,a){e|=0,t|=0,n|=0,r|=0,i|=0,a|=0;var o=0,s=0;return s=M,M=M+16|0,o=s,i?e=15:(e=An(e,t,n,r,o)|0,e||=(Ze(o,a),0)),M=s,e|0}function Nn(e,t,n,r,i){e|=0,t|=0,n|=0,r|=0,i|=0;var a=0,o=0;return o=M,M=M+16|0,a=o,r?n=15:(n=Qe(n,a)|0,n||=jn(e,t,a,i)|0),M=o,n|0}function Pn(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var o=0,s=0,c=0,l=0;return l=M,M=M+32|0,s=l+12|0,c=l,o=An(e,t,e,t,s)|0,o|0?(c=o,M=l,c|0):(e=An(e,t,n,r,c)|0,e|0?(c=e,M=l,c|0):(s=Xe(s,c)|0,c=a,i[c>>2]=s,i[c+4>>2]=((s|0)<0)<<31>>31,c=0,M=l,c|0))}function Fn(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var o=0,s=0,c=0,l=0;return l=M,M=M+32|0,s=l+12|0,c=l,o=An(e,t,e,t,s)|0,!o&&(o=An(e,t,n,r,c)|0,!o)?(r=Xe(s,c)|0,r=K(r|0,((r|0)<0)<<31>>31|0,1,0)|0,s=T()|0,c=a,i[c>>2]=r,i[c+4>>2]=s,c=0,M=l,c|0):(c=o,M=l,c|0)}function In(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var o=0,s=0,c=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,D=0,O=0;if(D=M,M=M+48|0,C=D+24|0,s=D+12|0,w=D,o=An(e,t,e,t,C)|0,!o&&(o=An(e,t,n,r,s)|0,!o)){x=Xe(C,s)|0,S=((x|0)<0)<<31>>31,i[C>>2]=0,i[C+4>>2]=0,i[C+8>>2]=0,i[s>>2]=0,i[s+4>>2]=0,i[s+8>>2]=0,An(e,t,e,t,C)|0&&E(27795,27538,692,27747),An(e,t,n,r,s)|0&&E(27795,27538,697,27747),$e(C),$e(s),f=x|0?1/(x|0):0,n=i[C>>2]|0,_=f*+((i[s>>2]|0)-n|0),v=C+4|0,r=i[v>>2]|0,y=f*+((i[s+4>>2]|0)-r|0),b=C+8|0,o=i[b>>2]|0,f*=+((i[s+8>>2]|0)-o|0),i[w>>2]=n,p=w+4|0,i[p>>2]=r,m=w+8|0,i[m>>2]=o;a:do if((x|0)<0)o=0;else for(h=0,g=0;;){u=+(g>>>0)+4294967296*(h|0),O=_*u+ +(n|0),c=y*u+ +(r|0),u=f*u+ +(o|0),n=~~+Vr(+O),s=~~+Vr(+c),o=~~+Vr(+u),O=+l(+(+(n|0)-O)),c=+l(+(+(s|0)-c)),u=+l(+(+(o|0)-u));do if(O>c&O>u)n=0-(s+o)|0,r=s;else if(d=0-n|0,c>u){r=d-o|0;break}else{r=s,o=d-s|0;break}while(0);if(i[w>>2]=n,i[p>>2]=r,i[m>>2]=o,et(w),o=jn(e,t,w,a+(g<<3)|0)|0,o|0)break a;if(!((h|0)<(S|0)|(h|0)==(S|0)&g>>>0>>0)){o=0;break a}n=K(g|0,h|0,1,0)|0,r=T()|0,h=r,g=n,n=i[C>>2]|0,r=i[v>>2]|0,o=i[b>>2]|0}while(0);return w=o,M=D,w|0}return w=o,M=D,w|0}function Ln(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var i=0,a=0,o=0;if((n|0)==0&(r|0)==0)return i=0,a=1,w(i|0),a|0;a=e,i=t,e=1,t=0;do o=(n&1|0)==0&!0,e=Pr((o?1:a)|0,(o?0:i)|0,e|0,t|0)|0,t=T()|0,n=Lr(n|0,r|0,1)|0,r=T()|0,a=Pr(a|0,i|0,a|0,i|0)|0,i=T()|0;while(!((n|0)==0&(r|0)==0));return w(t|0),e|0}function Rn(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var o=0,s=0,c=0,l=0,u=0,d=0,p=0;l=M,M=M+16|0,s=l,c=q(e|0,t|0,52)|0,T()|0,c&=15;do if(c){if(o=qt(e,t,s)|0,!o){d=+a[s>>3],u=1/f(+d),p=+a[25968+(c<<3)>>3],a[n>>3]=d+p,a[n+8>>3]=d-p,d=+a[s+8>>3],u=p*u,a[n+16>>3]=u+d,a[n+24>>3]=d-u;break}return c=o,M=l,c|0}else{if(o=q(e|0,t|0,45)|0,T()|0,o&=127,o>>>0>121)return c=5,M=l,c|0;s=22064+(o<<5)|0,i[n>>2]=i[s>>2],i[n+4>>2]=i[s+4>>2],i[n+8>>2]=i[s+8>>2],i[n+12>>2]=i[s+12>>2],i[n+16>>2]=i[s+16>>2],i[n+20>>2]=i[s+20>>2],i[n+24>>2]=i[s+24>>2],i[n+28>>2]=i[s+28>>2];break}while(0);return je(n,r?1.4:1.1),r=26096+(c<<3)|0,(i[r>>2]|0)==(e|0)&&(i[r+4>>2]|0)==(t|0)&&(a[n>>3]=1.5707963267948966),c=26224+(c<<3)|0,(i[c>>2]|0)==(e|0)&&(i[c+4>>2]|0)==(t|0)&&(a[n+8>>3]=-1.5707963267948966),+a[n>>3]!=1.5707963267948966&&+a[n+8>>3]!=-1.5707963267948966?(c=0,M=l,c|0):(a[n+16>>3]=3.141592653589793,a[n+24>>3]=-3.141592653589793,c=0,M=l,c|0)}function zn(e,t,n,a){e|=0,t|=0,n|=0,a|=0;var o=0,s=0,c=0,l=0,u=0,d=0,f=0;d=M,M=M+48|0,c=d+32|0,s=d+40|0,l=d,Et(c,0,0,0),u=i[c>>2]|0,c=i[c+4>>2]|0;do if(n>>>0<=15){if(o=Kn(a)|0,o|0){a=l,i[a>>2]=0,i[a+4>>2]=0,i[l+8>>2]=o,i[l+12>>2]=-1,a=l+16|0,u=l+29|0,i[a>>2]=0,i[a+4>>2]=0,i[a+8>>2]=0,r[a+12>>0]=0,r[u>>0]=r[s>>0]|0,r[u+1>>0]=r[s+1>>0]|0,r[u+2>>0]=r[s+2>>0]|0;break}if(o=Or((i[t+8>>2]|0)+1|0,32)|0,o){qn(t,o),f=l,i[f>>2]=u,i[f+4>>2]=c,i[l+8>>2]=0,i[l+12>>2]=n,i[l+16>>2]=a,i[l+20>>2]=t,i[l+24>>2]=o,r[l+28>>0]=0,u=l+29|0,r[u>>0]=r[s>>0]|0,r[u+1>>0]=r[s+1>>0]|0,r[u+2>>0]=r[s+2>>0]|0;break}else{a=l,i[a>>2]=0,i[a+4>>2]=0,i[l+8>>2]=13,i[l+12>>2]=-1,a=l+16|0,u=l+29|0,i[a>>2]=0,i[a+4>>2]=0,i[a+8>>2]=0,r[a+12>>0]=0,r[u>>0]=r[s>>0]|0,r[u+1>>0]=r[s+1>>0]|0,r[u+2>>0]=r[s+2>>0]|0;break}}else u=l,i[u>>2]=0,i[u+4>>2]=0,i[l+8>>2]=4,i[l+12>>2]=-1,u=l+16|0,f=l+29|0,i[u>>2]=0,i[u+4>>2]=0,i[u+8>>2]=0,r[u+12>>0]=0,r[f>>0]=r[s>>0]|0,r[f+1>>0]=r[s+1>>0]|0,r[f+2>>0]=r[s+2>>0]|0;while(0);Bn(l),i[e>>2]=i[l>>2],i[e+4>>2]=i[l+4>>2],i[e+8>>2]=i[l+8>>2],i[e+12>>2]=i[l+12>>2],i[e+16>>2]=i[l+16>>2],i[e+20>>2]=i[l+20>>2],i[e+24>>2]=i[l+24>>2],i[e+28>>2]=i[l+28>>2],M=d}function Bn(e){e|=0;var t=0,n=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0;if(S=M,M=M+336|0,h=S+168|0,g=S,a=e,n=i[a>>2]|0,a=i[a+4>>2]|0,(n|0)==0&(a|0)==0){M=S;return}if(t=e+28|0,r[t>>0]|0?(n=Vn(n,a)|0,a=T()|0):r[t>>0]=1,x=e+20|0,!(i[i[x>>2]>>2]|0)){t=e+24|0,n=i[t>>2]|0,n|0&&Dr(n),b=e,i[b>>2]=0,i[b+4>>2]=0,i[e+8>>2]=0,i[x>>2]=0,i[e+12>>2]=-1,i[e+16>>2]=0,i[t>>2]=0,M=S;return}b=e+16|0,t=i[b>>2]|0,o=t&15;a:do if((n|0)==0&(a|0)==0)y=e+24|0;else{_=e+12|0,p=(o|0)==3,f=t&255,u=(o|1)==3,m=e+24|0,d=(o+-1|0)>>>0<3,c=(o|2)==3,l=g+8|0;b:for(;;){if(s=q(n|0,a|0,52)|0,T()|0,s&=15,(s|0)==(i[_>>2]|0)){switch(f&15){case 0:case 2:case 3:if(o=qt(n,a,h)|0,o|0){v=15;break b}if(Jn(i[x>>2]|0,i[m>>2]|0,h)|0){v=19;break b}break;default:}if(u&&(o=i[(i[x>>2]|0)+4>>2]|0,i[h>>2]=i[o>>2],i[h+4>>2]=i[o+4>>2],i[h+8>>2]=i[o+8>>2],i[h+12>>2]=i[o+12>>2],we(26832,h)|0)){if(Wt(i[(i[x>>2]|0)+4>>2]|0,s,g)|0){v=25;break}if(o=g,(i[o>>2]|0)==(n|0)&&(i[o+4>>2]|0)==(a|0)){v=29;break}}if(d){if(o=Jt(n,a,h)|0,o|0){v=32;break}if(Rn(n,a,g,0)|0){v=36;break}if(c&&Yn(i[x>>2]|0,i[m>>2]|0,h,g)|0){v=42;break}if(u&&Zn(i[x>>2]|0,i[m>>2]|0,h,g)|0){v=42;break}}if(p){if(t=Rn(n,a,h,1)|0,o=i[m>>2]|0,t|0){v=45;break}if(Te(o,h)|0){if(Oe(g,h),De(h,i[m>>2]|0)|0){v=53;break}if(Jn(i[x>>2]|0,i[m>>2]|0,l)|0){v=53;break}if(Zn(i[x>>2]|0,i[m>>2]|0,g,h)|0){v=53;break}}}}do if((s|0)<(i[_>>2]|0)){if(t=Rn(n,a,h,1)|0,o=i[m>>2]|0,t|0){v=58;break b}if(!(Te(o,h)|0)){v=73;break}if(De(i[m>>2]|0,h)|0&&(Oe(g,h),Yn(i[x>>2]|0,i[m>>2]|0,g,h)|0)){v=65;break b}if(n=Mt(n,a,s+1|0,g)|0,n|0){v=67;break b}a=g,n=i[a>>2]|0,a=i[a+4>>2]|0}else v=73;while(0);if((v|0)==73&&(v=0,n=Vn(n,a)|0,a=T()|0),(n|0)==0&(a|0)==0){y=m;break a}}switch(v|0){case 15:t=i[m>>2]|0,t|0&&Dr(t),v=e,i[v>>2]=0,i[v+4>>2]=0,i[x>>2]=0,i[_>>2]=-1,i[b>>2]=0,i[m>>2]=0,i[e+8>>2]=o,v=20;break;case 19:i[e>>2]=n,i[e+4>>2]=a,v=20;break;case 25:E(27795,27761,470,27772);break;case 29:i[e>>2]=n,i[e+4>>2]=a,M=S;return;case 32:t=i[m>>2]|0,t|0&&Dr(t),y=e,i[y>>2]=0,i[y+4>>2]=0,i[x>>2]=0,i[_>>2]=-1,i[b>>2]=0,i[m>>2]=0,i[e+8>>2]=o,M=S;return;case 36:E(27795,27761,493,27772);break;case 42:i[e>>2]=n,i[e+4>>2]=a,M=S;return;case 45:o|0&&Dr(o),v=e,i[v>>2]=0,i[v+4>>2]=0,i[x>>2]=0,i[_>>2]=-1,i[b>>2]=0,i[m>>2]=0,i[e+8>>2]=t,v=55;break;case 53:i[e>>2]=n,i[e+4>>2]=a,v=55;break;case 58:o|0&&Dr(o),v=e,i[v>>2]=0,i[v+4>>2]=0,i[x>>2]=0,i[_>>2]=-1,i[b>>2]=0,i[m>>2]=0,i[e+8>>2]=t,v=71;break;case 65:i[e>>2]=n,i[e+4>>2]=a,v=71;break;case 67:t=i[m>>2]|0,t|0&&Dr(t),y=e,i[y>>2]=0,i[y+4>>2]=0,i[x>>2]=0,i[_>>2]=-1,i[b>>2]=0,i[m>>2]=0,i[e+8>>2]=n,M=S;return}if((v|0)==20){M=S;return}else if((v|0)==55){M=S;return}else if((v|0)==71){M=S;return}}while(0);t=i[y>>2]|0,t|0&&Dr(t),v=e,i[v>>2]=0,i[v+4>>2]=0,i[e+8>>2]=0,i[x>>2]=0,i[e+12>>2]=-1,i[b>>2]=0,i[y>>2]=0,M=S}function Vn(e,t){e|=0,t|=0;var n=0,r=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0;f=M,M=M+16|0,d=f,r=q(e|0,t|0,52)|0,T()|0,r&=15,n=q(e|0,t|0,45)|0,T()|0;do if(r){for(;n=J(r+4095|0,0,52)|0,a=T()|0|t&-15728641,o=(15-r|0)*3|0,s=J(7,0,o|0)|0,c=T()|0,n=n|e|s,a|=c,l=q(e|0,t|0,o|0)|0,T()|0,l&=7,r=r+-1|0,!(l>>>0<6);)if(r)t=a,e=n;else{u=4;break}if((u|0)==4){n=q(n|0,a|0,45)|0,T()|0;break}return d=(l|0)==0&(kt(n,a)|0)!=0,d=J((d?2:1)+l|0,0,o|0)|0,u=T()|0|t&~c,d|=e&~s,w(u|0),M=f,d|0}while(0);return n&=127,n>>>0>120?(u=0,d=0,w(u|0),M=f,d|0):(Et(d,0,n+1|0,0),u=i[d+4>>2]|0,d=i[d>>2]|0,w(u|0),M=f,d|0)}function Hn(e,t,n,r,a,o){e|=0,t|=0,n|=0,r|=0,a|=0,o|=0;var s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0;_=M,M=M+160|0,f=_+80|0,c=_+64|0,p=_+112|0,g=_,zn(f,e,t,n),u=f,tn(c,i[u>>2]|0,i[u+4>>2]|0,t),u=c,l=i[u>>2]|0,u=i[u+4>>2]|0,s=i[f+8>>2]|0,m=p+4|0,i[m>>2]=i[f>>2],i[m+4>>2]=i[f+4>>2],i[m+8>>2]=i[f+8>>2],i[m+12>>2]=i[f+12>>2],i[m+16>>2]=i[f+16>>2],i[m+20>>2]=i[f+20>>2],i[m+24>>2]=i[f+24>>2],i[m+28>>2]=i[f+28>>2],m=g,i[m>>2]=l,i[m+4>>2]=u,m=g+8|0,i[m>>2]=s,e=g+12|0,t=p,n=e+36|0;do i[e>>2]=i[t>>2],e=e+4|0,t=t+4|0;while((e|0)<(n|0));if(p=g+48|0,i[p>>2]=i[c>>2],i[p+4>>2]=i[c+4>>2],i[p+8>>2]=i[c+8>>2],i[p+12>>2]=i[c+12>>2],(l|0)==0&(u|0)==0)return g=s,M=_,g|0;n=g+16|0,d=g+24|0,f=g+28|0,s=0,c=0,t=l,e=u;do{if(!((s|0)<(a|0)|(s|0)==(a|0)&c>>>0>>0)){h=4;break}if(u=c,c=K(c|0,s|0,1,0)|0,s=T()|0,u=o+(u<<3)|0,i[u>>2]=t,i[u+4>>2]=e,rn(p),e=p,t=i[e>>2]|0,e=i[e+4>>2]|0,(t|0)==0&(e|0)==0){if(Bn(n),t=n,e=i[t>>2]|0,t=i[t+4>>2]|0,(e|0)==0&(t|0)==0){h=10;break}nn(e,t,i[f>>2]|0,p),e=p,t=i[e>>2]|0,e=i[e+4>>2]|0}u=g,i[u>>2]=t,i[u+4>>2]=e}while(!((t|0)==0&(e|0)==0));return(h|0)==4?(e=g+40|0,t=i[e>>2]|0,t|0&&Dr(t),h=g+16|0,i[h>>2]=0,i[h+4>>2]=0,i[d>>2]=0,i[g+36>>2]=0,i[f>>2]=-1,i[g+32>>2]=0,i[e>>2]=0,nn(0,0,0,p),i[g>>2]=0,i[g+4>>2]=0,i[m>>2]=0,g=14,M=_,g|0):((h|0)==10&&(i[g>>2]=0,i[g+4>>2]=0,i[m>>2]=i[d>>2]),g=i[m>>2]|0,M=_,g|0)}function Un(e,t,n,o){e|=0,t|=0,n|=0,o|=0;var s=0,c=0,u=0,d=0,p=0,m=0,h=0,g=0,_=0,v=0;if(g=M,M=M+48|0,p=g+32|0,d=g+40|0,m=g,!(i[e>>2]|0))return h=o,i[h>>2]=0,i[h+4>>2]=0,h=0,M=g,h|0;Et(p,0,0,0),u=p,s=i[u>>2]|0,u=i[u+4>>2]|0;do if(t>>>0>15)h=m,i[h>>2]=0,i[h+4>>2]=0,i[m+8>>2]=4,i[m+12>>2]=-1,h=m+16|0,n=m+29|0,i[h>>2]=0,i[h+4>>2]=0,i[h+8>>2]=0,r[h+12>>0]=0,r[n>>0]=r[d>>0]|0,r[n+1>>0]=r[d+1>>0]|0,r[n+2>>0]=r[d+2>>0]|0,n=4,h=9;else{if(n=Kn(n)|0,n|0){p=m,i[p>>2]=0,i[p+4>>2]=0,i[m+8>>2]=n,i[m+12>>2]=-1,p=m+16|0,h=m+29|0,i[p>>2]=0,i[p+4>>2]=0,i[p+8>>2]=0,r[p+12>>0]=0,r[h>>0]=r[d>>0]|0,r[h+1>>0]=r[d+1>>0]|0,r[h+2>>0]=r[d+2>>0]|0,h=9;break}if(n=Or((i[e+8>>2]|0)+1|0,32)|0,!n){h=m,i[h>>2]=0,i[h+4>>2]=0,i[m+8>>2]=13,i[m+12>>2]=-1,h=m+16|0,n=m+29|0,i[h>>2]=0,i[h+4>>2]=0,i[h+8>>2]=0,r[h+12>>0]=0,r[n>>0]=r[d>>0]|0,r[n+1>>0]=r[d+1>>0]|0,r[n+2>>0]=r[d+2>>0]|0,n=13,h=9;break}qn(e,n),v=m,i[v>>2]=s,i[v+4>>2]=u,u=m+8|0,i[u>>2]=0,i[m+12>>2]=t,i[m+20>>2]=e,i[m+24>>2]=n,r[m+28>>0]=0,s=m+29|0,r[s>>0]=r[d>>0]|0,r[s+1>>0]=r[d+1>>0]|0,r[s+2>>0]=r[d+2>>0]|0,i[m+16>>2]=3,_=+Ce(n),_*=+xe(n),c=+l(+ +a[n>>3]),c=_/+f(+ +Br(+c,+ +l(+ +a[n+8>>3])))*6371.007180918475*6371.007180918475,s=m+12|0,n=i[s>>2]|0;a:do if((n|0)>0)do{if(pn(n+-1|0,p)|0,!(c/+a[p>>3]>10))break a;v=i[s>>2]|0,n=v+-1|0,i[s>>2]=n}while((v|0)>1);while(0);if(Bn(m),s=o,i[s>>2]=0,i[s+4>>2]=0,s=m,n=i[s>>2]|0,s=i[s+4>>2]|0,!((n|0)==0&(s|0)==0))do Ot(n,s,t,p)|0,d=p,e=o,d=K(i[e>>2]|0,i[e+4>>2]|0,i[d>>2]|0,i[d+4>>2]|0)|0,e=T()|0,v=o,i[v>>2]=d,i[v+4>>2]=e,Bn(m),v=m,n=i[v>>2]|0,s=i[v+4>>2]|0;while(!((n|0)==0&(s|0)==0));n=i[u>>2]|0}while(0);return v=n,M=g,v|0}function Wn(e,t,n){e|=0,t|=0,n|=0;var r=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0;if(!(we(t,n)|0)||(t=Se(t)|0,r=+a[n>>3],o=+a[n+8>>3],o=t&o<0?o+6.283185307179586:o,m=i[e>>2]|0,(m|0)<=0))return m=0,m|0;if(p=i[e+4>>2]|0,t){t=0,f=o,n=-1,e=0;a:for(;;){for(d=e;c=+a[p+(d<<4)>>3],o=+a[p+(d<<4)+8>>3],e=(n+2|0)%(m|0)|0,s=+a[p+(e<<4)>>3],l=+a[p+(e<<4)+8>>3],c>s?(u=c,c=l):(u=s,s=c,c=o,o=l),r=r==s|r==u?r+2220446049250313e-31:r,ru;)if(n=d+1|0,(n|0)>=(m|0)){n=22;break a}else e=d,d=n,n=e;if(l=c<0?c+6.283185307179586:c,c=o<0?o+6.283185307179586:o,f=l==f|c==f?f+-2220446049250313e-31:f,u=l+(c-l)*((r-s)/(u-s)),(u<0?u+6.283185307179586:u)>f&&(t^=1),e=d+1|0,(e|0)>=(m|0)){n=22;break}else n=d}if((n|0)==22)return t|0}else{t=0,f=o,n=-1,e=0;b:for(;;){for(d=e;c=+a[p+(d<<4)>>3],o=+a[p+(d<<4)+8>>3],e=(n+2|0)%(m|0)|0,s=+a[p+(e<<4)>>3],l=+a[p+(e<<4)+8>>3],c>s?(u=c,c=l):(u=s,s=c,c=o,o=l),r=r==s|r==u?r+2220446049250313e-31:r,ru;)if(n=d+1|0,(n|0)>=(m|0)){n=22;break b}else e=d,d=n,n=e;if(f=c==f|o==f?f+-2220446049250313e-31:f,c+(o-c)*((r-s)/(u-s))>f&&(t^=1),e=d+1|0,(e|0)>=(m|0)){n=22;break}else n=d}if((n|0)==22)return t|0}return 0}function Gn(e,t){e|=0,t|=0;var n=0,r=0,o=0,s=0,c=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0;if(_=i[e>>2]|0,!_){i[t>>2]=0,i[t+4>>2]=0,i[t+8>>2]=0,i[t+12>>2]=0,i[t+16>>2]=0,i[t+20>>2]=0,i[t+24>>2]=0,i[t+28>>2]=0;return}if(v=t+8|0,a[v>>3]=17976931348623157e292,y=t+24|0,a[y>>3]=17976931348623157e292,a[t>>3]=-17976931348623157e292,b=t+16|0,a[b>>3]=-17976931348623157e292,!((_|0)<=0)){for(h=i[e+4>>2]|0,f=17976931348623157e292,p=-17976931348623157e292,m=0,e=-1,s=17976931348623157e292,c=17976931348623157e292,d=-17976931348623157e292,r=-17976931348623157e292,g=0;n=+a[h+(g<<4)>>3],u=+a[h+(g<<4)+8>>3],e=e+2|0,o=+a[h+(((e|0)==(_|0)?0:e)<<4)+8>>3],n>3]=n,s=n),u>3]=u,c=u),n>d?a[t>>3]=n:n=d,u>r&&(a[b>>3]=u,r=u),f=u>0&up?u:p,m|=+l(+(u-o))>3.141592653589793,e=g+1|0,(e|0)!=(_|0);)x=g,d=n,g=e,e=x;m&&(a[b>>3]=p,a[y>>3]=f)}}function Kn(e){return e|=0,(e>>>0<4?0:15)|0}function qn(e,t){e|=0,t|=0;var n=0,r=0,o=0,s=0,c=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0;if(_=i[e>>2]|0,_){if(v=t+8|0,a[v>>3]=17976931348623157e292,y=t+24|0,a[y>>3]=17976931348623157e292,a[t>>3]=-17976931348623157e292,b=t+16|0,a[b>>3]=-17976931348623157e292,(_|0)>0){for(o=i[e+4>>2]|0,h=17976931348623157e292,g=-17976931348623157e292,r=0,n=-1,d=17976931348623157e292,f=17976931348623157e292,m=-17976931348623157e292,c=-17976931348623157e292,x=0;s=+a[o+(x<<4)>>3],p=+a[o+(x<<4)+8>>3],T=n+2|0,u=+a[o+(((T|0)==(_|0)?0:T)<<4)+8>>3],s>3]=s,d=s),p>3]=p,f=p),s>m?a[t>>3]=s:s=m,p>c&&(a[b>>3]=p,c=p),h=p>0&pg?p:g,r|=+l(+(p-u))>3.141592653589793,n=x+1|0,(n|0)!=(_|0);)T=x,m=s,x=n,n=T;r&&(a[b>>3]=g,a[y>>3]=h)}}else i[t>>2]=0,i[t+4>>2]=0,i[t+8>>2]=0,i[t+12>>2]=0,i[t+16>>2]=0,i[t+20>>2]=0,i[t+24>>2]=0,i[t+28>>2]=0;if(T=e+8|0,n=i[T>>2]|0,!((n|0)<=0)){w=e+12|0,C=0;do if(o=i[w>>2]|0,r=C,C=C+1|0,y=t+(C<<5)|0,b=i[o+(r<<3)>>2]|0,b){if(x=t+(C<<5)+8|0,a[x>>3]=17976931348623157e292,e=t+(C<<5)+24|0,a[e>>3]=17976931348623157e292,a[y>>3]=-17976931348623157e292,S=t+(C<<5)+16|0,a[S>>3]=-17976931348623157e292,(b|0)>0){for(_=i[o+(r<<3)+4>>2]|0,h=17976931348623157e292,g=-17976931348623157e292,o=0,r=-1,v=0,d=17976931348623157e292,f=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292;s=+a[_+(v<<4)>>3],m=+a[_+(v<<4)+8>>3],r=r+2|0,u=+a[_+(((r|0)==(b|0)?0:r)<<4)+8>>3],s>3]=s,d=s),m>3]=m,f=m),s>p?a[y>>3]=s:s=p,m>c&&(a[S>>3]=m,c=m),h=m>0&mg?m:g,o|=+l(+(m-u))>3.141592653589793,r=v+1|0,(r|0)!=(b|0);)E=v,v=r,p=s,r=E;o&&(a[S>>3]=g,a[e>>3]=h)}}else i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0,i[y+16>>2]=0,i[y+20>>2]=0,i[y+24>>2]=0,i[y+28>>2]=0,n=i[T>>2]|0;while((C|0)<(n|0))}}function Jn(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0;if(!(Wn(e,t,n)|0))return a=0,a|0;if(a=e+8|0,(i[a>>2]|0)<=0)return a=1,a|0;for(r=e+12|0,e=0;;){if(o=e,e=e+1|0,Wn((i[r>>2]|0)+(o<<3)|0,t+(e<<5)|0,n)|0){e=0,r=6;break}if((e|0)>=(i[a>>2]|0)){e=1,r=6;break}}return(r|0)==6?e|0:0}function Yn(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0,l=0,u=0,d=0;if(u=M,M=M+16|0,c=u,s=n+8|0,!(Wn(e,t,s)|0))return l=0,M=u,l|0;l=e+8|0;a:do if((i[l>>2]|0)>0){for(o=e+12|0,a=0;;){if(d=a,a=a+1|0,Wn((i[o>>2]|0)+(d<<3)|0,t+(a<<5)|0,s)|0){a=0;break}if((a|0)>=(i[l>>2]|0))break a}return M=u,a|0}while(0);if(Xn(e,t,n,r)|0)return d=0,M=u,d|0;i[c>>2]=i[n>>2],i[c+4>>2]=s,a=i[l>>2]|0;b:do if((a|0)>0)for(e=e+12|0,s=0,o=a;;){if(a=i[e>>2]|0,(i[a+(s<<3)>>2]|0)>0){if(Wn(c,r,i[a+(s<<3)+4>>2]|0)|0){a=0;break b}if(a=s+1|0,Xn((i[e>>2]|0)+(s<<3)|0,t+(a<<5)|0,n,r)|0){a=0;break b}o=i[l>>2]|0}else a=s+1|0;if((a|0)<(o|0))s=a;else{a=1;break}}else a=1;while(0);return d=a,M=u,d|0}function Xn(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0;if(w=M,M=M+176|0,b=w+172|0,o=w+168|0,x=w,!(Te(t,r)|0))return e=0,M=w,e|0;if(Ee(t,r,b,o),Hr(x|0,n|0,168)|0,(i[n>>2]|0)>0){t=0;do T=x+8+(t<<4)+8|0,y=+sn(+a[T>>3],i[o>>2]|0),a[T>>3]=y,t=t+1|0;while((t|0)<(i[n>>2]|0))}_=+a[r>>3],v=+a[r+8>>3],y=+sn(+a[r+16>>3],i[o>>2]|0),h=+sn(+a[r+24>>3],i[o>>2]|0);a:do if((i[e>>2]|0)>0){if(r=e+4|0,o=i[x>>2]|0,(o|0)<=0){for(t=0;;)if(t=t+1|0,(t|0)>=(i[e>>2]|0)){t=0;break a}}for(n=0;;){if(t=i[r>>2]|0,m=+a[t+(n<<4)>>3],g=+sn(+a[t+(n<<4)+8>>3],i[b>>2]|0),t=i[r>>2]|0,n=n+1|0,T=(n|0)%(i[e>>2]|0)|0,s=+a[t+(T<<4)>>3],c=+sn(+a[t+(T<<4)+8>>3],i[b>>2]|0),!(m>=_)|!(s>=_)&&!(m<=v)|!(s<=v)&&!(g<=h)|!(c<=h)&&!(g>=y)|!(c>=y)){p=s-m,d=c-g,t=0;do if(E=t,t=t+1|0,T=(t|0)==(o|0)?0:t,s=+a[x+8+(E<<4)+8>>3],c=+a[x+8+(T<<4)+8>>3]-s,l=+a[x+8+(E<<4)>>3],u=+a[x+8+(T<<4)>>3]-l,f=p*c-d*u,f!=0&&(S=g-s,C=m-l,u=(S*u-c*C)/f,!(u<0|u>1))&&(f=(p*S-d*C)/f,f>=0&f<=1)){t=1;break a}while((t|0)<(o|0))}if((n|0)>=(i[e>>2]|0)){t=0;break}}}else t=0;while(0);return E=t,M=w,E|0}function Zn(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0;if(Xn(e,t,n,r)|0)return o=1,o|0;if(o=e+8|0,(i[o>>2]|0)<=0)return o=0,o|0;for(a=e+12|0,e=0;;){if(s=e,e=e+1|0,Xn((i[a>>2]|0)+(s<<3)|0,t+(e<<5)|0,n,r)|0){e=1,a=6;break}if((e|0)>=(i[o>>2]|0)){e=0,a=6;break}}return(a|0)==6?e|0:0}function Qn(){return 8}function $n(){return 16}function er(){return 168}function tr(){return 8}function nr(){return 16}function rr(){return 12}function ir(){return 8}function ar(e){return e|=0,+(+((i[e>>2]|0)>>>0)+4294967296*(i[e+4>>2]|0))}function or(e){e|=0;var t=0,n=0;return n=+a[e>>3],t=+a[e+8>>3],+ +u(+(n*n+t*t))}function sr(e,t,n,r,i){e|=0,t|=0,n|=0,r|=0,i|=0;var o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0;u=+a[e>>3],l=+a[t>>3]-u,c=+a[e+8>>3],s=+a[t+8>>3]-c,f=+a[n>>3],o=+a[r>>3]-f,p=+a[n+8>>3],d=+a[r+8>>3]-p,o=(o*(c-p)-(u-f)*d)/(l*d-s*o),a[i>>3]=u+l*o,a[i+8>>3]=c+s*o}function cr(e,t){return e|=0,t|=0,+l(+(a[e>>3]-+a[t>>3]))<1.1920928955078125e-7?(t=+l(+(a[e+8>>3]-+a[t+8>>3]))<1.1920928955078125e-7,t|0):(t=0,t|0)}function lr(e,t){e|=0,t|=0;var n=0,r=0,i=0;return i=a[e>>3]-+a[t>>3],r=a[e+8>>3]-+a[t+8>>3],n=a[e+16>>3]-+a[t+16>>3],+(i*i+r*r+n*n)}function ur(e,t){e|=0,t|=0;var n=0,r=0,i=0;n=+a[e>>3],r=+f(+n),n=+p(+n),a[t+16>>3]=n,n=+a[e+8>>3],i=r*+f(+n),a[t>>3]=i,n=r*+p(+n),a[t+8>>3]=n}function dr(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0;if(o=M,M=M+16|0,a=o,r=kt(e,t)|0,(n+-1|0)>>>0>5||(r=(r|0)!=0,(n|0)==1&r))return a=-1,M=o,a|0;do if(fr(e,t,a)|0)r=-1;else if(r){r=((i[26352+(n<<2)>>2]|0)+5-(i[a>>2]|0)|0)%5|0;break}else{r=((i[26384+(n<<2)>>2]|0)+6-(i[a>>2]|0)|0)%6|0;break}while(0);return a=r,M=o,a|0}function fr(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0;if(d=M,M=M+32|0,c=d+16|0,l=d,r=Kt(e,t,c)|0,r|0)return n=r,M=d,n|0;o=xt(e,t)|0,u=Lt(e,t)|0,_e(o,l),r=ve(o,i[c>>2]|0)|0;do if(R(o)|0){do switch(o|0){case 4:a=0;break;case 14:a=1;break;case 24:a=2;break;case 38:a=3;break;case 49:a=4;break;case 58:a=5;break;case 63:a=6;break;case 72:a=7;break;case 83:a=8;break;case 97:a=9;break;case 107:a=10;break;case 117:a=11;break;default:E(27795,27797,75,27806)}while(0);if(s=i[26416+(a*24|0)+8>>2]|0,t=i[26416+(a*24|0)+16>>2]|0,e=i[c>>2]|0,(e|0)!=(i[l>>2]|0)&&(l=z(o)|0,e=i[c>>2]|0,l|(e|0)==(t|0)&&(r=(r+1|0)%6|0)),(u|0)==3&(e|0)==(t|0)){r=(r+5|0)%6|0;break}(u|0)==5&(e|0)==(s|0)&&(r=(r+1|0)%6|0)}while(0);return i[n>>2]=r,n=0,M=d,n|0}function pr(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0;if(b=M,M=M+32|0,y=b+24|0,_=b+20|0,h=b+8|0,m=b+16|0,p=b,l=(kt(e,t)|0)==0,l=l?6:5,d=q(e|0,t|0,52)|0,T()|0,d&=15,l>>>0<=n>>>0)return r=2,M=b,r|0;f=(d|0)==0,!f&&(g=J(7,0,(d^15)*3|0)|0,(g&e|0)==0&((T()|0)&t|0)==0)?a=n:o=4;a:do if((o|0)==4){if(a=(kt(e,t)|0)!=0,((a?4:5)|0)<(n|0)||fr(e,t,y)|0||(o=(i[y>>2]|0)+n|0,a=a?26704+(((o|0)%5|0)<<2)|0:26736+(((o|0)%6|0)<<2)|0,g=i[a>>2]|0,(g|0)==7))return r=1,M=b,r|0;i[_>>2]=0,a=L(e,t,g,_,h)|0;do if(!a){if(c=h,u=i[c>>2]|0,c=i[c+4>>2]|0,s=c>>>0>>0|(c|0)==(t|0)&u>>>0>>0,o=s?u:e,s=s?c:t,!f&&(f=J(7,0,(d^15)*3|0)|0,(u&f|0)==0&(c&(T()|0)|0)==0))a=n;else{if(c=(n+-1+l|0)%(l|0)|0,a=kt(e,t)|0,(c|0)<0&&E(27795,27797,248,27822),l=(a|0)!=0,((l?4:5)|0)<(c|0)&&E(27795,27797,248,27822),fr(e,t,y)|0&&E(27795,27797,248,27822),a=(i[y>>2]|0)+c|0,a=l?26704+(((a|0)%5|0)<<2)|0:26736+(((a|0)%6|0)<<2)|0,c=i[a>>2]|0,(c|0)==7&&E(27795,27797,248,27822),i[m>>2]=0,a=L(e,t,c,m,p)|0,a|0)break;u=p,l=i[u>>2]|0,u=i[u+4>>2]|0;do if(u>>>0>>0|(u|0)==(s|0)&l>>>0>>0){if(o=kt(l,u)|0?le(l,u,e,t)|0:i[26800+((((i[m>>2]|0)+(i[26768+(c<<2)>>2]|0)|0)%6|0)<<2)>>2]|0,a=kt(l,u)|0,(o+-1|0)>>>0>5){a=-1,o=l,s=u;break}if(a=(a|0)!=0,(o|0)==1&a){a=-1,o=l,s=u;break}do if(fr(l,u,y)|0)a=-1;else if(a){a=((i[26352+(o<<2)>>2]|0)+5-(i[y>>2]|0)|0)%5|0;break}else{a=((i[26384+(o<<2)>>2]|0)+6-(i[y>>2]|0)|0)%6|0;break}while(0);o=l,s=u}else a=n;while(0);c=h,u=i[c>>2]|0,c=i[c+4>>2]|0}if((o|0)==(u|0)&(s|0)==(c|0)){if(l=(kt(u,c)|0)!=0,e=l?le(u,c,e,t)|0:i[26800+((((i[_>>2]|0)+(i[26768+(g<<2)>>2]|0)|0)%6|0)<<2)>>2]|0,a=kt(u,c)|0,(e+-1|0)>>>0<=5&&(v=(a|0)!=0,!((e|0)==1&v)))do if(fr(u,c,y)|0)a=-1;else if(v){a=((i[26352+(e<<2)>>2]|0)+5-(i[y>>2]|0)|0)%5|0;break}else{a=((i[26384+(e<<2)>>2]|0)+6-(i[y>>2]|0)|0)%6|0;break}while(0);else a=-1;a=a+1|0,a=(a|0)==6|l&(a|0)==5?0:a}t=s,e=o;break a}while(0);return r=a,M=b,r|0}while(0);return v=J(a|0,0,56)|0,y=T()|0|t&-2130706433|536870912,i[r>>2]=v|e,i[r+4>>2]=y,r=0,M=b,r|0}function mr(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0;return o=(kt(e,t)|0)==0,r=pr(e,t,0,n)|0,a=(r|0)==0,o?!a||(r=pr(e,t,1,n+8|0)|0,r|0)||(r=pr(e,t,2,n+16|0)|0,r|0)||(r=pr(e,t,3,n+24|0)|0,r|0)||(r=pr(e,t,4,n+32|0)|0,r)?(o=r,o|0):pr(e,t,5,n+40|0)|0:!a||(r=pr(e,t,1,n+8|0)|0,r|0)||(r=pr(e,t,2,n+16|0)|0,r|0)||(r=pr(e,t,3,n+24|0)|0,r|0)||(r=pr(e,t,4,n+32|0)|0,r|0)?(o=r,o|0):(o=n+40|0,i[o>>2]=0,i[o+4>>2]=0,o=0,o|0)}function hr(e,t,n){e|=0,t|=0,n|=0;var r=0,a=0,o=0,s=0,c=0,l=0;return l=M,M=M+192|0,a=l,o=l+168|0,s=q(e|0,t|0,56)|0,T()|0,s&=7,c=t&-2130706433|134217728,r=Kt(e,c,o)|0,r|0?(c=r,M=l,c|0):(t=q(e|0,t|0,52)|0,T()|0,t&=15,kt(e,c)|0?mt(o,t,s,1,a):vt(o,t,s,1,a),c=a+8|0,i[n>>2]=i[c>>2],i[n+4>>2]=i[c+4>>2],i[n+8>>2]=i[c+8>>2],i[n+12>>2]=i[c+12>>2],c=0,M=l,c|0)}function gr(e,t){e|=0,t|=0;var n=0,r=0,a=0,o=0;return a=M,M=M+16|0,n=a,!(!0&(t&2013265920|0)==536870912)||(r=t&-2130706433|134217728,!(wt(e,r)|0))?(r=0,M=a,r|0):(o=q(e|0,t|0,56)|0,T()|0,o=(pr(e,r,o&7,n)|0)==0,r=n,r=o&((i[r>>2]|0)==(e|0)?(i[r+4>>2]|0)==(t|0):0)&1,M=a,r|0)}function _r(e,t,n){e|=0,t|=0,n|=0;var r=0;(t|0)>0?(r=Or(t,4)|0,i[e>>2]=r,r||E(27835,27858,40,27872)):i[e>>2]=0,i[e+4>>2]=t,i[e+8>>2]=0,i[e+12>>2]=n}function vr(e){e|=0;var t=0,n=0,r=0,o=0,s=0,c=0,u=0;o=e+4|0,s=e+12|0,c=e+8|0;a:for(;;){for(n=i[o>>2]|0,t=0;;){if((t|0)>=(n|0))break a;if(r=i[e>>2]|0,u=i[r+(t<<2)>>2]|0,!u)t=t+1|0;else break}t=r+(~~(l(+(d(10,+ +(15-(i[s>>2]|0)|0))*(+a[u>>3]+ +a[u+8>>3])))%+(n|0))>>>0<<2)|0,n=i[t>>2]|0;b:do if(n|0){if(r=u+32|0,(n|0)==(u|0))i[t>>2]=i[r>>2];else{if(n=n+32|0,t=i[n>>2]|0,!t)break;for(;(t|0)!=(u|0);)if(n=t+32|0,t=i[n>>2]|0,!t)break b;i[n>>2]=i[r>>2]}Dr(u),i[c>>2]=(i[c>>2]|0)+-1}while(0)}Dr(i[e>>2]|0)}function yr(e){e|=0;var t=0,n=0,r=0;for(r=i[e+4>>2]|0,n=0;;){if((n|0)>=(r|0)){t=0,n=4;break}if(t=i[(i[e>>2]|0)+(n<<2)>>2]|0,!t)n=n+1|0;else{n=4;break}}return(n|0)==4?t|0:0}function br(e,t){e|=0,t|=0;var n=0,r=0,o=0,s=0;if(n=~~(l(+(d(10,+ +(15-(i[e+12>>2]|0)|0))*(+a[t>>3]+ +a[t+8>>3])))%+(i[e+4>>2]|0))>>>0,n=(i[e>>2]|0)+(n<<2)|0,r=i[n>>2]|0,!r)return s=1,s|0;s=t+32|0;do if((r|0)!=(t|0)){if(n=i[r+32>>2]|0,!n)return s=1,s|0;for(o=n;;){if((o|0)==(t|0)){o=8;break}if(n=i[o+32>>2]|0,n)r=o,o=n;else{n=1,o=10;break}}if((o|0)==8){i[r+32>>2]=i[s>>2];break}else if((o|0)==10)return n|0}else i[n>>2]=i[s>>2];while(0);return Dr(t),s=e+8|0,i[s>>2]=(i[s>>2]|0)+-1,s=0,s|0}function xr(e,t,n){e|=0,t|=0,n|=0;var r=0,o=0,s=0,c=0;s=Er(40)|0,s||E(27888,27858,98,27901),i[s>>2]=i[t>>2],i[s+4>>2]=i[t+4>>2],i[s+8>>2]=i[t+8>>2],i[s+12>>2]=i[t+12>>2],o=s+16|0,i[o>>2]=i[n>>2],i[o+4>>2]=i[n+4>>2],i[o+8>>2]=i[n+8>>2],i[o+12>>2]=i[n+12>>2],i[s+32>>2]=0,o=~~(l(+(d(10,+ +(15-(i[e+12>>2]|0)|0))*(+a[t>>3]+ +a[t+8>>3])))%+(i[e+4>>2]|0))>>>0,o=(i[e>>2]|0)+(o<<2)|0,r=i[o>>2]|0;do if(!r)i[o>>2]=s;else{for(;!(on(r,t)|0&&on(r+16|0,n)|0);)if(o=i[r+32>>2]|0,r=o|0?o:r,!(i[r+32>>2]|0)){c=10;break}if((c|0)==10){i[r+32>>2]=s;break}return Dr(s),c=r,c|0}while(0);return c=e+8|0,i[c>>2]=(i[c>>2]|0)+1,c=s,c|0}function Sr(e,t,n){e|=0,t|=0,n|=0;var r=0,o=0;if(o=~~(l(+(d(10,+ +(15-(i[e+12>>2]|0)|0))*(+a[t>>3]+ +a[t+8>>3])))%+(i[e+4>>2]|0))>>>0,o=i[(i[e>>2]|0)+(o<<2)>>2]|0,!o)return n=0,n|0;if(!n){for(e=o;;){if(on(e,t)|0){r=10;break}if(e=i[e+32>>2]|0,!e){e=0,r=10;break}}if((r|0)==10)return e|0}for(e=o;;){if(on(e,t)|0&&on(e+16|0,n)|0){r=10;break}if(e=i[e+32>>2]|0,!e){e=0,r=10;break}}return(r|0)==10?e|0:0}function Cr(e,t){e|=0,t|=0;var n=0;if(n=~~(l(+(d(10,+ +(15-(i[e+12>>2]|0)|0))*(+a[t>>3]+ +a[t+8>>3])))%+(i[e+4>>2]|0))>>>0,e=i[(i[e>>2]|0)+(n<<2)>>2]|0,!e)return n=0,n|0;for(;;){if(on(e,t)|0){t=5;break}if(e=i[e+32>>2]|0,!e){e=0,t=5;break}}return(t|0)==5?e|0:0}function wr(){return 27920}function Tr(e){return e=+e,~~+Wr(+e)|0}function Er(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0;S=M,M=M+16|0,p=S;do if(e>>>0<245){if(u=e>>>0<11?16:e+11&-8,e=u>>>3,f=i[6981]|0,n=f>>>e,n&3|0)return t=(n&1^1)+e|0,e=27964+(t<<1<<2)|0,n=e+8|0,r=i[n>>2]|0,a=r+8|0,o=i[a>>2]|0,(o|0)==(e|0)?i[6981]=f&~(1<>2]=e,i[n>>2]=o),x=t<<3,i[r+4>>2]=x|3,x=r+x+4|0,i[x>>2]=i[x>>2]|1,x=a,M=S,x|0;if(d=i[6983]|0,u>>>0>d>>>0){if(n|0)return t=2<>>12&16,t>>>=c,n=t>>>5&8,t>>>=n,o=t>>>2&4,t>>>=o,e=t>>>1&2,t>>>=e,r=t>>>1&1,r=(n|c|o|e|r)+(t>>>r)|0,t=27964+(r<<1<<2)|0,e=t+8|0,o=i[e>>2]|0,c=o+8|0,n=i[c>>2]|0,(n|0)==(t|0)?(e=f&~(1<>2]=t,i[e>>2]=n,e=f),x=r<<3,s=x-u|0,i[o+4>>2]=u|3,a=o+u|0,i[a+4>>2]=s|1,i[o+x>>2]=s,d|0&&(r=i[6986]|0,t=d>>>3,n=27964+(t<<1<<2)|0,t=1<>2]|0):(i[6981]=e|t,t=n,e=n+8|0),i[e>>2]=r,i[t+12>>2]=r,i[r+8>>2]=t,i[r+12>>2]=n),i[6983]=s,i[6986]=a,x=c,M=S,x|0;if(o=i[6982]|0,o){for(n=(o&0-o)+-1|0,a=n>>>12&16,n>>>=a,r=n>>>5&8,n>>>=r,s=n>>>2&4,n>>>=s,c=n>>>1&2,n>>>=c,l=n>>>1&1,l=i[28228+((r|a|s|c|l)+(n>>>l)<<2)>>2]|0,n=l,c=l,l=(i[l+4>>2]&-8)-u|0;e=i[n+16>>2]|0,!(!e&&(e=i[n+20>>2]|0,!e));)s=(i[e+4>>2]&-8)-u|0,a=s>>>0>>0,n=e,c=a?e:c,l=a?s:l;if(s=c+u|0,s>>>0>c>>>0){a=i[c+24>>2]|0,t=i[c+12>>2]|0;do if((t|0)==(c|0)){if(e=c+20|0,t=i[e>>2]|0,!t&&(e=c+16|0,t=i[e>>2]|0,!t)){n=0;break}for(;;)if(r=t+20|0,n=i[r>>2]|0,n)t=n,e=r;else if(r=t+16|0,n=i[r>>2]|0,n)t=n,e=r;else break;i[e>>2]=0,n=t}else n=i[c+8>>2]|0,i[n+12>>2]=t,i[t+8>>2]=n,n=t;while(0);do if(a|0){if(t=i[c+28>>2]|0,e=28228+(t<<2)|0,(c|0)==(i[e>>2]|0)){if(i[e>>2]=n,!n){i[6982]=o&~(1<>2]|0)==(c|0)?x:a+20|0)>>2]=n,!n)break;i[n+24>>2]=a,t=i[c+16>>2]|0,t|0&&(i[n+16>>2]=t,i[t+24>>2]=n),t=i[c+20>>2]|0,t|0&&(i[n+20>>2]=t,i[t+24>>2]=n)}while(0);return l>>>0<16?(x=l+u|0,i[c+4>>2]=x|3,x=c+x+4|0,i[x>>2]=i[x>>2]|1):(i[c+4>>2]=u|3,i[s+4>>2]=l|1,i[s+l>>2]=l,d|0&&(r=i[6986]|0,t=d>>>3,n=27964+(t<<1<<2)|0,t=1<>2]|0):(i[6981]=t|f,t=n,e=n+8|0),i[e>>2]=r,i[t+12>>2]=r,i[r+8>>2]=t,i[r+12>>2]=n),i[6983]=l,i[6986]=s),x=c+8|0,M=S,x|0}else f=u}else f=u}else f=u}else if(e>>>0<=4294967231)if(e=e+11|0,u=e&-8,r=i[6982]|0,r){a=0-u|0,e>>>=8,e?u>>>0>16777215?l=31:(f=(e+1048320|0)>>>16&8,g=e<>>16&4,g<<=c,l=(g+245760|0)>>>16&2,l=14-(c|f|l)+(g<>>15)|0,l=u>>>(l+7|0)&1|l<<1):l=0,n=i[28228+(l<<2)>>2]|0;a:do if(!n)n=0,e=0,g=61;else for(e=0,c=u<<((l|0)==31?0:25-(l>>>1)|0),o=0;;){if(s=(i[n+4>>2]&-8)-u|0,s>>>0>>0)if(s)e=n,a=s;else{e=n,a=0,g=65;break a}if(g=i[n+20>>2]|0,n=i[n+16+(c>>>31<<2)>>2]|0,o=(g|0)==0|(g|0)==(n|0)?o:g,n)c<<=1;else{n=o,g=61;break}}while(0);if((g|0)==61){if((n|0)==0&(e|0)==0){if(e=2<>>12&16,f>>>=s,o=f>>>5&8,f>>>=o,c=f>>>2&4,f>>>=c,l=f>>>1&2,f>>>=l,n=f>>>1&1,e=0,n=i[28228+((o|s|c|l|n)+(f>>>n)<<2)>>2]|0}n?g=65:(c=e,s=a)}if((g|0)==65)for(o=n;;)if(f=(i[o+4>>2]&-8)-u|0,n=f>>>0>>0,a=n?f:a,e=n?o:e,n=i[o+16>>2]|0,n||=i[o+20>>2]|0,n)o=n;else{c=e,s=a;break}if(c|0&&s>>>0<((i[6983]|0)-u|0)>>>0&&(d=c+u|0,d>>>0>c>>>0)){o=i[c+24>>2]|0,t=i[c+12>>2]|0;do if((t|0)==(c|0)){if(e=c+20|0,t=i[e>>2]|0,!t&&(e=c+16|0,t=i[e>>2]|0,!t)){t=0;break}for(;;)if(a=t+20|0,n=i[a>>2]|0,n)t=n,e=a;else if(a=t+16|0,n=i[a>>2]|0,n)t=n,e=a;else break;i[e>>2]=0}else x=i[c+8>>2]|0,i[x+12>>2]=t,i[t+8>>2]=x;while(0);do if(o){if(e=i[c+28>>2]|0,n=28228+(e<<2)|0,(c|0)==(i[n>>2]|0)){if(i[n>>2]=t,!t){r&=~(1<>2]|0)==(c|0)?x:o+20|0)>>2]=t,!t)break;i[t+24>>2]=o,e=i[c+16>>2]|0,e|0&&(i[t+16>>2]=e,i[e+24>>2]=t),e=i[c+20>>2]|0,e&&(i[t+20>>2]=e,i[e+24>>2]=t)}while(0);b:do if(s>>>0<16)x=s+u|0,i[c+4>>2]=x|3,x=c+x+4|0,i[x>>2]=i[x>>2]|1;else{if(i[c+4>>2]=u|3,i[d+4>>2]=s|1,i[d+s>>2]=s,t=s>>>3,s>>>0<256){n=27964+(t<<1<<2)|0,e=i[6981]|0,t=1<>2]|0):(i[6981]=e|t,t=n,e=n+8|0),i[e>>2]=d,i[t+12>>2]=d,i[d+8>>2]=t,i[d+12>>2]=n;break}if(t=s>>>8,t?s>>>0>16777215?n=31:(b=(t+1048320|0)>>>16&8,x=t<>>16&4,x<<=y,n=(x+245760|0)>>>16&2,n=14-(y|b|n)+(x<>>15)|0,n=s>>>(n+7|0)&1|n<<1):n=0,t=28228+(n<<2)|0,i[d+28>>2]=n,e=d+16|0,i[e+4>>2]=0,i[e>>2]=0,e=1<>2]=d,i[d+24>>2]=t,i[d+12>>2]=d,i[d+8>>2]=d;break}t=i[t>>2]|0;c:do if((i[t+4>>2]&-8|0)!=(s|0)){for(r=s<<((n|0)==31?0:25-(n>>>1)|0);n=t+16+(r>>>31<<2)|0,e=i[n>>2]|0,e;)if((i[e+4>>2]&-8|0)==(s|0)){t=e;break c}else r<<=1,t=e;i[n>>2]=d,i[d+24>>2]=t,i[d+12>>2]=d,i[d+8>>2]=d;break b}while(0);b=t+8|0,x=i[b>>2]|0,i[x+12>>2]=d,i[b>>2]=d,i[d+8>>2]=x,i[d+12>>2]=t,i[d+24>>2]=0}while(0);return x=c+8|0,M=S,x|0}else f=u}else f=u;else f=-1;while(0);if(n=i[6983]|0,n>>>0>=f>>>0)return t=n-f|0,e=i[6986]|0,t>>>0>15?(x=e+f|0,i[6986]=x,i[6983]=t,i[x+4>>2]=t|1,i[e+n>>2]=t,i[e+4>>2]=f|3):(i[6983]=0,i[6986]=0,i[e+4>>2]=n|3,x=e+n+4|0,i[x>>2]=i[x>>2]|1),x=e+8|0,M=S,x|0;if(s=i[6984]|0,s>>>0>f>>>0)return y=s-f|0,i[6984]=y,x=i[6987]|0,b=x+f|0,i[6987]=b,i[b+4>>2]=y|1,i[x+4>>2]=f|3,x=x+8|0,M=S,x|0;if(i[7099]|0?e=i[7101]|0:(i[7101]=4096,i[7100]=4096,i[7102]=-1,i[7103]=-1,i[7104]=0,i[7092]=0,i[7099]=p&-16^1431655768,e=4096),c=f+48|0,l=f+47|0,o=e+l|0,a=0-e|0,u=o&a,u>>>0<=f>>>0||(e=i[7091]|0,e|0&&(d=i[7089]|0,p=d+u|0,p>>>0<=d>>>0|p>>>0>e>>>0)))return x=0,M=S,x|0;d:do if(i[7092]&4)t=0,g=143;else{n=i[6987]|0;e:do if(n){for(r=28372;p=i[r>>2]|0,!(p>>>0<=n>>>0&&(p+(i[r+4>>2]|0)|0)>>>0>n>>>0);)if(e=i[r+8>>2]|0,e)r=e;else{g=128;break e}if(t=o-s&a,t>>>0<2147483647)if(e=Gr(t|0)|0,(e|0)==((i[r>>2]|0)+(i[r+4>>2]|0)|0)){if((e|0)!=-1){s=t,o=e,g=145;break d}}else r=e,g=136;else t=0}else g=128;while(0);do if((g|0)==128)if(n=Gr(0)|0,(n|0)!=-1&&(t=n,m=i[7100]|0,h=m+-1|0,t=(h&t|0?(h+t&0-m)-t|0:0)+u|0,m=i[7089]|0,h=t+m|0,t>>>0>f>>>0&t>>>0<2147483647)){if(p=i[7091]|0,p|0&&h>>>0<=m>>>0|h>>>0>p>>>0){t=0;break}if(e=Gr(t|0)|0,(e|0)==(n|0)){s=t,o=n,g=145;break d}else r=e,g=136}else t=0;while(0);do if((g|0)==136){if(n=0-t|0,!(c>>>0>t>>>0&(t>>>0<2147483647&(r|0)!=-1)))if((r|0)==-1){t=0;break}else{s=t,o=r,g=145;break d}if(e=i[7101]|0,e=l-t+e&0-e,e>>>0>=2147483647){s=t,o=r,g=145;break d}if((Gr(e|0)|0)==-1){Gr(n|0)|0,t=0;break}else{s=e+t|0,o=r,g=145;break d}}while(0);i[7092]|=4,g=143}while(0);if((g|0)==143&&u>>>0<2147483647&&(y=Gr(u|0)|0,h=Gr(0)|0,_=h-y|0,v=_>>>0>(f+40|0)>>>0,!((y|0)==-1|v^1|y>>>0>>0&((y|0)!=-1&(h|0)!=-1)^1))&&(s=v?_:t,o=y,g=145),(g|0)==145){t=(i[7089]|0)+s|0,i[7089]=t,t>>>0>(i[7090]|0)>>>0&&(i[7090]=t),l=i[6987]|0;f:do if(l){for(t=28372;;){if(e=i[t>>2]|0,n=i[t+4>>2]|0,(o|0)==(e+n|0)){g=154;break}if(r=i[t+8>>2]|0,r)t=r;else break}if((g|0)==154&&(b=t+4|0,!(i[t+12>>2]&8|0))&&o>>>0>l>>>0&e>>>0<=l>>>0){i[b>>2]=n+s,x=(i[6984]|0)+s|0,y=l+8|0,y=y&7|0?0-y&7:0,b=l+y|0,y=x-y|0,i[6987]=b,i[6984]=y,i[b+4>>2]=y|1,i[l+x+4>>2]=40,i[6988]=i[7103];break}for(o>>>0<(i[6985]|0)>>>0&&(i[6985]=o),n=o+s|0,t=28372;;){if((i[t>>2]|0)==(n|0)){g=162;break}if(e=i[t+8>>2]|0,e)t=e;else break}if((g|0)==162&&!(i[t+12>>2]&8|0)){i[t>>2]=o,d=t+4|0,i[d>>2]=(i[d>>2]|0)+s,d=o+8|0,d=o+(d&7|0?0-d&7:0)|0,t=n+8|0,t=n+(t&7|0?0-t&7:0)|0,u=d+f|0,c=t-d-f|0,i[d+4>>2]=f|3;g:do if((l|0)==(t|0))x=(i[6984]|0)+c|0,i[6984]=x,i[6987]=u,i[u+4>>2]=x|1;else{if((i[6986]|0)==(t|0)){x=(i[6983]|0)+c|0,i[6983]=x,i[6986]=u,i[u+4>>2]=x|1,i[u+x>>2]=x;break}if(e=i[t+4>>2]|0,(e&3|0)==1){s=e&-8,r=e>>>3;h:do if(e>>>0<256)if(e=i[t+8>>2]|0,n=i[t+12>>2]|0,(n|0)==(e|0)){i[6981]&=~(1<>2]=n,i[n+8>>2]=e;break}else{o=i[t+24>>2]|0,e=i[t+12>>2]|0;do if((e|0)==(t|0)){if(n=t+16|0,r=n+4|0,e=i[r>>2]|0,e)n=r;else if(e=i[n>>2]|0,!e){e=0;break}for(;;)if(a=e+20|0,r=i[a>>2]|0,r)e=r,n=a;else if(a=e+16|0,r=i[a>>2]|0,r)e=r,n=a;else break;i[n>>2]=0}else x=i[t+8>>2]|0,i[x+12>>2]=e,i[e+8>>2]=x;while(0);if(!o)break;n=i[t+28>>2]|0,r=28228+(n<<2)|0;do if((i[r>>2]|0)!=(t|0)){if(x=o+16|0,i[((i[x>>2]|0)==(t|0)?x:o+20|0)>>2]=e,!e)break h}else{if(i[r>>2]=e,e|0)break;i[6982]&=~(1<>2]=o,n=t+16|0,r=i[n>>2]|0,r|0&&(i[e+16>>2]=r,i[r+24>>2]=e),n=i[n+4>>2]|0,!n)break;i[e+20>>2]=n,i[n+24>>2]=e}while(0);t=t+s|0,a=s+c|0}else a=c;if(t=t+4|0,i[t>>2]=i[t>>2]&-2,i[u+4>>2]=a|1,i[u+a>>2]=a,t=a>>>3,a>>>0<256){n=27964+(t<<1<<2)|0,e=i[6981]|0,t=1<>2]|0):(i[6981]=e|t,t=n,e=n+8|0),i[e>>2]=u,i[t+12>>2]=u,i[u+8>>2]=t,i[u+12>>2]=n;break}t=a>>>8;do if(!t)r=0;else{if(a>>>0>16777215){r=31;break}b=(t+1048320|0)>>>16&8,x=t<>>16&4,x<<=y,r=(x+245760|0)>>>16&2,r=14-(y|b|r)+(x<>>15)|0,r=a>>>(r+7|0)&1|r<<1}while(0);if(t=28228+(r<<2)|0,i[u+28>>2]=r,e=u+16|0,i[e+4>>2]=0,i[e>>2]=0,e=i[6982]|0,n=1<>2]=u,i[u+24>>2]=t,i[u+12>>2]=u,i[u+8>>2]=u;break}t=i[t>>2]|0;i:do if((i[t+4>>2]&-8|0)!=(a|0)){for(r=a<<((r|0)==31?0:25-(r>>>1)|0);n=t+16+(r>>>31<<2)|0,e=i[n>>2]|0,e;)if((i[e+4>>2]&-8|0)==(a|0)){t=e;break i}else r<<=1,t=e;i[n>>2]=u,i[u+24>>2]=t,i[u+12>>2]=u,i[u+8>>2]=u;break g}while(0);b=t+8|0,x=i[b>>2]|0,i[x+12>>2]=u,i[b>>2]=u,i[u+8>>2]=x,i[u+12>>2]=t,i[u+24>>2]=0}while(0);return x=d+8|0,M=S,x|0}for(t=28372;e=i[t>>2]|0,!(e>>>0<=l>>>0&&(x=e+(i[t+4>>2]|0)|0,x>>>0>l>>>0));)t=i[t+8>>2]|0;a=x+-47|0,e=a+8|0,e=a+(e&7|0?0-e&7:0)|0,a=l+16|0,e=e>>>0>>0?l:e,t=e+8|0,n=s+-40|0,y=o+8|0,y=y&7|0?0-y&7:0,b=o+y|0,y=n-y|0,i[6987]=b,i[6984]=y,i[b+4>>2]=y|1,i[o+n+4>>2]=40,i[6988]=i[7103],n=e+4|0,i[n>>2]=27,i[t>>2]=i[7093],i[t+4>>2]=i[7094],i[t+8>>2]=i[7095],i[t+12>>2]=i[7096],i[7093]=o,i[7094]=s,i[7096]=0,i[7095]=t,t=e+24|0;do b=t,t=t+4|0,i[t>>2]=7;while((b+8|0)>>>0>>0);if((e|0)!=(l|0)){if(o=e-l|0,i[n>>2]=i[n>>2]&-2,i[l+4>>2]=o|1,i[e>>2]=o,t=o>>>3,o>>>0<256){n=27964+(t<<1<<2)|0,e=i[6981]|0,t=1<>2]|0):(i[6981]=e|t,t=n,e=n+8|0),i[e>>2]=l,i[t+12>>2]=l,i[l+8>>2]=t,i[l+12>>2]=n;break}if(t=o>>>8,t?o>>>0>16777215?r=31:(b=(t+1048320|0)>>>16&8,x=t<>>16&4,x<<=y,r=(x+245760|0)>>>16&2,r=14-(y|b|r)+(x<>>15)|0,r=o>>>(r+7|0)&1|r<<1):r=0,n=28228+(r<<2)|0,i[l+28>>2]=r,i[l+20>>2]=0,i[a>>2]=0,t=i[6982]|0,e=1<>2]=l,i[l+24>>2]=n,i[l+12>>2]=l,i[l+8>>2]=l;break}t=i[n>>2]|0;j:do if((i[t+4>>2]&-8|0)!=(o|0)){for(r=o<<((r|0)==31?0:25-(r>>>1)|0);n=t+16+(r>>>31<<2)|0,e=i[n>>2]|0,e;)if((i[e+4>>2]&-8|0)==(o|0)){t=e;break j}else r<<=1,t=e;i[n>>2]=l,i[l+24>>2]=t,i[l+12>>2]=l,i[l+8>>2]=l;break f}while(0);b=t+8|0,x=i[b>>2]|0,i[x+12>>2]=l,i[b>>2]=l,i[l+8>>2]=x,i[l+12>>2]=t,i[l+24>>2]=0}}else x=i[6985]|0,(x|0)==0|o>>>0>>0&&(i[6985]=o),i[7093]=o,i[7094]=s,i[7096]=0,i[6990]=i[7099],i[6989]=-1,i[6994]=27964,i[6993]=27964,i[6996]=27972,i[6995]=27972,i[6998]=27980,i[6997]=27980,i[7e3]=27988,i[6999]=27988,i[7002]=27996,i[7001]=27996,i[7004]=28004,i[7003]=28004,i[7006]=28012,i[7005]=28012,i[7008]=28020,i[7007]=28020,i[7010]=28028,i[7009]=28028,i[7012]=28036,i[7011]=28036,i[7014]=28044,i[7013]=28044,i[7016]=28052,i[7015]=28052,i[7018]=28060,i[7017]=28060,i[7020]=28068,i[7019]=28068,i[7022]=28076,i[7021]=28076,i[7024]=28084,i[7023]=28084,i[7026]=28092,i[7025]=28092,i[7028]=28100,i[7027]=28100,i[7030]=28108,i[7029]=28108,i[7032]=28116,i[7031]=28116,i[7034]=28124,i[7033]=28124,i[7036]=28132,i[7035]=28132,i[7038]=28140,i[7037]=28140,i[7040]=28148,i[7039]=28148,i[7042]=28156,i[7041]=28156,i[7044]=28164,i[7043]=28164,i[7046]=28172,i[7045]=28172,i[7048]=28180,i[7047]=28180,i[7050]=28188,i[7049]=28188,i[7052]=28196,i[7051]=28196,i[7054]=28204,i[7053]=28204,i[7056]=28212,i[7055]=28212,x=s+-40|0,y=o+8|0,y=y&7|0?0-y&7:0,b=o+y|0,y=x-y|0,i[6987]=b,i[6984]=y,i[b+4>>2]=y|1,i[o+x+4>>2]=40,i[6988]=i[7103];while(0);if(t=i[6984]|0,t>>>0>f>>>0)return y=t-f|0,i[6984]=y,x=i[6987]|0,b=x+f|0,i[6987]=b,i[b+4>>2]=y|1,i[x+4>>2]=f|3,x=x+8|0,M=S,x|0}return x=wr()|0,i[x>>2]=12,x=0,M=S,x|0}function Dr(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,c=0,l=0;if(e){n=e+-8|0,a=i[6985]|0,e=i[e+-4>>2]|0,t=e&-8,l=n+t|0;do if(e&1)c=n,s=n;else{if(r=i[n>>2]|0,!(e&3)||(s=n+(0-r)|0,o=r+t|0,s>>>0>>0))return;if((i[6986]|0)==(s|0)){if(e=l+4|0,t=i[e>>2]|0,(t&3|0)!=3){c=s,t=o;break}i[6983]=o,i[e>>2]=t&-2,i[s+4>>2]=o|1,i[s+o>>2]=o;return}if(n=r>>>3,r>>>0<256)if(e=i[s+8>>2]|0,t=i[s+12>>2]|0,(t|0)==(e|0)){i[6981]&=~(1<>2]=t,i[t+8>>2]=e,c=s,t=o;break}a=i[s+24>>2]|0,e=i[s+12>>2]|0;do if((e|0)==(s|0)){if(t=s+16|0,n=t+4|0,e=i[n>>2]|0,e)t=n;else if(e=i[t>>2]|0,!e){e=0;break}for(;;)if(r=e+20|0,n=i[r>>2]|0,n)e=n,t=r;else if(r=e+16|0,n=i[r>>2]|0,n)e=n,t=r;else break;i[t>>2]=0}else c=i[s+8>>2]|0,i[c+12>>2]=e,i[e+8>>2]=c;while(0);if(a){if(t=i[s+28>>2]|0,n=28228+(t<<2)|0,(i[n>>2]|0)==(s|0)){if(i[n>>2]=e,!e){i[6982]&=~(1<>2]|0)==(s|0)?c:a+20|0)>>2]=e,!e){c=s,t=o;break}i[e+24>>2]=a,t=s+16|0,n=i[t>>2]|0,n|0&&(i[e+16>>2]=n,i[n+24>>2]=e),t=i[t+4>>2]|0,t?(i[e+20>>2]=t,i[t+24>>2]=e,c=s,t=o):(c=s,t=o)}else c=s,t=o}while(0);if(!(s>>>0>=l>>>0)&&(e=l+4|0,r=i[e>>2]|0,r&1)){if(r&2)i[e>>2]=r&-2,i[c+4>>2]=t|1,i[s+t>>2]=t,a=t;else{if((i[6987]|0)==(l|0)){if(l=(i[6984]|0)+t|0,i[6984]=l,i[6987]=c,i[c+4>>2]=l|1,(c|0)!=(i[6986]|0))return;i[6986]=0,i[6983]=0;return}if((i[6986]|0)==(l|0)){l=(i[6983]|0)+t|0,i[6983]=l,i[6986]=s,i[c+4>>2]=l|1,i[s+l>>2]=l;return}a=(r&-8)+t|0,n=r>>>3;do if(r>>>0<256)if(t=i[l+8>>2]|0,e=i[l+12>>2]|0,(e|0)==(t|0)){i[6981]&=~(1<>2]=e,i[e+8>>2]=t;break}else{o=i[l+24>>2]|0,e=i[l+12>>2]|0;do if((e|0)==(l|0)){if(t=l+16|0,n=t+4|0,e=i[n>>2]|0,e)t=n;else if(e=i[t>>2]|0,!e){n=0;break}for(;;)if(r=e+20|0,n=i[r>>2]|0,n)e=n,t=r;else if(r=e+16|0,n=i[r>>2]|0,n)e=n,t=r;else break;i[t>>2]=0,n=e}else n=i[l+8>>2]|0,i[n+12>>2]=e,i[e+8>>2]=n,n=e;while(0);if(o|0){if(e=i[l+28>>2]|0,t=28228+(e<<2)|0,(i[t>>2]|0)==(l|0)){if(i[t>>2]=n,!n){i[6982]&=~(1<>2]|0)==(l|0)?r:o+20|0)>>2]=n,!n)break;i[n+24>>2]=o,e=l+16|0,t=i[e>>2]|0,t|0&&(i[n+16>>2]=t,i[t+24>>2]=n),e=i[e+4>>2]|0,e|0&&(i[n+20>>2]=e,i[e+24>>2]=n)}}while(0);if(i[c+4>>2]=a|1,i[s+a>>2]=a,(c|0)==(i[6986]|0)){i[6983]=a;return}}if(e=a>>>3,a>>>0<256){n=27964+(e<<1<<2)|0,t=i[6981]|0,e=1<>2]|0):(i[6981]=t|e,e=n,t=n+8|0),i[t>>2]=c,i[e+12>>2]=c,i[c+8>>2]=e,i[c+12>>2]=n;return}e=a>>>8,e?a>>>0>16777215?r=31:(s=(e+1048320|0)>>>16&8,l=e<>>16&4,l<<=o,r=(l+245760|0)>>>16&2,r=14-(o|s|r)+(l<>>15)|0,r=a>>>(r+7|0)&1|r<<1):r=0,e=28228+(r<<2)|0,i[c+28>>2]=r,i[c+20>>2]=0,i[c+16>>2]=0,t=i[6982]|0,n=1<>2]=c,i[c+24>>2]=e,i[c+12>>2]=c,i[c+8>>2]=c;else{e=i[e>>2]|0;b:do if((i[e+4>>2]&-8|0)!=(a|0)){for(r=a<<((r|0)==31?0:25-(r>>>1)|0);n=e+16+(r>>>31<<2)|0,t=i[n>>2]|0,t;)if((i[t+4>>2]&-8|0)==(a|0)){e=t;break b}else r<<=1,e=t;i[n>>2]=c,i[c+24>>2]=e,i[c+12>>2]=c,i[c+8>>2]=c;break a}while(0);s=e+8|0,l=i[s>>2]|0,i[l+12>>2]=c,i[s>>2]=c,i[c+8>>2]=l,i[c+12>>2]=e,i[c+24>>2]=0}while(0);if(l=(i[6989]|0)+-1|0,i[6989]=l,!(l|0)){for(e=28380;e=i[e>>2]|0,e;)e=e+8|0;i[6989]=-1}}}}function Or(e,t){e|=0,t|=0;var n=0;return e?(n=b(t,e)|0,(t|e)>>>0>65535&&(n=((n>>>0)/(e>>>0)|0)==(t|0)?n:-1)):n=0,e=Er(n)|0,!e||!(i[e+-4>>2]&3)||Ur(e|0,0,n|0)|0,e|0}function K(e,t,n,r){return e|=0,t|=0,n|=0,r|=0,n=e+n>>>0,(w(t+r+(n>>>0>>0|0)>>>0|0),n|0)|0}function kr(e,t,n,r){return e|=0,t|=0,n|=0,r|=0,r=t-r-(n>>>0>e>>>0|0)>>>0,(w(r|0),e-n>>>0|0)|0}function Ar(e){return e|=0,(e?31-(C(e^e-1)|0)|0:32)|0}function jr(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0;if(d=e,l=t,u=l,s=n,p=r,c=p,!u)return o=(a|0)!=0,c?o?(i[a>>2]=e|0,i[a+4>>2]=t&0,p=0,a=0,(w(p|0),a)|0):(p=0,a=0,(w(p|0),a)|0):(o&&(i[a>>2]=(d>>>0)%(s>>>0),i[a+4>>2]=0),p=0,a=(d>>>0)/(s>>>0)>>>0,(w(p|0),a)|0);o=(c|0)==0;do if(s){if(!o){if(o=(C(c|0)|0)-(C(u|0)|0)|0,o>>>0<=31){f=o+1|0,c=31-o|0,t=o-31>>31,s=f,e=d>>>(f>>>0)&t|u<>>(f>>>0)&t,o=0,c=d<>2]=e|0,i[a+4>>2]=l|t&0,p=0,a=0,(w(p|0),a)|0):(p=0,a=0,(w(p|0),a)|0)}if(o=s-1|0,o&s|0){c=(C(s|0)|0)+33-(C(u|0)|0)|0,h=64-c|0,f=32-c|0,l=f>>31,m=c-32|0,t=m>>31,s=c,e=f-1>>31&u>>>(m>>>0)|(u<>>(c>>>0))&t,t&=u>>>(c>>>0),o=d<>>(m>>>0))&l|d<>31;break}return a|0&&(i[a>>2]=o&d,i[a+4>>2]=0),(s|0)==1?(m=l|t&0,h=e|0,(w(m|0),h)|0):(h=Ar(s|0)|0,m=u>>>(h>>>0)|0,h=u<<32-h|d>>>(h>>>0)|0,(w(m|0),h)|0)}else{if(o)return a|0&&(i[a>>2]=(u>>>0)%(s>>>0),i[a+4>>2]=0),m=0,h=(u>>>0)/(s>>>0)>>>0,(w(m|0),h)|0;if(!d)return a|0&&(i[a>>2]=0,i[a+4>>2]=(u>>>0)%(c>>>0)),m=0,h=(u>>>0)/(c>>>0)>>>0,(w(m|0),h)|0;if(o=c-1|0,!(o&c))return a|0&&(i[a>>2]=e|0,i[a+4>>2]=o&u|t&0),m=0,h=u>>>((Ar(c|0)|0)>>>0),(w(m|0),h)|0;if(o=(C(c|0)|0)-(C(u|0)|0)|0,o>>>0<=30){t=o+1|0,c=31-o|0,s=t,e=u<>>(t>>>0),t=u>>>(t>>>0),o=0,c=d<>2]=e|0,i[a+4>>2]=l|t&0,m=0,h=0,(w(m|0),h)|0):(m=0,h=0,(w(m|0),h)|0)}while(0);if(!s)u=c,l=0,c=0;else{f=n|0,d=p|r&0,u=K(f|0,d|0,-1,-1)|0,n=T()|0,l=c,c=0;do r=l,l=o>>>31|l<<1,o=c|o<<1,r=e<<1|r>>>31|0,p=e>>>31|t<<1|0,kr(u|0,n|0,r|0,p|0)|0,h=T()|0,m=h>>31|((h|0)<0?-1:0)<<1,c=m&1,e=kr(r|0,p|0,m&f|0,(((h|0)<0?-1:0)>>31|((h|0)<0?-1:0)<<1)&d|0)|0,t=T()|0,s=s-1|0;while(s|0);u=l,l=0}return s=0,a|0&&(i[a>>2]=e,i[a+4>>2]=t),m=(o|0)>>>31|(u|s)<<1|(s<<1|o>>>31)&0|l,h=(o<<1|0)&-2|c,(w(m|0),h)|0}function Mr(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var i=0,a=0,o=0,s=0,c=0,l=0;return l=t>>31|((t|0)<0?-1:0)<<1,c=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1,a=r>>31|((r|0)<0?-1:0)<<1,i=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1,s=kr(l^e|0,c^t|0,l|0,c|0)|0,o=T()|0,e=a^l,t=i^c,kr((jr(s,o,kr(a^n|0,i^r|0,a|0,i|0)|0,T()|0,0)|0)^e|0,(T()|0)^t|0,e|0,t|0)|0}function Nr(e,t){e|=0,t|=0;var n=0,r=0,i=0,a=0;return a=e&65535,i=t&65535,n=b(i,a)|0,r=e>>>16,e=(n>>>16)+(b(i,r)|0)|0,i=t>>>16,t=b(i,a)|0,(w((e>>>16)+(b(i,r)|0)+(((e&65535)+t|0)>>>16)|0),e+t<<16|n&65535|0)|0}function Pr(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var i=0,a=0;return i=e,a=n,n=Nr(i,a)|0,e=T()|0,(w((b(t,a)|0)+(b(r,i)|0)+e|e&0|0),n|0)|0}function Fr(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0,s=0,c=0,l=0,u=0;return a=M,M=M+16|0,c=a|0,s=t>>31|((t|0)<0?-1:0)<<1,o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1,u=r>>31|((r|0)<0?-1:0)<<1,l=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1,e=kr(s^e|0,o^t|0,s|0,o|0)|0,t=T()|0,jr(e,t,kr(u^n|0,l^r|0,u|0,l|0)|0,T()|0,c)|0,r=kr(i[c>>2]^s|0,i[c+4>>2]^o|0,s|0,o|0)|0,n=T()|0,M=a,(w(n|0),r)|0}function Ir(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var a=0,o=0;return o=M,M=M+16|0,a=o|0,jr(e,t,n,r,a)|0,M=o,(w(i[a+4>>2]|0),i[a>>2]|0)|0}function Lr(e,t,n){return e|=0,t|=0,n|=0,(n|0)<32?(w(t>>n|0),e>>>n|(t&(1<>n-32|0)}function q(e,t,n){return e|=0,t|=0,n|=0,(n|0)<32?(w(t>>>n|0),e>>>n|(t&(1<>>n-32|0)}function J(e,t,n){return e|=0,t|=0,n|=0,(n|0)<32?(w(t<>>32-n|0),e<=0?+c(e+.5):+y(e-.5)}function Hr(e,t,n){e|=0,t|=0,n|=0;var a=0,o=0,s=0;if((n|0)>=8192)return k(e|0,t|0,n|0)|0,e|0;if(s=e|0,o=e+n|0,(e&3)==(t&3)){for(;e&3;){if(!n)return s|0;r[e>>0]=r[t>>0]|0,e=e+1|0,t=t+1|0,n=n-1|0}for(n=o&-4|0,a=n-64|0;(e|0)<=(a|0);)i[e>>2]=i[t>>2],i[e+4>>2]=i[t+4>>2],i[e+8>>2]=i[t+8>>2],i[e+12>>2]=i[t+12>>2],i[e+16>>2]=i[t+16>>2],i[e+20>>2]=i[t+20>>2],i[e+24>>2]=i[t+24>>2],i[e+28>>2]=i[t+28>>2],i[e+32>>2]=i[t+32>>2],i[e+36>>2]=i[t+36>>2],i[e+40>>2]=i[t+40>>2],i[e+44>>2]=i[t+44>>2],i[e+48>>2]=i[t+48>>2],i[e+52>>2]=i[t+52>>2],i[e+56>>2]=i[t+56>>2],i[e+60>>2]=i[t+60>>2],e=e+64|0,t=t+64|0;for(;(e|0)<(n|0);)i[e>>2]=i[t>>2],e=e+4|0,t=t+4|0}else for(n=o-4|0;(e|0)<(n|0);)r[e>>0]=r[t>>0]|0,r[e+1>>0]=r[t+1>>0]|0,r[e+2>>0]=r[t+2>>0]|0,r[e+3>>0]=r[t+3>>0]|0,e=e+4|0,t=t+4|0;for(;(e|0)<(o|0);)r[e>>0]=r[t>>0]|0,e=e+1|0,t=t+1|0;return s|0}function Ur(e,t,n){e|=0,t|=0,n|=0;var a=0,o=0,s=0,c=0;if(s=e+n|0,t&=255,(n|0)>=67){for(;e&3;)r[e>>0]=t,e=e+1|0;for(a=s&-4|0,c=t|t<<8|t<<16|t<<24,o=a-64|0;(e|0)<=(o|0);)i[e>>2]=c,i[e+4>>2]=c,i[e+8>>2]=c,i[e+12>>2]=c,i[e+16>>2]=c,i[e+20>>2]=c,i[e+24>>2]=c,i[e+28>>2]=c,i[e+32>>2]=c,i[e+36>>2]=c,i[e+40>>2]=c,i[e+44>>2]=c,i[e+48>>2]=c,i[e+52>>2]=c,i[e+56>>2]=c,i[e+60>>2]=c,e=e+64|0;for(;(e|0)<(a|0);)i[e>>2]=c,e=e+4|0}for(;(e|0)<(s|0);)r[e>>0]=t,e=e+1|0;return s-n|0}function Wr(e){return e=+e,e>=0?+c(e+.5):+y(e-.5)}function Gr(e){e|=0;var t=0,n=0,r=0;return r=O()|0,n=i[s>>2]|0,t=n+e|0,(e|0)>0&(t|0)<(n|0)|(t|0)<0?(j(t|0)|0,D(12),-1):(t|0)>(r|0)&&!(A(t|0)|0)?(D(12),-1):(i[s>>2]=t,n|0)}return{___divdi3:Mr,___muldi3:Pr,___remdi3:Fr,___uremdi3:Ir,_areNeighborCells:tt,_bitshift64Ashr:Lr,_bitshift64Lshr:q,_bitshift64Shl:J,_calloc:Or,_cellAreaKm2:bn,_cellAreaM2:xn,_cellAreaRads2:yn,_cellToBoundary:Jt,_cellToCenterChild:Mt,_cellToChildPos:$t,_cellToChildren:At,_cellToChildrenSize:Ot,_cellToLatLng:qt,_cellToLocalIj:Mn,_cellToParent:Dt,_cellToVertex:pr,_cellToVertexes:mr,_cellsToDirectedEdge:nt,_cellsToLinkedMultiPolygon:me,_childPosToCell:en,_compactCells:Nt,_constructCell:Ct,_destroyLinkedMultiPolygon:Dn,_directedEdgeToBoundary:ct,_directedEdgeToCells:ot,_edgeLengthKm:Cn,_edgeLengthM:wn,_edgeLengthRads:Sn,_emscripten_replace_memory:N,_free:Dr,_getBaseCellNumber:xt,_getDirectedEdgeDestination:it,_getDirectedEdgeOrigin:rt,_getHexagonAreaAvgKm2:pn,_getHexagonAreaAvgM2:mn,_getHexagonEdgeLengthAvgKm:hn,_getHexagonEdgeLengthAvgM:gn,_getIcosahedronFaces:Xt,_getIndexDigit:St,_getNumCells:_n,_getPentagons:Qt,_getRes0Cells:be,_getResolution:bt,_greatCircleDistanceKm:ln,_greatCircleDistanceM:un,_greatCircleDistanceRads:cn,_gridDisk:ne,_gridDiskDistances:re,_gridDistance:Pn,_gridPathCells:In,_gridPathCellsSize:Fn,_gridRing:oe,_gridRingUnsafe:se,_i64Add:K,_i64Subtract:kr,_isPentagon:kt,_isResClassIII:It,_isValidCell:wt,_isValidDirectedEdge:at,_isValidIndex:Tt,_isValidVertex:gr,_latLngToCell:Wt,_llvm_ctlz_i64:Rr,_llvm_maxnum_f64:zr,_llvm_minnum_f64:Br,_llvm_round_f64:Vr,_localIjToCell:Nn,_malloc:Er,_maxFaceCount:Yt,_maxGridDiskSize:te,_maxPolygonToCellsSize:ue,_maxPolygonToCellsSizeExperimental:Un,_memcpy:Hr,_memset:Ur,_originToDirectedEdges:st,_pentagonCount:Zt,_polygonToCells:fe,_polygonToCellsExperimental:Hn,_readInt64AsDoubleFromPointer:ar,_res0CellCount:H,_round:Wr,_sbrk:Gr,_sizeOfCellBoundary:er,_sizeOfCoordIJ:ir,_sizeOfGeoLoop:tr,_sizeOfGeoPolygon:nr,_sizeOfH3Index:Qn,_sizeOfLatLng:$n,_sizeOfLinkedGeoPolygon:rr,_uncompactCells:Pt,_uncompactCellsSize:Ft,_vertexToLatLng:hr,establishStackSpace:I,stackAlloc:P,stackRestore:F,stackSave:ee}})({Math,Int8Array,Int32Array,Uint8Array,Float32Array,Float64Array},{a:Ge,b:d,c:f,d:Ee,e:ke,f:De,g:Oe,h:Me,i:Ae,j:Se,k:Ce,l:je,m:we,n:Te,o:xe,p:I},O);t.___divdi3=U.___divdi3,t.___muldi3=U.___muldi3,t.___remdi3=U.___remdi3,t.___uremdi3=U.___uremdi3,t._areNeighborCells=U._areNeighborCells,t._bitshift64Ashr=U._bitshift64Ashr,t._bitshift64Lshr=U._bitshift64Lshr,t._bitshift64Shl=U._bitshift64Shl,t._calloc=U._calloc,t._cellAreaKm2=U._cellAreaKm2,t._cellAreaM2=U._cellAreaM2,t._cellAreaRads2=U._cellAreaRads2,t._cellToBoundary=U._cellToBoundary,t._cellToCenterChild=U._cellToCenterChild,t._cellToChildPos=U._cellToChildPos,t._cellToChildren=U._cellToChildren,t._cellToChildrenSize=U._cellToChildrenSize,t._cellToLatLng=U._cellToLatLng,t._cellToLocalIj=U._cellToLocalIj,t._cellToParent=U._cellToParent,t._cellToVertex=U._cellToVertex,t._cellToVertexes=U._cellToVertexes,t._cellsToDirectedEdge=U._cellsToDirectedEdge,t._cellsToLinkedMultiPolygon=U._cellsToLinkedMultiPolygon,t._childPosToCell=U._childPosToCell,t._compactCells=U._compactCells,t._constructCell=U._constructCell,t._destroyLinkedMultiPolygon=U._destroyLinkedMultiPolygon,t._directedEdgeToBoundary=U._directedEdgeToBoundary,t._directedEdgeToCells=U._directedEdgeToCells,t._edgeLengthKm=U._edgeLengthKm,t._edgeLengthM=U._edgeLengthM,t._edgeLengthRads=U._edgeLengthRads;var Ie=t._emscripten_replace_memory=U._emscripten_replace_memory;t._free=U._free,t._getBaseCellNumber=U._getBaseCellNumber,t._getDirectedEdgeDestination=U._getDirectedEdgeDestination,t._getDirectedEdgeOrigin=U._getDirectedEdgeOrigin,t._getHexagonAreaAvgKm2=U._getHexagonAreaAvgKm2,t._getHexagonAreaAvgM2=U._getHexagonAreaAvgM2,t._getHexagonEdgeLengthAvgKm=U._getHexagonEdgeLengthAvgKm,t._getHexagonEdgeLengthAvgM=U._getHexagonEdgeLengthAvgM,t._getIcosahedronFaces=U._getIcosahedronFaces,t._getIndexDigit=U._getIndexDigit,t._getNumCells=U._getNumCells,t._getPentagons=U._getPentagons,t._getRes0Cells=U._getRes0Cells,t._getResolution=U._getResolution,t._greatCircleDistanceKm=U._greatCircleDistanceKm,t._greatCircleDistanceM=U._greatCircleDistanceM,t._greatCircleDistanceRads=U._greatCircleDistanceRads,t._gridDisk=U._gridDisk,t._gridDiskDistances=U._gridDiskDistances,t._gridDistance=U._gridDistance,t._gridPathCells=U._gridPathCells,t._gridPathCellsSize=U._gridPathCellsSize,t._gridRing=U._gridRing,t._gridRingUnsafe=U._gridRingUnsafe,t._i64Add=U._i64Add,t._i64Subtract=U._i64Subtract,t._isPentagon=U._isPentagon,t._isResClassIII=U._isResClassIII,t._isValidCell=U._isValidCell,t._isValidDirectedEdge=U._isValidDirectedEdge,t._isValidIndex=U._isValidIndex,t._isValidVertex=U._isValidVertex,t._latLngToCell=U._latLngToCell,t._llvm_ctlz_i64=U._llvm_ctlz_i64,t._llvm_maxnum_f64=U._llvm_maxnum_f64,t._llvm_minnum_f64=U._llvm_minnum_f64,t._llvm_round_f64=U._llvm_round_f64,t._localIjToCell=U._localIjToCell,t._malloc=U._malloc,t._maxFaceCount=U._maxFaceCount,t._maxGridDiskSize=U._maxGridDiskSize,t._maxPolygonToCellsSize=U._maxPolygonToCellsSize,t._maxPolygonToCellsSizeExperimental=U._maxPolygonToCellsSizeExperimental,t._memcpy=U._memcpy,t._memset=U._memset,t._originToDirectedEdges=U._originToDirectedEdges,t._pentagonCount=U._pentagonCount,t._polygonToCells=U._polygonToCells,t._polygonToCellsExperimental=U._polygonToCellsExperimental,t._readInt64AsDoubleFromPointer=U._readInt64AsDoubleFromPointer,t._res0CellCount=U._res0CellCount,t._round=U._round,t._sbrk=U._sbrk,t._sizeOfCellBoundary=U._sizeOfCellBoundary,t._sizeOfCoordIJ=U._sizeOfCoordIJ,t._sizeOfGeoLoop=U._sizeOfGeoLoop,t._sizeOfGeoPolygon=U._sizeOfGeoPolygon,t._sizeOfH3Index=U._sizeOfH3Index,t._sizeOfLatLng=U._sizeOfLatLng,t._sizeOfLinkedGeoPolygon=U._sizeOfLinkedGeoPolygon,t._uncompactCells=U._uncompactCells,t._uncompactCellsSize=U._uncompactCellsSize,t._vertexToLatLng=U._vertexToLatLng,t.establishStackSpace=U.establishStackSpace;var Le=t.stackAlloc=U.stackAlloc,Re=t.stackRestore=U.stackRestore,W=t.stackSave=U.stackSave;if(t.asm=U,t.cwrap=b,t.setValue=m,t.getValue=h,B){V(B)||(B=o(B)),_e(`memory initializer`);var ze=function(e){e.byteLength&&(e=new Uint8Array(e)),A.set(e,p),t.memoryInitializerRequest&&delete t.memoryInitializerRequest.response,ve(`memory initializer`)},Be=function(){s(B,ze,function(){throw`could not load memory initializer `+B})},Ve=Fe(B);if(Ve)ze(Ve.buffer);else if(t.memoryInitializerRequest){var He=function(){var e=t.memoryInitializerRequest,n=e.response;if(e.status!==200&&e.status!==0){var r=Fe(t.memoryInitializerRequestURL);if(r)n=r.buffer;else{console.warn(`a problem seems to have happened with Module.memoryInitializerRequest, status: `+e.status+`, retrying `+B),Be();return}}ze(n)};t.memoryInitializerRequest.response?setTimeout(He,0):t.memoryInitializerRequest.addEventListener(`load`,He)}else Be()}var Ue;ge=function e(){Ue||We(),Ue||(ge=e)};function We(e){if(e||=i,z>0||(oe(),z>0))return;function n(){Ue||(Ue=!0,!g&&(se(),ce(),t.onRuntimeInitialized&&t.onRuntimeInitialized(),le()))}t.setStatus?(t.setStatus(`Running...`),setTimeout(function(){setTimeout(function(){t.setStatus(``)},1),n()},1)):n()}t.run=We;function Ge(e){throw t.onAbort&&t.onAbort(e),e+=``,c(e),l(e),g=!0,`abort(`+e+`). Build with -s ASSERTIONS=1 for more info.`}if(t.abort=Ge,t.preInit)for(typeof t.preInit==`function`&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return We(),e}(typeof eU==`object`?eU:{}),tU=`number`,nU=tU,rU=tU,iU=tU,aU=tU,oU=tU,sU=tU,cU=[[`sizeOfH3Index`,tU],[`sizeOfLatLng`,tU],[`sizeOfCellBoundary`,tU],[`sizeOfGeoLoop`,tU],[`sizeOfGeoPolygon`,tU],[`sizeOfLinkedGeoPolygon`,tU],[`sizeOfCoordIJ`,tU],[`readInt64AsDoubleFromPointer`,tU],[`isValidCell`,rU,[iU,aU]],[`isValidIndex`,rU,[iU,aU]],[`latLngToCell`,nU,[tU,tU,oU,sU]],[`cellToLatLng`,nU,[iU,aU,sU]],[`cellToBoundary`,nU,[iU,aU,sU]],[`maxGridDiskSize`,nU,[tU,sU]],[`gridDisk`,nU,[iU,aU,tU,sU]],[`gridDiskDistances`,nU,[iU,aU,tU,sU,sU]],[`gridRing`,nU,[iU,aU,tU,sU]],[`gridRingUnsafe`,nU,[iU,aU,tU,sU]],[`maxPolygonToCellsSize`,nU,[sU,oU,tU,sU]],[`polygonToCells`,nU,[sU,oU,tU,sU]],[`maxPolygonToCellsSizeExperimental`,nU,[sU,oU,tU,sU]],[`polygonToCellsExperimental`,nU,[sU,oU,tU,tU,tU,sU]],[`cellsToLinkedMultiPolygon`,nU,[sU,tU,sU]],[`destroyLinkedMultiPolygon`,null,[sU]],[`compactCells`,nU,[sU,sU,tU,tU]],[`uncompactCells`,nU,[sU,tU,tU,sU,tU,oU]],[`uncompactCellsSize`,nU,[sU,tU,tU,oU,sU]],[`isPentagon`,rU,[iU,aU]],[`isResClassIII`,rU,[iU,aU]],[`getBaseCellNumber`,tU,[iU,aU]],[`getResolution`,tU,[iU,aU]],[`getIndexDigit`,tU,[iU,aU,tU]],[`constructCell`,nU,[tU,tU,sU,sU]],[`maxFaceCount`,nU,[iU,aU,sU]],[`getIcosahedronFaces`,nU,[iU,aU,sU]],[`cellToParent`,nU,[iU,aU,oU,sU]],[`cellToChildren`,nU,[iU,aU,oU,sU]],[`cellToCenterChild`,nU,[iU,aU,oU,sU]],[`cellToChildrenSize`,nU,[iU,aU,oU,sU]],[`cellToChildPos`,nU,[iU,aU,oU,sU]],[`childPosToCell`,nU,[tU,tU,iU,aU,oU,sU]],[`areNeighborCells`,nU,[iU,aU,iU,aU,sU]],[`cellsToDirectedEdge`,nU,[iU,aU,iU,aU,sU]],[`getDirectedEdgeOrigin`,nU,[iU,aU,sU]],[`getDirectedEdgeDestination`,nU,[iU,aU,sU]],[`isValidDirectedEdge`,rU,[iU,aU]],[`directedEdgeToCells`,nU,[iU,aU,sU]],[`originToDirectedEdges`,nU,[iU,aU,sU]],[`directedEdgeToBoundary`,nU,[iU,aU,sU]],[`gridDistance`,nU,[iU,aU,iU,aU,sU]],[`gridPathCells`,nU,[iU,aU,iU,aU,sU]],[`gridPathCellsSize`,nU,[iU,aU,iU,aU,sU]],[`cellToLocalIj`,nU,[iU,aU,iU,aU,tU,sU]],[`localIjToCell`,nU,[iU,aU,sU,tU,sU]],[`getHexagonAreaAvgM2`,nU,[oU,sU]],[`getHexagonAreaAvgKm2`,nU,[oU,sU]],[`getHexagonEdgeLengthAvgM`,nU,[oU,sU]],[`getHexagonEdgeLengthAvgKm`,nU,[oU,sU]],[`greatCircleDistanceM`,tU,[sU,sU]],[`greatCircleDistanceKm`,tU,[sU,sU]],[`greatCircleDistanceRads`,tU,[sU,sU]],[`cellAreaM2`,nU,[iU,aU,sU]],[`cellAreaKm2`,nU,[iU,aU,sU]],[`cellAreaRads2`,nU,[iU,aU,sU]],[`edgeLengthM`,nU,[iU,aU,sU]],[`edgeLengthKm`,nU,[iU,aU,sU]],[`edgeLengthRads`,nU,[iU,aU,sU]],[`getNumCells`,nU,[oU,sU]],[`getRes0Cells`,nU,[sU]],[`res0CellCount`,tU],[`getPentagons`,nU,[tU,sU]],[`pentagonCount`,tU],[`cellToVertex`,nU,[iU,aU,tU,sU]],[`cellToVertexes`,nU,[iU,aU,sU]],[`vertexToLatLng`,nU,[iU,aU,sU]],[`isValidVertex`,rU,[iU,aU]]],lU=0,uU=1,dU=2,fU=3,pU=4,mU=5,hU=6,gU=7,_U=8,vU=9,yU=10,bU=11,xU=12,SU=13,CU=14,wU=15,TU=16,EU=17,DU=18,OU=19,kU={};kU[lU]=`Success`,kU[uU]=`The operation failed but a more specific error is not available`,kU[dU]=`Argument was outside of acceptable range`,kU[fU]=`Latitude or longitude arguments were outside of acceptable range`,kU[pU]=`Resolution argument was outside of acceptable range`,kU[mU]=`Cell argument was not valid`,kU[hU]=`Directed edge argument was not valid`,kU[gU]=`Undirected edge argument was not valid`,kU[_U]=`Vertex argument was not valid`,kU[vU]=`Pentagon distortion was encountered`,kU[yU]=`Duplicate input`,kU[bU]=`Cell arguments were not neighbors`,kU[xU]=`Cell arguments had incompatible resolutions`,kU[SU]=`Memory allocation failed`,kU[CU]=`Bounds of provided memory were insufficient`,kU[wU]=`Mode or flags argument was not valid`,kU[TU]=`Index argument was not valid`,kU[EU]=`Base cell number was outside of acceptable range`,kU[DU]=`Child indexing digits invalid`,kU[OU]=`Child indexing digits refer to a deleted subsequence`;var AU=1e3,jU=1001,MU=1002,NU={};NU[AU]=`Unknown unit`,NU[jU]=`Array length out of bounds`,NU[MU]=`Got unexpected null value for H3 index`;var PU=`Unknown error`;function FU(e,t,n){var r=n&&`value`in n,i=Error((e[t]||PU)+` (code: `+t+(r?`, value: `+n.value:``)+`)`);return i.code=t,i}function IU(e,t){return FU(kU,e,arguments.length===2?{value:t}:{})}function LU(e,t){return FU(NU,e,arguments.length===2?{value:t}:{})}function RU(e){if(e!==0)throw IU(e)}var zU={};cU.forEach(function(e){zU[e[0]]=eU.cwrap.apply(eU,e)});var BU=16,VU=4,HU=4,UU=8,WU=8,GU=zU.sizeOfH3Index(),KU=zU.sizeOfLatLng(),qU=zU.sizeOfCellBoundary(),JU=zU.sizeOfGeoPolygon(),YU=zU.sizeOfGeoLoop(),XU=zU.sizeOfLinkedGeoPolygon();zU.sizeOfCoordIJ();var ZU={m:`m`,m2:`m2`,km:`km`,km2:`km2`,rads:`rads`,rads2:`rads2`};function QU(e){if(typeof e!=`number`||e<0||e>15||Math.floor(e)!==e)throw IU(pU,e);return e}function $U(e){if(!e)throw LU(MU);return e}var eW=2**32-1;function tW(e){if(e>eW)throw LU(jU,e);return e}var nW=/[^0-9a-fA-F]/;function rW(e){if(Array.isArray(e)&&e.length===2&&Number.isInteger(e[0])&&Number.isInteger(e[1]))return e;if(typeof e!=`string`||nW.test(e))return[0,0];var t=parseInt(e.substring(0,e.length-8),BU);return[parseInt(e.substring(e.length-8),BU),t]}function iW(e){if(e>=0)return e.toString(BU);e&=2147483647;var t=oW(8,e.toString(BU));return t=(parseInt(t[0],BU)+8).toString(BU)+t.substring(1),t}function aW(e,t){return iW(t)+oW(8,iW(e))}function oW(e,t){for(var n=e-t.length,r=``,i=0;i0){s=eU._calloc(n,YU);for(var c=0;c0){for(var o=eU.getValue(e+r,`i32`),s=0;s180?n[0]-=360:e<-180&&(n[0]+=360)}}function RW(e,t,n){let[r,i]=wW(e),a=t.length;LW(t,i);let o=t[0]===t[a-1]?a-1:a;for(let e=0;ee.pentagon}},UW=class extends cL{indexToBounds(){let{data:e,getPentagon:t}=this.props;return{data:e,_normalize:!1,_windingOrder:`CCW`,positionFormat:`XY`,getPolygon:(e,n)=>{let r=t(e,n);return VW(YH(typeof r==`string`?XH(r):r,{closedRing:!0,segments:`auto`}))}}}};UW.layerName=`A5Layer`,UW.defaultProps=HW;function WW(e){return typeof e==`string`?e.charAt(0).toLowerCase()+e.slice(1):e}function GW(e){if(Array.isArray(e))return e.map(e=>GW(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[WW(n)]=GW(r);return t}return e}var KW=RegExp(`^[:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`);function qW(e,t){let n=[],r=t.exec(e);for(;r;){let i=[];i.startIndex=t.lastIndex-r[0].length;let a=r.length;for(let e=0;e`&&e[a]!==` `&&e[a]!==` `&&e[a]!==` +`&&e[a]!==`\r`;a++)c+=e[a];if(c=c.trim(),c[c.length-1]===`/`&&(c=c.substring(0,c.length-1),a--),!fG(c)){let t;return t=c.trim().length===0?`Invalid space after '<'.`:`Tag '`+c+`' is an invalid name.`,uG(`InvalidTag`,t,pG(e,a))}let l=aG(e,a);if(l===!1)return uG(`InvalidAttr`,`Attributes for '`+c+`' have open quote.`,pG(e,a));let u=l.value;if(a=l.index,u[u.length-1]===`/`){let n=a-u.length;u=u.substring(0,u.length-1);let i=sG(u,t);if(i===!0)r=!0;else return uG(i.err.code,i.err.msg,pG(e,n+i.err.line))}else if(s){if(!l.tagClosed)return uG(`InvalidTag`,`Closing tag '`+c+`' doesn't have proper closing.`,pG(e,a));if(u.trim().length>0)return uG(`InvalidTag`,`Closing tag '`+c+`' can't have attributes or invalid starting.`,pG(e,o));if(n.length===0)return uG(`InvalidTag`,`Closing tag '`+c+`' has not been opened.`,pG(e,o));{let t=n.pop();if(c!==t.tagName){let n=pG(e,t.tagStartPos);return uG(`InvalidTag`,`Expected closing tag '`+t.tagName+`' (opened in line `+n.line+`, col `+n.col+`) instead of closing tag '`+c+`'.`,pG(e,o))}n.length==0&&(i=!0)}}else{let s=sG(u,t);if(s!==!0)return uG(s.err.code,s.err.msg,pG(e,a-u.length+s.err.line));if(i===!0)return uG(`InvalidXml`,`Multiple possible root nodes found.`,pG(e,a));t.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:o}),r=!0}for(a++;a0?uG(`InvalidXml`,`Invalid '`+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,``)+`' found.`,{line:1,col:1}):!0:uG(`InvalidXml`,`Start tag expected.`,1)}function eG(e){return e===` `||e===` `||e===` +`||e===`\r`}function tG(e,t){let n=t;for(;t5&&r===`xml`)return uG(`InvalidXml`,`XML declaration allowed only at the start of the document.`,pG(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}else continue}return t}function nG(e,t){if(e.length>t+5&&e[t+1]===`-`&&e[t+2]===`-`){for(t+=3;t`){t+=2;break}}else if(e.length>t+8&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t`){t+=2;break}}return t}var rG=`"`,iG=`'`;function aG(e,t){let n=``,r=``,i=!1;for(;t`&&r===``){i=!0;break}n+=e[t]}return r===``&&{value:n,index:t,tagClosed:i}}var oG=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function sG(e,t){let n=qW(e,oG),r={};for(let e=0;e`,GT:`>`,quot:`"`,QUOT:`"`,apos:`'`,lsquo:`‘`,rsquo:`’`,ldquo:`“`,rdquo:`”`,lsquor:`‚`,rsquor:`’`,ldquor:`„`,bdquo:`„`,comma:`,`,period:`.`,colon:`:`,semi:`;`,excl:`!`,quest:`?`,num:`#`,dollar:`$`,percent:`%`,amp:`&`,ast:`*`,commat:`@`,lowbar:`_`,verbar:`|`,vert:`|`,sol:`/`,bsol:`\\`,lbrace:`{`,rbrace:`}`,lbrack:`[`,rbrack:`]`,lpar:`(`,rpar:`)`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,COPY:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,REG:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,half:`½`,frac34:`¾`,iquest:`¿`,times:`×`,div:`÷`,divide:`÷`},gG={Agrave:`À`,agrave:`à`,Aacute:`Á`,aacute:`á`,Acirc:`Â`,acirc:`â`,Atilde:`Ã`,atilde:`ã`,Auml:`Ä`,auml:`ä`,Aring:`Å`,aring:`å`,AElig:`Æ`,aelig:`æ`,Ccedil:`Ç`,ccedil:`ç`,Egrave:`È`,egrave:`è`,Eacute:`É`,eacute:`é`,Ecirc:`Ê`,ecirc:`ê`,Euml:`Ë`,euml:`ë`,Igrave:`Ì`,igrave:`ì`,Iacute:`Í`,iacute:`í`,Icirc:`Î`,icirc:`î`,Iuml:`Ï`,iuml:`ï`,ETH:`Ð`,eth:`ð`,Ntilde:`Ñ`,ntilde:`ñ`,Ograve:`Ò`,ograve:`ò`,Oacute:`Ó`,oacute:`ó`,Ocirc:`Ô`,ocirc:`ô`,Otilde:`Õ`,otilde:`õ`,Ouml:`Ö`,ouml:`ö`,Oslash:`Ø`,oslash:`ø`,Ugrave:`Ù`,ugrave:`ù`,Uacute:`Ú`,uacute:`ú`,Ucirc:`Û`,ucirc:`û`,Uuml:`Ü`,uuml:`ü`,Yacute:`Ý`,yacute:`ý`,THORN:`Þ`,thorn:`þ`,szlig:`ß`,yuml:`ÿ`,Yuml:`Ÿ`},_G={Amacr:`Ā`,amacr:`ā`,Abreve:`Ă`,abreve:`ă`,Aogon:`Ą`,aogon:`ą`,Cacute:`Ć`,cacute:`ć`,Ccirc:`Ĉ`,ccirc:`ĉ`,Cdot:`Ċ`,cdot:`ċ`,Ccaron:`Č`,ccaron:`č`,Dcaron:`Ď`,dcaron:`ď`,Dstrok:`Đ`,dstrok:`đ`,Emacr:`Ē`,emacr:`ē`,Ecaron:`Ě`,ecaron:`ě`,Edot:`Ė`,edot:`ė`,Eogon:`Ę`,eogon:`ę`,Gcirc:`Ĝ`,gcirc:`ĝ`,Gbreve:`Ğ`,gbreve:`ğ`,Gdot:`Ġ`,gdot:`ġ`,Gcedil:`Ģ`,Hcirc:`Ĥ`,hcirc:`ĥ`,Hstrok:`Ħ`,hstrok:`ħ`,Itilde:`Ĩ`,itilde:`ĩ`,Imacr:`Ī`,imacr:`ī`,Iogon:`Į`,iogon:`į`,Idot:`İ`,IJlig:`IJ`,ijlig:`ij`,Jcirc:`Ĵ`,jcirc:`ĵ`,Kcedil:`Ķ`,kcedil:`ķ`,kgreen:`ĸ`,Lacute:`Ĺ`,lacute:`ĺ`,Lcedil:`Ļ`,lcedil:`ļ`,Lcaron:`Ľ`,lcaron:`ľ`,Lmidot:`Ŀ`,lmidot:`ŀ`,Lstrok:`Ł`,lstrok:`ł`,Nacute:`Ń`,nacute:`ń`,Ncaron:`Ň`,ncaron:`ň`,Ncedil:`Ņ`,ncedil:`ņ`,ENG:`Ŋ`,eng:`ŋ`,Omacr:`Ō`,omacr:`ō`,Odblac:`Ő`,odblac:`ő`,OElig:`Œ`,oelig:`œ`,Racute:`Ŕ`,racute:`ŕ`,Rcaron:`Ř`,rcaron:`ř`,Rcedil:`Ŗ`,rcedil:`ŗ`,Sacute:`Ś`,sacute:`ś`,Scirc:`Ŝ`,scirc:`ŝ`,Scedil:`Ş`,scedil:`ş`,Scaron:`Š`,scaron:`š`,Tcedil:`Ţ`,tcedil:`ţ`,Tcaron:`Ť`,tcaron:`ť`,Tstrok:`Ŧ`,tstrok:`ŧ`,Utilde:`Ũ`,utilde:`ũ`,Umacr:`Ū`,umacr:`ū`,Ubreve:`Ŭ`,ubreve:`ŭ`,Uring:`Ů`,uring:`ů`,Udblac:`Ű`,udblac:`ű`,Uogon:`Ų`,uogon:`ų`,Wcirc:`Ŵ`,wcirc:`ŵ`,Ycirc:`Ŷ`,ycirc:`ŷ`,Zacute:`Ź`,zacute:`ź`,Zdot:`Ż`,zdot:`ż`,Zcaron:`Ž`,zcaron:`ž`},vG={Alpha:`Α`,alpha:`α`,Beta:`Β`,beta:`β`,Gamma:`Γ`,gamma:`γ`,Delta:`Δ`,delta:`δ`,Epsilon:`Ε`,epsilon:`ε`,epsiv:`ϵ`,varepsilon:`ϵ`,Zeta:`Ζ`,zeta:`ζ`,Eta:`Η`,eta:`η`,Theta:`Θ`,theta:`θ`,thetasym:`ϑ`,vartheta:`ϑ`,Iota:`Ι`,iota:`ι`,Kappa:`Κ`,kappa:`κ`,kappav:`ϰ`,varkappa:`ϰ`,Lambda:`Λ`,lambda:`λ`,Mu:`Μ`,mu:`μ`,Nu:`Ν`,nu:`ν`,Xi:`Ξ`,xi:`ξ`,Omicron:`Ο`,omicron:`ο`,Pi:`Π`,pi:`π`,piv:`ϖ`,varpi:`ϖ`,Rho:`Ρ`,rho:`ρ`,rhov:`ϱ`,varrho:`ϱ`,Sigma:`Σ`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,varsigma:`ς`,Tau:`Τ`,tau:`τ`,Upsilon:`Υ`,upsilon:`υ`,upsi:`υ`,Upsi:`ϒ`,upsih:`ϒ`,Phi:`Φ`,phi:`φ`,phiv:`ϕ`,varphi:`ϕ`,Chi:`Χ`,chi:`χ`,Psi:`Ψ`,psi:`ψ`,Omega:`Ω`,omega:`ω`,ohm:`Ω`,Gammad:`Ϝ`,gammad:`ϝ`,digamma:`ϝ`},yG={Afr:`𝔄`,afr:`𝔞`,Acy:`А`,acy:`а`,Bcy:`Б`,bcy:`б`,Vcy:`В`,vcy:`в`,Gcy:`Г`,gcy:`г`,Dcy:`Д`,dcy:`д`,IEcy:`Е`,iecy:`е`,IOcy:`Ё`,iocy:`ё`,ZHcy:`Ж`,zhcy:`ж`,Zcy:`З`,zcy:`з`,Icy:`И`,icy:`и`,Jcy:`Й`,jcy:`й`,Kcy:`К`,kcy:`к`,Lcy:`Л`,lcy:`л`,Mcy:`М`,mcy:`м`,Ncy:`Н`,ncy:`н`,Ocy:`О`,ocy:`о`,Pcy:`П`,pcy:`п`,Rcy:`Р`,rcy:`р`,Scy:`С`,scy:`с`,Tcy:`Т`,tcy:`т`,Ucy:`У`,ucy:`у`,Fcy:`Ф`,fcy:`ф`,KHcy:`Х`,khcy:`х`,TScy:`Ц`,tscy:`ц`,CHcy:`Ч`,chcy:`ч`,SHcy:`Ш`,shcy:`ш`,SHCHcy:`Щ`,shchcy:`щ`,HARDcy:`Ъ`,hardcy:`ъ`,Ycy:`Ы`,ycy:`ы`,SOFTcy:`Ь`,softcy:`ь`,Ecy:`Э`,ecy:`э`,YUcy:`Ю`,yucy:`ю`,YAcy:`Я`,yacy:`я`,DJcy:`Ђ`,djcy:`ђ`,GJcy:`Ѓ`,gjcy:`ѓ`,Jukcy:`Є`,jukcy:`є`,DScy:`Ѕ`,dscy:`ѕ`,Iukcy:`І`,iukcy:`і`,YIcy:`Ї`,yicy:`ї`,Jsercy:`Ј`,jsercy:`ј`,LJcy:`Љ`,ljcy:`љ`,NJcy:`Њ`,njcy:`њ`,TSHcy:`Ћ`,tshcy:`ћ`,KJcy:`Ќ`,kjcy:`ќ`,Ubrcy:`Ў`,ubrcy:`ў`,DZcy:`Џ`,dzcy:`џ`},bG={plus:`+`,minus:`−`,mnplus:`∓`,mp:`∓`,pm:`±`,times:`×`,div:`÷`,divide:`÷`,sdot:`⋅`,star:`☆`,starf:`★`,bigstar:`★`,lowast:`∗`,ast:`*`,midast:`*`,compfn:`∘`,smallcircle:`∘`,bullet:`•`,bull:`•`,nbsp:`\xA0`,hellip:`…`,mldr:`…`,prime:`′`,Prime:`″`,tprime:`‴`,bprime:`‵`,backprime:`‵`,minus:`−`,minusd:`∸`,dotminus:`∸`,plusdo:`∔`,dotplus:`∔`,plusmn:`±`,minusplus:`∓`,mnplus:`∓`,mp:`∓`,setminus:`∖`,smallsetminus:`∖`,Backslash:`∖`,setmn:`∖`,ssetmn:`∖`,lowbar:`_`,verbar:`|`,vert:`|`,VerticalLine:`|`,colon:`:`,Colon:`∷`,Proportion:`∷`,ratio:`∶`,equals:`=`,ne:`≠`,nequiv:`≢`,equiv:`≡`,Congruent:`≡`,sim:`∼`,thicksim:`∼`,thksim:`∼`,sime:`≃`,simeq:`≃`,TildeEqual:`≃`,asymp:`≈`,approx:`≈`,thickapprox:`≈`,thkap:`≈`,TildeTilde:`≈`,ncong:`≇`,cong:`≅`,TildeFullEqual:`≅`,asympeq:`≍`,CupCap:`≍`,bump:`≎`,Bumpeq:`≎`,HumpDownHump:`≎`,bumpe:`≏`,bumpeq:`≏`,HumpEqual:`≏`,dotminus:`∸`,minusd:`∸`,plusdo:`∔`,dotplus:`∔`,le:`≤`,LessEqual:`≤`,ge:`≥`,GreaterEqual:`≥`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,greater:`>`,less:`<`},xG={alefsym:`ℵ`,aleph:`ℵ`,beth:`ℶ`,gimel:`ℷ`,daleth:`ℸ`,forall:`∀`,ForAll:`∀`,part:`∂`,PartialD:`∂`,exist:`∃`,Exists:`∃`,nexist:`∄`,nexists:`∄`,empty:`∅`,emptyset:`∅`,emptyv:`∅`,varnothing:`∅`,nabla:`∇`,Del:`∇`,isin:`∈`,isinv:`∈`,in:`∈`,Element:`∈`,notin:`∉`,notinva:`∉`,ni:`∋`,niv:`∋`,SuchThat:`∋`,ReverseElement:`∋`,notni:`∌`,notniva:`∌`,prod:`∏`,Product:`∏`,coprod:`∐`,Coproduct:`∐`,sum:`∑`,Sum:`∑`,minus:`−`,mp:`∓`,plusdo:`∔`,dotplus:`∔`,setminus:`∖`,lowast:`∗`,radic:`√`,Sqrt:`√`,prop:`∝`,propto:`∝`,Proportional:`∝`,varpropto:`∝`,infin:`∞`,infintie:`⧝`,ang:`∠`,angle:`∠`,angmsd:`∡`,measuredangle:`∡`,angsph:`∢`,mid:`∣`,VerticalBar:`∣`,nmid:`∤`,nsmid:`∤`,npar:`∦`,parallel:`∥`,spar:`∥`,nparallel:`∦`,nspar:`∦`,and:`∧`,wedge:`∧`,or:`∨`,vee:`∨`,cap:`∩`,cup:`∪`,int:`∫`,Integral:`∫`,conint:`∮`,ContourIntegral:`∮`,Conint:`∯`,DoubleContourIntegral:`∯`,Cconint:`∰`,there4:`∴`,therefore:`∴`,Therefore:`∴`,becaus:`∵`,because:`∵`,Because:`∵`,ratio:`∶`,Proportion:`∷`,minusd:`∸`,dotminus:`∸`,mDDot:`∺`,homtht:`∻`,sim:`∼`,bsimg:`∽`,backsim:`∽`,ac:`∾`,mstpos:`∾`,acd:`∿`,VerticalTilde:`≀`,wr:`≀`,wreath:`≀`,nsime:`≄`,nsimeq:`≄`,nsimeq:`≄`,ncong:`≇`,simne:`≆`,ncongdot:`⩭̸`,ngsim:`≵`,nsim:`≁`,napprox:`≉`,nap:`≉`,ngeq:`≱`,nge:`≱`,nleq:`≰`,nle:`≰`,ngtr:`≯`,ngt:`≯`,nless:`≮`,nlt:`≮`,nprec:`⊀`,npr:`⊀`,nsucc:`⊁`,nsc:`⊁`},SG={larr:`←`,leftarrow:`←`,LeftArrow:`←`,uarr:`↑`,uparrow:`↑`,UpArrow:`↑`,rarr:`→`,rightarrow:`→`,RightArrow:`→`,darr:`↓`,downarrow:`↓`,DownArrow:`↓`,harr:`↔`,leftrightarrow:`↔`,LeftRightArrow:`↔`,varr:`↕`,updownarrow:`↕`,UpDownArrow:`↕`,nwarr:`↖`,nwarrow:`↖`,UpperLeftArrow:`↖`,nearr:`↗`,nearrow:`↗`,UpperRightArrow:`↗`,searr:`↘`,searrow:`↘`,LowerRightArrow:`↘`,swarr:`↙`,swarrow:`↙`,LowerLeftArrow:`↙`,lArr:`⇐`,Leftarrow:`⇐`,uArr:`⇑`,Uparrow:`⇑`,rArr:`⇒`,Rightarrow:`⇒`,dArr:`⇓`,Downarrow:`⇓`,hArr:`⇔`,Leftrightarrow:`⇔`,iff:`⇔`,vArr:`⇕`,Updownarrow:`⇕`,lAarr:`⇚`,Lleftarrow:`⇚`,rAarr:`⇛`,Rrightarrow:`⇛`,lrarr:`⇆`,leftrightarrows:`⇆`,rlarr:`⇄`,rightleftarrows:`⇄`,lrhar:`⇋`,leftrightharpoons:`⇋`,ReverseEquilibrium:`⇋`,rlhar:`⇌`,rightleftharpoons:`⇌`,Equilibrium:`⇌`,udarr:`⇅`,UpArrowDownArrow:`⇅`,duarr:`⇵`,DownArrowUpArrow:`⇵`,llarr:`⇇`,leftleftarrows:`⇇`,rrarr:`⇉`,rightrightarrows:`⇉`,ddarr:`⇊`,downdownarrows:`⇊`,har:`↽`,lhard:`↽`,leftharpoondown:`↽`,lharu:`↼`,leftharpoonup:`↼`,rhard:`⇁`,rightharpoondown:`⇁`,rharu:`⇀`,rightharpoonup:`⇀`,lsh:`↰`,Lsh:`↰`,rsh:`↱`,Rsh:`↱`,ldsh:`↲`,rdsh:`↳`,hookleftarrow:`↩`,hookrightarrow:`↪`,mapstoleft:`↤`,mapstoup:`↥`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,crarr:`↵`,nwarrow:`↖`,nearrow:`↗`,searrow:`↘`,swarrow:`↙`,nleftarrow:`↚`,nleftrightarrow:`↮`,nrightarrow:`↛`,nrarr:`↛`,larrtl:`↢`,rarrtl:`↣`,leftarrowtail:`↢`,rightarrowtail:`↣`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,Larr:`↞`,Rarr:`↠`,larrhk:`↩`,rarrhk:`↪`,larrlp:`↫`,looparrowleft:`↫`,rarrlp:`↬`,looparrowright:`↬`,harrw:`↭`,leftrightsquigarrow:`↭`,nrarrw:`↝̸`,rarrw:`↝`,rightsquigarrow:`↝`,larrbfs:`⤟`,rarrbfs:`⤠`,nvHarr:`⤄`,nvlArr:`⤂`,nvrArr:`⤃`,larrfs:`⤝`,rarrfs:`⤞`,Map:`⤅`,larrsim:`⥳`,rarrsim:`⥴`,harrcir:`⥈`,Uarrocir:`⥉`,lurdshar:`⥊`,ldrdhar:`⥧`,ldrushar:`⥋`,rdldhar:`⥩`,lrhard:`⥭`,rlhar:`⇌`,uharr:`↾`,uharl:`↿`,dharr:`⇂`,dharl:`⇃`,Uarr:`↟`,Darr:`↡`,zigrarr:`⇝`,nwArr:`⇖`,neArr:`⇗`,seArr:`⇘`,swArr:`⇙`,nharr:`↮`,nhArr:`⇎`,nlarr:`↚`,nlArr:`⇍`,nrarr:`↛`,nrArr:`⇏`,larrb:`⇤`,LeftArrowBar:`⇤`,rarrb:`⇥`,RightArrowBar:`⇥`},CG={square:`□`,Square:`□`,squ:`□`,squf:`▪`,squarf:`▪`,blacksquar:`▪`,blacksquare:`▪`,FilledVerySmallSquare:`▪`,blk34:`▓`,blk12:`▒`,blk14:`░`,block:`█`,srect:`▭`,rect:`▭`,sdot:`⋅`,sdotb:`⊡`,dotsquare:`⊡`,triangle:`▵`,tri:`▵`,trine:`▵`,utri:`▵`,triangledown:`▿`,dtri:`▿`,tridown:`▿`,triangleleft:`◃`,ltri:`◃`,triangleright:`▹`,rtri:`▹`,blacktriangle:`▴`,utrif:`▴`,blacktriangledown:`▾`,dtrif:`▾`,blacktriangleleft:`◂`,ltrif:`◂`,blacktriangleright:`▸`,rtrif:`▸`,loz:`◊`,lozenge:`◊`,blacklozenge:`⧫`,lozf:`⧫`,bigcirc:`◯`,xcirc:`◯`,circ:`ˆ`,Circle:`○`,cir:`○`,o:`○`,bullet:`•`,bull:`•`,hellip:`…`,mldr:`…`,nldr:`‥`,boxh:`─`,HorizontalLine:`─`,boxv:`│`,boxdr:`┌`,boxdl:`┐`,boxur:`└`,boxul:`┘`,boxvr:`├`,boxvl:`┤`,boxhd:`┬`,boxhu:`┴`,boxvh:`┼`,boxH:`═`,boxV:`║`,boxdR:`╒`,boxDr:`╓`,boxDR:`╔`,boxDl:`╕`,boxdL:`╖`,boxDL:`╗`,boxuR:`╘`,boxUr:`╙`,boxUR:`╚`,boxUl:`╜`,boxuL:`╛`,boxUL:`╝`,boxvR:`╞`,boxVr:`╟`,boxVR:`╠`,boxVl:`╢`,boxvL:`╡`,boxVL:`╣`,boxHd:`╤`,boxhD:`╥`,boxHD:`╦`,boxHu:`╧`,boxhU:`╨`,boxHU:`╩`,boxvH:`╪`,boxVh:`╫`,boxVH:`╬`},wG={excl:`!`,iexcl:`¡`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,nbsp:`\xA0`,comma:`,`,period:`.`,colon:`:`,semi:`;`,vert:`|`,Verbar:`‖`,verbar:`|`,dblac:`˝`,circ:`ˆ`,caron:`ˇ`,breve:`˘`,dot:`˙`,ring:`˚`,ogon:`˛`,tilde:`˜`,DiacriticalGrave:"`",DiacriticalAcute:`´`,DiacriticalTilde:`˜`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,grave:"`",acute:`´`},TG={cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,euro:`€`,dollar:`$`,euro:`€`,fnof:`ƒ`,inr:`₹`,af:`؋`,birr:`ብር`,peso:`₱`,rub:`₽`,won:`₩`,yuan:`¥`,cedil:`¸`},EG={frac12:`½`,half:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`},DG={trade:`™`,TRADE:`™`,telrec:`⌕`,target:`⌖`,ulcorn:`⌜`,ulcorner:`⌜`,urcorn:`⌝`,urcorner:`⌝`,dlcorn:`⌞`,llcorner:`⌞`,drcorn:`⌟`,lrcorner:`⌟`,intercal:`⊺`,intcal:`⊺`,oplus:`⊕`,CirclePlus:`⊕`,ominus:`⊖`,CircleMinus:`⊖`,otimes:`⊗`,CircleTimes:`⊗`,osol:`⊘`,odot:`⊙`,CircleDot:`⊙`,oast:`⊛`,circledast:`⊛`,odash:`⊝`,circleddash:`⊝`,ocirc:`⊚`,circledcirc:`⊚`,boxplus:`⊞`,plusb:`⊞`,boxminus:`⊟`,minusb:`⊟`,boxtimes:`⊠`,timesb:`⊠`,boxdot:`⊡`,sdotb:`⊡`,veebar:`⊻`,vee:`∨`,barvee:`⊽`,and:`∧`,wedge:`∧`,Cap:`⋒`,Cup:`⋓`,Fork:`⋔`,pitchfork:`⋔`,epar:`⋕`,ltlarr:`⥶`,nvap:`≍⃒`,nvsim:`∼⃒`,nvge:`≥⃒`,nvle:`≤⃒`,nvlt:`<⃒`,nvgt:`>⃒`,nvltrie:`⊴⃒`,nvrtrie:`⊵⃒`,Vdash:`⊩`,dashv:`⊣`,vDash:`⊨`,Vdash:`⊩`,Vvdash:`⊪`,nvdash:`⊬`,nvDash:`⊭`,nVdash:`⊮`,nVDash:`⊯`};({...hG,...gG,..._G,...vG,...yG,...bG,...xG,...SG,...CG,...wG,...TG,...EG,...DG});var OG={amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`},kG={nbsp:`\xA0`,copy:`©`,reg:`®`,trade:`™`,mdash:`—`,ndash:`–`,hellip:`…`,laquo:`«`,raquo:`»`,lsquo:`‘`,rsquo:`’`,ldquo:`“`,rdquo:`”`,bull:`•`,para:`¶`,sect:`§`,deg:`°`,frac12:`½`,frac14:`¼`,frac34:`¾`},AG=new Set(`!?\\\\/[]$%{}^&*()<>|+`);function jG(e){if(e[0]===`#`)throw Error(`[EntityReplacer] Invalid character '#' in entity name: "${e}"`);for(let t of e)if(AG.has(t))throw Error(`[EntityReplacer] Invalid character '${t}' in entity name: "${e}"`);return e}function MG(...e){let t=Object.create(null);for(let n of e)if(n)for(let e of Object.keys(n)){let r=n[e];if(typeof r==`string`)t[e]=r;else if(r&&typeof r==`object`&&r.val!==void 0){let n=r.val;typeof n==`string`&&(t[e]=n)}}return t}var NG=`external`,PG=`base`,FG=`all`;function IG(e){return!e||e===NG?new Set([NG]):e===FG?new Set([FG]):e===PG?new Set([PG]):Array.isArray(e)?new Set(e):new Set([NG])}var LG=Object.freeze({allow:0,leave:1,remove:2,throw:3}),RG=new Set([9,10,13]);function zG(e){if(!e)return{xmlVersion:1,onLevel:LG.allow,nullLevel:LG.remove};let t=e.xmlVersion===1.1?1.1:1,n=LG[e.onNCR]??LG.allow,r=LG[e.nullNCR]??LG.remove;return{xmlVersion:t,onLevel:n,nullLevel:Math.max(r,LG.remove)}}var BG=class{constructor(e={}){this._limit=e.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof e.postCheck==`function`?e.postCheck:e=>e,this._limitTiers=IG(this._limit.applyLimitsTo??NG),this._numericAllowed=e.numericAllowed??!0,this._baseMap=MG(OG,e.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(e.remove&&Array.isArray(e.remove)?e.remove:[]),this._leaveSet=new Set(e.leave&&Array.isArray(e.leave)?e.leave:[]);let t=zG(e.ncr);this._ncrXmlVersion=t.xmlVersion,this._ncrOnLevel=t.onLevel,this._ncrNullLevel=t.nullLevel}setExternalEntities(e){if(e)for(let t of Object.keys(e))jG(t);this._externalMap=MG(e)}addExternalEntity(e,t){jG(e),typeof t==`string`&&t.indexOf(`&`)===-1&&(this._externalMap[e]=t)}addInputEntities(e){this._totalExpansions=0,this._expandedLength=0,this._inputMap=MG(e)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(e){this._ncrXmlVersion=e===1.1?1.1:1}decode(e){if(typeof e!=`string`||e.length===0)return e;let t=e,n=[],r=e.length,i=0,a=0,o=this._maxTotalExpansions>0,s=this._maxExpandedLength>0,c=o||s;for(;a=r||e.charCodeAt(t)!==59){a++;continue}let l=e.slice(a+1,t);if(l.length===0){a++;continue}let u,d;if(this._removeSet.has(l))u=``,d===void 0&&(d=NG);else if(this._leaveSet.has(l)){a++;continue}else if(l.charCodeAt(0)===35){let e=this._resolveNCR(l);if(e===void 0){a++;continue}u=e,d=PG}else{let e=this._resolveName(l);u=e?.value,d=e?.tier}if(u===void 0){a++;continue}if(a>i&&n.push(e.slice(i,a)),n.push(u),i=t+1,a=i,c&&this._tierCounts(d)){if(o&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(s){let e=u.length-(l.length+2);if(e>0&&(this._expandedLength+=e,this._expandedLength>this._maxExpandedLength))throw Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}i=55296&&e<=57343||this._ncrXmlVersion===1&&e>=1&&e<=31&&!RG.has(e)?LG.remove:-1}_applyNCRAction(e,t,n){switch(e){case LG.allow:return String.fromCodePoint(n);case LG.remove:return``;case LG.leave:return;case LG.throw:throw Error(`[EntityDecoder] Prohibited numeric character reference &${t}; (U+${n.toString(16).toUpperCase().padStart(4,`0`)})`);default:return String.fromCodePoint(n)}}_resolveNCR(e){let t=e.charCodeAt(1),n;if(n=t===120||t===88?parseInt(e.slice(2),16):parseInt(e.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;let r=this._classifyNCR(n);if(!this._numericAllowed&&rXW.includes(e)?`__`+e:e,HG={preserveOrder:!1,attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:VG};function UG(e,t){if(typeof e!=`string`)return;let n=e.toLowerCase();if(XW.some(e=>n===e.toLowerCase())||ZW.some(e=>n===e.toLowerCase()))throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function WG(e,t){return typeof e==`boolean`?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:`all`}:typeof e==`object`&&e?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??1e3),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null,appliesTo:e.appliesTo??`all`}:WG(!0)}var GG=function(e){let t=Object.assign({},HG,e),n=[{value:t.attributeNamePrefix,name:`attributeNamePrefix`},{value:t.attributesGroupName,name:`attributesGroupName`},{value:t.textNodeName,name:`textNodeName`},{value:t.cdataPropName,name:`cdataPropName`},{value:t.commentPropName,name:`commentPropName`}];for(let{value:e,name:t}of n)e&&UG(e,t);return t.onDangerousProperty===null&&(t.onDangerousProperty=VG),t.processEntities=WG(t.processEntities,t.htmlEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),t},KG=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`,qG=class{constructor(e){this.tagname=e,this.child=[],this[`:@`]=Object.create(null)}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][KG]={startIndex:t})}static getMetaDataSymbol(){return KG}},JG=class{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,t){let n=Object.create(null),r=0;if(e[t+3]===`O`&&e[t+4]===`C`&&e[t+5]===`T`&&e[t+6]===`Y`&&e[t+7]===`P`&&e[t+8]===`E`){t+=9;let i=1,a=!1,o=!1,s=``;for(;t=this.options.maxEntityCount)throw Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);n[i]=a,r++}}else if(a&&XG(e,`!ELEMENT`,t)){t+=8;let{index:n}=this.readElementExp(e,t+1);t=n}else if(a&&XG(e,`!ATTLIST`,t))t+=8;else if(a&&XG(e,`!NOTATION`,t)){t+=9;let{index:n}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=n}else if(XG(e,`!--`,t))o=!0;else throw Error(`Invalid DOCTYPE`);i++,s=``}else if(e[t]===`>`){if(o?e[t-1]===`-`&&e[t-2]===`-`&&(o=!1,i--):i--,i===0)break}else e[t]===`[`?a=!0:s+=e[t];if(i!==0)throw Error(`Unclosed DOCTYPE`)}else throw Error(`Invalid Tag instead of DOCTYPE`);return{entities:n,i:t}}readEntityExp(e,t){t=YG(e,t);let n=t;for(;tthis.options.maxEntitySize)throw Error(`Entity "${r}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return t--,[r,i,t]}readNotationExp(e,t){t=YG(e,t);let n=t;for(;t{for(;t1||a.length===1&&!s))return e;{let r=Number(n),s=String(r);if(r===0)return r;if(s.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return s===`0`||s===o||s===`${i}${o}`?r:e;let c=a?o:n;return a?c===s||i+c===s?r:e:c===s||c===i+s?r:e}}else return e}}var nK=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function rK(e,t,n){if(!n.eNotation)return e;let r=t.match(nK);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:o.length===1&&(r[3].startsWith(`.${a}`)||r[3][0]===a)?Number(t):o.length>0?n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e:Number(t)}else return e}function iK(e){return e&&e.indexOf(`.`)!==-1?(e=e.replace(/0+$/,``),e===`.`?e=`0`:e[0]===`.`?e=`0`+e:e[e.length-1]===`.`&&(e=e.substring(0,e.length-1)),e):e}function aK(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}function oK(e,t,n){let r=t===1/0;switch(n.infinity.toLowerCase()){case`null`:return null;case`infinity`:return t;case`string`:return r?`Infinity`:`-Infinity`;default:return e}}function sK(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var cK=class{constructor(e,t={},n){this.pattern=e,this.separator=t.separator||`.`,this.segments=this._parse(e),this.data=n,this._hasDeepWildcard=this.segments.some(e=>e.type===`deep-wildcard`),this._hasAttributeCondition=this.segments.some(e=>e.attrName!==void 0),this._hasPositionSelector=this.segments.some(e=>e.position!==void 0)}_parse(e){let t=[],n=0,r=``;for(;n0?e[e.length-1].tag:void 0}getCurrentNamespace(){let e=this._matcher.path;return e.length>0?e[e.length-1].namespace:void 0}getAttrValue(e){let t=this._matcher.path;if(t.length!==0)return t[t.length-1].values?.[e]}hasAttr(e){let t=this._matcher.path;if(t.length===0)return!1;let n=t[t.length-1];return n.values!==void 0&&e in n.values}getPosition(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].position??0}getCounter(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(e,t=!0){return this._matcher.toString(e,t)}toArray(){return this._matcher.path.map(e=>e.tag)}matches(e){return this._matcher.matches(e)}matchesAny(e){return e.matchesAny(this._matcher)}},dK=class{constructor(e={}){this.separator=e.separator||`.`,this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new uK(this)}push(e,t=null,n=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let r=this.path.length;this.siblingStacks[r]||(this.siblingStacks[r]=new Map);let i=this.siblingStacks[r],a=n?`${n}:${e}`:e,o=i.get(a)||0,s=0;for(let e of i.values())s+=e;i.set(a,o+1);let c={tag:e,position:s,counter:o};n!=null&&(c.namespace=n),t!=null&&(c.values=t),this.path.push(c)}pop(){if(this.path.length===0)return;this._pathStringCache=null;let e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){let t=this.path[this.path.length-1];e!=null&&(t.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;let t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){let n=e||this.separator;if(n===this.separator&&t===!0){if(this._pathStringCache!==null)return this._pathStringCache;let e=this.path.map(e=>e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n);return this._pathStringCache=e,e}return this.path.map(e=>t&&e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n)}toArray(){return this.path.map(e=>e.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(e){let t=e.segments;return t.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t=0&&t>=0;){let r=e[n];if(r.type===`deep-wildcard`){if(n--,n<0)return!0;let r=e[n],i=!1;for(let e=t;e>=0;e--)if(this._matchSegment(r,this.path[e],e===this.path.length-1)){t=e-1,n--,i=!0;break}if(!i)return!1}else{if(!this._matchSegment(r,this.path[t],t===this.path.length-1))return!1;t--,n--}}return n<0}_matchSegment(e,t,n){if(e.tag!==`*`&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!==`*`&&e.namespace!==t.namespace||e.attrName!==void 0&&(!n||!t.values||!(e.attrName in t.values)||e.attrValue!==void 0&&String(t.values[e.attrName])!==String(e.attrValue)))return!1;if(e.position!==void 0){if(!n)return!1;let r=t.counter??0;if(e.position===`first`&&r!==0||e.position===`odd`&&r%2!=1||e.position===`even`&&r%2!=0||e.position===`nth`&&r!==e.positionValue)return!1}return!0}matchesAny(e){return e.matchesAny(this)}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this._pathStringCache=null,this.path=e.path.map(e=>({...e})),this.siblingStacks=e.siblingStacks.map(e=>new Map(e))}readOnly(){return this._view}};function fK(e,t){if(!e)return{};let n=t.attributesGroupName?e[t.attributesGroupName]:e;if(!n)return{};let r={};for(let e in n)if(e.startsWith(t.attributeNamePrefix)){let i=e.substring(t.attributeNamePrefix.length);r[i]=n[e]}else r[e]=n[e];return r}function pK(e){if(!e||typeof e!=`string`)return;let t=e.indexOf(`:`);if(t!==-1&&t>0){let n=e.substring(0,t);if(n!==`xmlns`)return n}}var mK=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=yK,this.parseTextData=hK,this.resolveNameSpace=gK,this.buildAttributesMap=vK,this.isItStopNode=CK,this.replaceEntitiesValue=xK,this.readStopNodeData=OK,this.saveTextToParentTag=SK,this.addChild=bK,this.ignoreAttributesFn=sK(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0;let t={...OG};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities==`object`?t=this.options.htmlEntities:this.options.htmlEntities===!0&&(t={...kG,...TG}),this.entityDecoder=new BG({namedEntities:t,numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new dK,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new lK;let n=this.options.stopNodes;if(n&&n.length>0){for(let e=0;e0)){o||(e=this.replaceEntitiesValue(e,t,n));let r=s.jPath?n.toString():n,c=s.tagValueProcessor(t,e,r,i,a);return c==null?e:typeof c!=typeof e||c!==e?c:s.trimValues||e.trim()===e?kK(e,s.parseTagValue,s.numberParseOptions):e}}function gK(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}var _K=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function vK(e,t,n,r=!1){let i=this.options;if(r===!0||i.ignoreAttributes!==!0&&typeof e==`string`){let r=qW(e,_K),a=r.length,o={},s=Array(a),c=!1,l={};for(let e=0;e`,s,`Closing Tag is not closed.`),a=e.substring(s+2,t).trim();if(i.removeNSPrefix){let e=a.indexOf(`:`);e!==-1&&(a=a.substr(e+1))}a=AK(i.transformTagName,a,``,i).tagName,n&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher));let o=this.matcher.getCurrentTag();if(a&&i.unpairedTagsSet.has(a))throw Error(`Unpaired tag can not be used as closing tag: `);o&&i.unpairedTagsSet.has(o)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),r=``,s=t}else if(c===63){let t=DK(e,s,!1,`?>`);if(!t)throw Error(`Pi Tag is not closed.`);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let a=this.buildAttributesMap(t.tagExp,this.matcher,t.tagName,!0);if(a){let e=a[this.options.attributeNamePrefix+`version`];this.entityDecoder.setXmlVersion(Number(e)||1)}if(!(i.ignoreDeclaration&&t.tagName===`?xml`||i.ignorePiTags)){let e=new qG(t.tagName);e.add(i.textNodeName,``),t.tagName!==t.tagExp&&t.attrExpPresent&&i.ignoreAttributes!==!0&&(e[`:@`]=a),this.addChild(n,e,this.readonlyMatcher,s)}s=t.closeIndex+1}else if(c===33&&e.charCodeAt(s+2)===45&&e.charCodeAt(s+3)===45){let t=TK(e,`-->`,s+4,`Comment is not closed.`);if(i.commentPropName){let a=e.substring(s+4,t-2);r=this.saveTextToParentTag(r,n,this.readonlyMatcher),n.add(i.commentPropName,[{[i.textNodeName]:a}])}s=t}else if(c===33&&e.charCodeAt(s+2)===68){let t=a.readDocType(e,s);this.entityDecoder.addInputEntities(t.entities),s=t.i}else if(c===33&&e.charCodeAt(s+2)===91){let t=TK(e,`]]>`,s,`CDATA is not closed.`)-2,a=e.substring(s+9,t);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let o=this.parseTextData(a,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);o??=``,i.cdataPropName?n.add(i.cdataPropName,[{[i.textNodeName]:a}]):n.add(i.textNodeName,o),s=t+2}else{let a=DK(e,s,i.removeNSPrefix);if(!a){let t=e.substring(Math.max(0,s-50),Math.min(o,s+50));throw Error(`readTagExp returned undefined at position ${s}. Context: "${t}"`)}let c=a.tagName,l=a.rawTagName,u=a.tagExp,d=a.attrExpPresent,f=a.closeIndex;if({tagName:c,tagExp:u}=AK(i.transformTagName,c,u,i),i.strictReservedNames&&(c===i.commentPropName||c===i.cdataPropName||c===i.textNodeName||c===i.attributesGroupName))throw Error(`Invalid tag name: ${c}`);n&&r&&n.tagname!==`!xml`&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher,!1));let p=n;p&&i.unpairedTagsSet.has(p.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let m=!1;u.length>0&&u.lastIndexOf(`/`)===u.length-1&&(m=!0,c[c.length-1]===`/`?(c=c.substr(0,c.length-1),u=c):u=u.substr(0,u.length-1),d=c!==u);let h=null,g;g=pK(l),c!==t.tagname&&this.matcher.push(c,{},g),c!==u&&d&&(h=this.buildAttributesMap(u,this.matcher,c),h&&fK(h,i)),c!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let _=s;if(this.isCurrentNodeStopNode){let t=``;if(m)s=a.closeIndex;else if(i.unpairedTagsSet.has(c))s=a.closeIndex;else{let n=this.readStopNodeData(e,l,f+1);if(!n)throw Error(`Unexpected end of ${l}`);s=n.i,t=n.tagContent}let r=new qG(c);h&&(r[`:@`]=h),r.add(i.textNodeName,t),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,r,this.readonlyMatcher,_)}else{if(m){({tagName:c,tagExp:u}=AK(i.transformTagName,c,u,i));let e=new qG(c);h&&(e[`:@`]=h),this.addChild(n,e,this.readonlyMatcher,_),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(i.unpairedTagsSet.has(c)){let e=new qG(c);h&&(e[`:@`]=h),this.addChild(n,e,this.readonlyMatcher,_),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=a.closeIndex;continue}else{let e=new qG(c);if(this.tagsNodeStack.length>i.maxNestedTags)throw Error(`Maximum nested tags exceeded`);this.tagsNodeStack.push(n),h&&(e[`:@`]=h),this.addChild(n,e,this.readonlyMatcher,_),n=e}r=``,s=f}}}else r+=e[s];return t.child};function bK(e,t,n,r){this.options.captureMetaData||(r=void 0);let i=this.options.jPath?n.toString():n,a=this.options.updateTag(t.tagname,i,t[`:@`]);a===!1||(typeof a==`string`&&(t.tagname=a),e.addChild(t,r))}function xK(e,t,n){let r=this.options.processEntities;if(!r||!r.enabled)return e;if(r.allowedTags){let i=this.options.jPath?n.toString():n;if(!(Array.isArray(r.allowedTags)?r.allowedTags.includes(t):r.allowedTags(t,i)))return e}if(r.tagFilter){let i=this.options.jPath?n.toString():n;if(!r.tagFilter(t,i))return e}return this.entityDecoder.decode(e)}function SK(e,t,n,r){return e&&=(r===void 0&&(r=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[`:@`]?Object.keys(t[`:@`]).length!==0:!1,r),e!==void 0&&e!==``&&t.add(this.options.textNodeName,e),``),e}function CK(){return this.stopNodeExpressionsSet.size!==0&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function wK(e,t,n=`>`){let r=0,i=[],a=e.length,o=n.charCodeAt(0),s=n.length>1?n.charCodeAt(1):-1;for(let n=t;n`){let i=wK(e,t+1,r);if(!i)return;let a=i.data,o=i.index,s=a.search(/\s/),c=a,l=!0;s!==-1&&(c=a.substring(0,s),a=a.substring(s+1).trimStart());let u=c;if(n){let e=c.indexOf(`:`);e!==-1&&(c=c.substr(e+1),l=c!==i.data.substr(e+1))}return{tagName:c,tagExp:a,closeIndex:o,attrExpPresent:l,rawTagName:u}}function OK(e,t,n){let r=n,i=1,a=e.length;for(;n`,n,`${t} is not closed`);if(e.substring(n+2,a).trim()===t&&(i--,i===0))return{tagContent:e.substring(r,n),i:a};n=a}else if(a===63)n=TK(e,`?>`,n+1,`StopNode is not closed.`);else if(a===33&&e.charCodeAt(n+2)===45&&e.charCodeAt(n+3)===45)n=TK(e,`-->`,n+3,`StopNode is not closed.`);else if(a===33&&e.charCodeAt(n+2)===91)n=TK(e,`]]>`,n,`StopNode is not closed.`)-2;else{let r=DK(e,n,`>`);r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!==`/`&&i++,n=r.closeIndex)}}}function kK(e,t,n){if(t&&typeof e==`string`){let t=e.trim();return t===`true`||t!==`false`&&tK(e,n)}else if(YW(e))return e;else return``}function AK(e,t,n,r){if(e){let r=e(t);n===t&&(n=r),t=r}return t=jK(t,r),{tagName:t,tagExp:n}}function jK(e,t){if(ZW.includes(e))throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return XW.includes(e)?t.onDangerousProperty(e):e}var MK=qG.getMetaDataSymbol();function NK(e,t){if(!e||typeof e!=`object`)return{};if(!t)return e;let n={};for(let r in e)if(r.startsWith(t)){let i=r.substring(t.length);n[i]=e[r]}else n[r]=e[r];return n}function PK(e,t,n,r){return FK(e,t,n,r)}function FK(e,t,n,r){let i,a={};for(let o=0;o0&&(a[t.textNodeName]=i):i!==void 0&&(a[t.textNodeName]=i),a}function IK(e){let t=Object.keys(e);for(let e=0;e!!t?.arrayPaths?.some(e=>n===e),...t?._fastXML});return t?.uncapitalizeKeys?GW(n):n}function VK(e,t){return new zK({ignoreAttributes:!1,attributeNamePrefix:``,...t}).parse(e)}var HK={dataType:null,batchType:null,name:`XML`,id:`xml`,module:`xml`,version:`4.4.3`,worker:!1,extensions:[`xml`],mimeTypes:[`application/xml`,`text/xml`],testText:UK,options:{xml:{_parser:`fast-xml-parser`,uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:`value`,arrayPaths:[]}},parse:async(e,t)=>BK(new TextDecoder().decode(e),{...HK.options.xml,...t?.xml}),parseTextSync:(e,t)=>BK(e,{...HK.options.xml,...t?.xml})};function UK(e){return e.startsWith(`qK(new TextDecoder().decode(e),t),parseSync:(e,t)=>qK(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>qK(e,t)};function KK(e){return e.startsWith(`0&&t.every(e=>typeof e==`string`)?t:[]}function XK(e,t=void 0){switch(typeof e){case`number`:return e;case`string`:return parseFloat(e);default:return}}function ZK(e,t=void 0){switch(typeof e){case`number`:return e;case`string`:return parseInt(e,10);default:return}}function QK(e){switch(e){case`true`:return!0;case`false`:return!1;case`1`:return!0;case`0`:return!1;default:return!1}}function $K(e,t){let n=HK.parseTextSync?.(e,t),r=n.WMT_MS_Capabilities||n.WMS_Capabilities||n,i=eq(r);if(t?.inheritedLayerProps)for(let e of i.layers)lq(e,null);return t?.includeRawJSON&&(i.json=r),t?.includeXMLText&&(i.xml=e),i}function eq(e){let t={version:String(e.version||``),name:String(e.Service?.Name||`unnamed`),title:e.Service?.Title?String(e.Service?.Title):void 0,abstract:e.Service?.Abstract?String(e.Service?.Abstract):void 0,keywords:YK(e.Service?.KeywordList?.Keyword),fees:e.Service?.Fees?JSON.stringify(e.Service?.Fees):void 0,accessConstraints:e.Service?.AccessConstraints?JSON.stringify(e.Service?.AccessConstraints):void 0,layerLimit:ZK(e.Service?.LayerLimit),maxWidth:ZK(e.Service?.maxWidth),maxHeight:ZK(e.Service?.maxHeight),layers:[],requests:tq(e.Capability?.Request),exceptions:nq(e.Exception)},n=JK(e.Capability?.Layer);for(let e of n)t.layers.push(rq(e));for(let[e,n]of Object.entries(t))n===void 0&&delete t[e];return t}function tq(e){let t={};for(let[n,r]of Object.entries(e||{}))t[n]={mimeTypes:YK(r?.Format)};return t}function nq(e){if(JK(e?.Format).length>0)return{mimeTypes:YK(e)}}function rq(e){let t={title:String(e?.Title||``),name:e?.Name&&String(e?.Name),abstract:e?.Name&&String(e?.Abstract),keywords:YK(e.KeywordList?.Keyword)},n=e?.CRS||e?.SRS;n&&Array.isArray(n)&&n.every(e=>typeof e==`string`)&&(t.crs=n);let r=e?.EX_GeographicBoundingBox&&iq(e?.EX_GeographicBoundingBox);r&&(t.geographicBoundingBox=r),r=e?.LatLonBoundingBox&&aq(e?.LatLonBoundingBox),r&&(t.geographicBoundingBox=r);let i=e?.BoundingBox&&oq(e?.BoundingBox);i&&i.length>0&&(t.boundingBoxes=i);let a=JK(e?.Dimension).map(e=>cq(e));a.length&&(t.dimensions=a),e?.opaque&&(t.opaque=QK(e?.opaque)),e?.cascaded&&(t.cascaded=QK(e?.cascaded)),e?.queryable&&(t.queryable=QK(e?.queryable));let o=JK(e?.Layer),s=[];for(let e of o)s.push(rq(e));s.length>0&&(t.layers=s);for(let[e,n]of Object.entries(t))n===void 0&&delete t[e];return t}function iq(e){let{westBoundLongitude:t,northBoundLatitude:n,eastBoundLongitude:r,southBoundLatitude:i}=e;return[[t,i],[r,n]]}function aq(e){let{minx:t,miny:n,maxx:r,maxy:i}=e;return[[t,n],[r,i]]}function oq(e){return JK(e).map(e=>sq(e))}function sq(e){let{CRS:t,SRS:n,minx:r,miny:i,maxx:a,maxy:o,resx:s,resy:c}=e,l={crs:t||n,boundingBox:[[XK(r),XK(i)],[XK(a),XK(o)]]};return s&&(l.xResolution=s),c&&(l.yResolution=c),l}function cq(e){let{name:t,units:n,value:r}=e,i={name:t,units:n,extent:r};return e.unitSymbol&&(i.unitSymbol=e.unitSymbol),e.default&&(i.defaultValue=e.default),e.multipleValues&&(i.multipleValues=QK(e.multipleValues)),e.nearestValue&&(i.nearestValue=QK(e.nearestValue)),e.current&&(i.current=QK(e.current)),i}function lq(e,t){t?.geographicBoundingBox&&!e.geographicBoundingBox&&(e.geographicBoundingBox=[...t.geographicBoundingBox]),t?.crs&&!e.crs&&(e.crs=[...t.crs]),t?.boundingBoxes&&!e.boundingBoxes&&(e.boundingBoxes=[...t.boundingBoxes]),t?.dimensions&&!e.dimensions&&(e.dimensions=[...t.dimensions]);for(let t of e.layers||[])lq(t,e)}var uq={dataType:null,batchType:null,id:`wms-capabilities`,name:`WMS Capabilities`,module:`wms`,version:`4.4.3`,worker:!1,extensions:[`xml`],mimeTypes:[`application/vnd.ogc.wms_xml`,`application/xml`,`text/xml`],testText:dq,options:{wms:{}},parse:async(e,t)=>$K(new TextDecoder().decode(e),t?.wms),parseTextSync:(e,t)=>$K(e,t?.wms)};function dq(e){return e.startsWith(`pq(e))}}function pq(e){return{attributes:e||{},type:``,bounds:{bottom:0,top:0,left:0,right:0}}}var mq={...uq,dataType:null,id:`wms-feature-info`,name:`WMS FeatureInfo`,parse:async(e,t)=>fq(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>fq(e,t)};function hq(e,t){return HK.parseTextSync?.(e,t)}var gq={...uq,dataType:null,id:`wms-layer-description`,name:`WMS DescribeLayer`,parse:async(e,t)=>hq(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>hq(e,t)},_q={name:`Web Map Service (OGC WMS)`,id:`wms`,module:`wms`,version:`0.0.0`,extensions:[],mimeTypes:[],type:`wms`,fromUrl:!0,fromBlob:!1,defaultOptions:{wms:{}},testURL:e=>e.toLowerCase().includes(`wms`),createDataSource:(e,t)=>new vq(e,t)},vq=class extends ur{substituteCRS84;flipCRS;wmsParameters;vendorParameters;capabilities=null;constructor(e,t){super(e,t,_q.defaultOptions),this.substituteCRS84=t.wms?.substituteCRS84??!1,this.flipCRS=[`EPSG:4326`],this.wmsParameters={layers:void 0,query_layers:void 0,styles:void 0,version:`1.3.0`,crs:`EPSG:4326`,format:`image/png`,info_format:`text/plain`,transparent:void 0,time:void 0,elevation:void 0,...t.wmsParameters,...t.wms?.wmsParameters},this.vendorParameters=t.wms?.vendorParameters||t.vendorParameters||{}}async getMetadata(){let e=await this.getCapabilities();return this.normalizeMetadata(e)}async getImage(e){let{boundingBox:t,bbox:n,...r}=e,i={bbox:t?[...t[0],...t[1]]:n,...r};return await this.getMap(i)}normalizeMetadata(e){return e}async getCapabilities(e,t){let n=this.getCapabilitiesURL(e,t),r=await this.fetch(n),i=await r.arrayBuffer();this._checkResponse(r,i);let a=await uq.parse(i,this.loadOptions);return this.capabilities=a,a}async getMap(e,t){let n=this.getMapURL(e,t),r=await this.fetch(n),i=await r.arrayBuffer();this._checkResponse(r,i);try{return await ao.parse(i,this.loadOptions)}catch{throw this._parseError(i)}}async getFeatureInfo(e,t){let n=this.getFeatureInfoURL(e,t),r=await this.fetch(n),i=await r.arrayBuffer();return this._checkResponse(r,i),await mq.parse(i,this.loadOptions)}async getFeatureInfoText(e,t){let n=this.getFeatureInfoURL(e,t),r=await this.fetch(n),i=await r.arrayBuffer();return this._checkResponse(r,i),new TextDecoder().decode(i)}async describeLayer(e,t){let n=this.describeLayerURL(e,t),r=await this.fetch(n),i=await r.arrayBuffer();return this._checkResponse(r,i),await gq.parse(i,this.loadOptions)}async getLegendGraphic(e,t){let n=this.getLegendGraphicURL(e,t),r=await this.fetch(n),i=await r.arrayBuffer();this._checkResponse(r,i);try{return await ao.parse(i,this.loadOptions)}catch{throw this._parseError(i)}}getCapabilitiesURL(e,t){let n={version:this.wmsParameters.version,...e};return this._getWMSUrl(`GetCapabilities`,n,t)}getMapURL(e,t){e=this._getWMS130Parameters(e);let n={version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...e};return this._getWMSUrl(`GetMap`,n,t)}getFeatureInfoURL(e,t){e=this._getWMS130Parameters(e);let{boundingBox:n,bbox:r}=e;e.bbox=n?[...n[0],...n[1]]:r;let i={version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...e};return this._getWMSUrl(`GetFeatureInfo`,i,t)}describeLayerURL(e,t){let n={version:this.wmsParameters.version,...e};return this._getWMSUrl(`DescribeLayer`,n,t)}getLegendGraphicURL(e,t){let n={version:this.wmsParameters.version,...e};return this._getWMSUrl(`GetLegendGraphic`,n,t)}_parseWMSUrl(e){let[t,n]=e.split(`?`),r=n.split(`&`),i={};for(let e of r){let[t,n]=e.split(`=`);i[t]=n}return{url:t,parameters:i}}_getWMSUrl(e,t,n){let r=this.url,i=!0,a={service:`WMS`,version:t.version,request:e,...t,...this.vendorParameters,...n},o=[`transparent`,`time`,`elevation`];for(let[e,n]of Object.entries(a))(!o.includes(e)||n)&&(r+=i?`?`:`&`,i=!1,r+=this._getURLParameter(e,n,t));return encodeURI(r)}_getWMS130Parameters(e){let t={...e};return t.srs&&(t.crs=t.crs||t.srs,delete t.srs),t}_getURLParameter(e,t,n){switch(e){case`crs`:n.version===`1.3.0`?this.substituteCRS84&&t===`EPSG:4326`&&(t=`CRS:84`):e=`srs`;break;case`srs`:n.version===`1.3.0`&&(e=`crs`);break;case`bbox`:let r=this._flipBoundingBox(t,n);r&&(t=r);break;case`x`:n.version===`1.3.0`&&(e=`i`);break;case`y`:n.version===`1.3.0`&&(e=`j`);break;default:}return e=e.toUpperCase(),Array.isArray(t)?`${e}=${t.join(`,`)}`:`${e}=${t?String(t):``}`}_flipBoundingBox(e,t){if(!Array.isArray(e)||e.length!==4)return null;let n=t.version===`1.3.0`&&this.flipCRS.includes(t.crs||``)&&!(this.substituteCRS84&&t.crs===`EPSG:4326`),r=e;return n?[r[1],r[0],r[3],r[2]]:r}async _fetchArrayBuffer(e){let t=await this.fetch(e),n=await t.arrayBuffer();return this._checkResponse(t,n),n}_checkResponse(e,t){let n=e.headers[`content-type`];if(!e.ok||GK.mimeTypes.includes(n)){let e=Bt(this.loadOptions,{wms:{throwOnError:!0}}),n=GK.parseSync?.(t,e);throw Error(n)}}_parseError(e){let t=GK.parseSync?.(e,this.options.core?.loadOptions);return Error(t)}},yq=6378137*Math.PI;function bq(e){let t=rm(e);return t[0]=(t[0]/256-1)*yq,t[1]=(t[1]/256-1)*yq,t}var xq={id:`imagery-layer`,data:``,serviceType:`auto`,srs:`auto`,layers:{type:`array`,compare:!0,value:[]},onMetadataLoad:{type:`function`,value:()=>{}},onMetadataLoadError:{type:`function`,value:console.error},onImageLoadStart:{type:`function`,value:()=>{}},onImageLoad:{type:`function`,value:()=>{}},onImageLoadError:{type:`function`,compare:!1,value:(e,t)=>console.error(t,e)}},Sq=class extends fx{get isLoaded(){return this.state?.loadCounter===0&&super.isLoaded}shouldUpdateState(){return!0}initializeState(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}updateState({changeFlags:e,props:t,oldProps:n}){let{viewport:r}=this.context;e.dataChanged||t.serviceType!==n.serviceType?(this.state.imageSource=this._createImageSource(t),this._loadMetadata(),this.debounce(()=>this.loadImage(r,`image source changed`),0)):B_(t.layers,n.layers,1)?e.viewportChanged&&this.debounce(()=>this.loadImage(r,`viewport changed`)):this.debounce(()=>this.loadImage(r,`layers changed`),0)}finalizeState(){}renderLayers(){let{bounds:e,image:t,lastRequestParameters:n}=this.state;return t&&new TN({...this.getSubLayerProps({id:`bitmap`}),_imageCoordinateSystem:n.srs===`EPSG:4326`?gp.LNGLAT:gp.CARTESIAN,bounds:e,image:t})}async getFeatureInfoText(e,t){let{lastRequestParameters:n}=this.state;return n?await this.state.imageSource.getFeatureInfoText?.({...n,query_layers:n.layers,x:e,y:t,info_format:`application/vnd.ogc.gml`}):``}_createImageSource(e){if(e.data instanceof pr)return e.data;if(typeof e.data==`string`)return _a(e.data,[_q],{core:{type:e.serviceType,loadOptions:e.loadOptions}});throw Error(`invalid image source in props.data`)}async _loadMetadata(){let{imageSource:e}=this.state;try{this.state.loadCounter++;let t=await e.getMetadata();this.state.imageSource===e&&this.getCurrentLayer()?.props.onMetadataLoad(t)}catch(e){this.getCurrentLayer()?.props.onMetadataLoadError(e)}finally{this.state.loadCounter--}}async loadImage(e,t){let{layers:n,serviceType:r}=this.props;if(r===`wms`&&n.length===0)return;let i=e.getBounds(),{width:a,height:o}=e,s=this.getRequestId(),{srs:c}=this.props;c===`auto`&&(c=e.resolution?`EPSG:4326`:`EPSG:3857`);let l={width:a,height:o,boundingBox:[[i[0],i[1]],[i[2],i[3]]],layers:n,crs:c};c===`EPSG:3857`&&(l.boundingBox=[bq([i[0],i[1]]),bq([i[2],i[3]])]);try{this.state.loadCounter++,this.props.onImageLoadStart(s);let e=await this.state.imageSource.getImage(l);this.state.lastRequestIde(),t)}};Sq.layerName=`WMSLayer`,Sq.defaultProps=xq;var Cq={getHeight:{type:`accessor`,value:0},greatCircle:!0},wq=class extends mN{};wq.layerName=`GreatCircleLayer`,wq.defaultProps=Cq;var Tq=t(r(((t,n)=>{(function(t,r){typeof define==`function`&&define.amd?define([],r):typeof e==`function`&&typeof n==`object`&&n&&n.exports?n.exports=r():(t.dcodeIO=t.dcodeIO||{}).Long=r()})(t,function(){function e(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function t(e){return(e&&e.__isLong__)===!0}e.isLong=t;var n={},r={};function i(e,t){var i,a,s;return t?(e>>>=0,(s=0<=e&&e<256)&&(a=r[e],a)?a:(i=o(e,(e|0)<0?-1:0,!0),s&&(r[e]=i),i)):(e|=0,(s=-128<=e&&e<128)&&(a=n[e],a)?a:(i=o(e,e<0?-1:0,!1),s&&(n[e]=i),i))}e.fromInt=i;function a(e,t){if(isNaN(e)||!isFinite(e))return t?_:g;if(t){if(e<0)return _;if(e>=p)return S}else{if(e<=-m)return C;if(e+1>=m)return x}return e<0?a(-e,t).neg():o(e%f|0,e/f|0,t)}e.fromNumber=a;function o(t,n,r){return new e(t,n,r)}e.fromBits=o;var s=Math.pow;function c(e,t,n){if(e.length===0)throw Error(`empty string`);if(e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return g;if(typeof t==`number`?(n=t,t=!1):t=!!t,n||=10,n<2||360)throw Error(`interior hyphen`);if(r===0)return c(e.substring(1),t,n).neg();for(var i=a(s(n,8)),o=g,l=0;l>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},w.toString=function(e){if(e||=10,e<2||36>>0).toString(e);if(o=l,o.isZero())return u+c;for(;u.length<6;)u=`0`+u;c=``+u+c}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(C)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<=0},w.isOdd=function(){return(this.low&1)==1},w.isEven=function(){return(this.low&1)==0},w.equals=function(e){return t(e)||(e=l(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=l(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(C)?C:this.not().add(v)},w.neg=w.negate,w.add=function(e){t(e)||(e=l(e));var n=this.high>>>16,r=this.high&65535,i=this.low>>>16,a=this.low&65535,s=e.high>>>16,c=e.high&65535,u=e.low>>>16,d=e.low&65535,f=0,p=0,m=0,h=0;return h+=a+d,m+=h>>>16,h&=65535,m+=i+u,p+=m>>>16,m&=65535,p+=r+c,f+=p>>>16,p&=65535,f+=n+s,f&=65535,o(m<<16|h,f<<16|p,this.unsigned)},w.subtract=function(e){return t(e)||(e=l(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero()||(t(e)||(e=l(e)),e.isZero()))return g;if(this.eq(C))return e.isOdd()?C:g;if(e.eq(C))return this.isOdd()?C:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(h)&&e.lt(h))return a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=this.high&65535,i=this.low>>>16,s=this.low&65535,c=e.high>>>16,u=e.high&65535,d=e.low>>>16,f=e.low&65535,p=0,m=0,_=0,v=0;return v+=s*f,_+=v>>>16,v&=65535,_+=i*f,m+=_>>>16,_&=65535,_+=s*d,m+=_>>>16,_&=65535,m+=r*f,p+=m>>>16,m&=65535,m+=i*d,p+=m>>>16,m&=65535,m+=s*u,p+=m>>>16,m&=65535,p+=n*f+r*d+i*u+s*c,p&=65535,o(_<<16|v,p<<16|m,this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=l(e)),e.isZero())throw Error(`division by zero`);if(this.isZero())return this.unsigned?_:g;var n,r,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return _;if(e.gt(this.shru(1)))return y;i=_}else{if(this.eq(C))return e.eq(v)||e.eq(b)?C:e.eq(C)?v:(n=this.shr(1).div(e).shl(1),n.eq(g)?e.isNegative()?v:b:(r=this.sub(e.mul(n)),i=n.add(r.div(e)),i));if(e.eq(C))return this.unsigned?_:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=g}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),c=o<=48?1:s(2,o-48),u=a(n),d=u.mul(e);d.isNegative()||d.gt(r);)n-=c,u=a(n,this.unsigned),d=u.mul(e);u.isZero()&&(u=v),i=i.add(u),r=r.sub(d)}return i},w.div=w.divide,w.modulo=function(e){return t(e)||(e=l(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=l(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=l(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=l(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?o(this.low<>>32-e,this.unsigned):o(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),e&=63,e===0)return this;var n=this.high;if(e<32){var r=this.low;return o(r>>>e|n<<32-e,n>>>e,this.unsigned)}else if(e===32)return o(n,0,this.unsigned);else return o(n>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24&255,e&255,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,e&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255]},e})}))(),1),Eq=180/Math.PI;function Dq(e,t,n){let r=1<=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function kq(e){return[Oq(e[0]),Oq(e[1])]}function Aq(e,[t,n]){switch(e){case 0:return[1,t,n];case 1:return[-t,1,n];case 2:return[-t,-n,1];case 3:return[-1,-n,-t];case 4:return[n,-1,-t];case 5:return[n,t,-1];default:throw Error(`Invalid face`)}}function jq([e,t,n]){let r=Math.atan2(n,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*Eq,r*Eq]}function Mq(e){let t=Tq.default.fromString(e,!0,10).toString(2);for(;t.length<64;)t=`0`+t;let n=t.lastIndexOf(`1`),r=t.substring(0,3),i=t.substring(3,n),a=i.length/2,o=Tq.default.fromString(r,!0,2).toString(10),s=Tq.default.fromString(i,!0,2).toString(4);for(;s.length=0;e--){o=i-e;let t=r[e],n=0,s=0;t===`1`?s=1:t===`2`?(n=1,s=1):t===`3`&&(n=1);let c=2**(o-1);Nq(c,a,n,s),a[0]+=c*n,a[1]+=c*s}if(n%2==1){let e=a[0];a[0]=a[1],a[1]=e}return{face:n,ij:a,level:o}}function Fq(e){let t=e.padEnd(16,`0`);return Tq.default.fromString(t,16)}var Iq=100;function Lq({face:e,ij:t,level:n}){let r=[[0,0],[0,1],[1,1],[1,0],[0,0]],i=Math.max(1,Math.ceil(Iq*2**-n)),a=new Float64Array(4*i*2+2),o=0,s=0;for(let c=0;c<4;c++){let l=r[c].slice(0),u=r[c+1],d=(u[0]-l[0])/i,f=(u[1]-l[1])/i;for(let r=0;r89.999&&(r[0]=s);let i=r[0]-s;r[0]+=i>180?-360:i<-180?360:0,a[o++]=r[0],a[o++]=r[1],s=r[0]}}return a[o++]=a[0],a[o++]=a[1],a}function Rq(e){if(typeof e==`string`){if(e.indexOf(`/`)>0)return e;e=Fq(e)}return Mq(e.toString())}function zq(e){return Lq(Pq(Rq(e)))}var Bq={getS2Token:{type:`accessor`,value:e=>e.token}},Vq=class extends cL{indexToBounds(){let{data:e,getS2Token:t}=this.props;return{data:e,_normalize:!1,positionFormat:`XY`,getPolygon:(e,n)=>zq(t(e,n))}}};Vq.layerName=`S2Layer`,Vq.defaultProps=Bq;var Hq=512;function Uq(e,t){let n=0,r=0,i=1<>=1;let a=parseInt(e[t]);a%2&&(n|=i),a>1&&(r|=i)}return[[n/a,Hq-r/a],[(n+t)/a,Hq-(r+t)/a]]}function Wq(e,t=1){let[n,r]=Uq(e,t),[i,a]=im(n),[o,s]=im(r);return[o,a,o,s,i,s,i,a,o,a]}var Gq={getQuadkey:{type:`accessor`,value:e=>e.quadkey}},Kq=class extends cL{indexToBounds(){let{data:e,extruded:t,getQuadkey:n}=this.props,r=t?.99:1;return{data:e,_normalize:!1,positionFormat:`XY`,getPolygon:(e,t)=>Wq(n(e,t),r),updateTriggers:{getPolygon:r}}}};Kq.layerName=`QuadkeyLayer`,Kq.defaultProps=Gq;var qq=class{constructor(e){this.index=e,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get bbox(){return this._bbox}set bbox(e){this._bbox||(this._bbox=e,`west`in e?this.boundingBox=[[e.west,e.south],[e.east,e.north]]:this.boundingBox=[[e.left,e.top],[e.right,e.bottom]])}get data(){return this.isLoading&&this._loader?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return!!this._loader&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){let e=this.content?this.content.byteLength:0;return Number.isFinite(e)||console.error(`byteLength not defined in tile data`),e}async _loadData({getData:e,requestScheduler:t,onLoad:n,onError:r}){let{index:i,id:a,bbox:o,userData:s,zoom:c}=this,l=this._loaderId;this._abortController=new AbortController;let{signal:u}=this._abortController,d=await t.scheduleRequest(this,e=>e.isSelected?1:-1);if(!d){this._isCancelled=!0;return}if(this._isCancelled){d.done();return}let f=null,p;try{f=await e({index:i,id:a,bbox:o,userData:s,zoom:c,signal:u})}catch(e){p=e||!0}finally{d.done()}if(l===this._loaderId){if(this._loader=void 0,this.content=f,this._isCancelled&&!f){this._isLoaded=!1;return}this._isLoaded=!0,this._isCancelled=!1,p?r(p,this):n(this)}}loadData(e){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(e),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController?.abort())}},Jq={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Yq=new Y,Xq=new Y,Zq=class e{constructor(e=[0,0,0],t=[0,0,0],n){n||=Yq.copy(e).add(t).scale(.5),this.center=new Y(n),this.halfDiagonal=new Y(t).subtract(this.center),this.minimum=new Y(e),this.maximum=new Y(t)}clone(){return new e(this.minimum,this.maximum,this.center)}equals(e){return this===e||!!e&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}transform(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}intersectPlane(e){let{halfDiagonal:t}=this,n=Xq.from(e.normal),r=t.x*Math.abs(n.x)+t.y*Math.abs(n.y)+t.z*Math.abs(n.z),i=this.center.dot(n)+e.distance;return i-r>0?Jq.INSIDE:i+r<0?Jq.OUTSIDE:Jq.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let t=Yq.from(e).subtract(this.center),{halfDiagonal:n}=this,r=0,i;return i=Math.abs(t.x)-n.x,i>0&&(r+=i*i),i=Math.abs(t.y)-n.y,i>0&&(r+=i*i),i=Math.abs(t.z)-n.z,i>0&&(r+=i*i),r}},Qq=new Y,$q=new Y,eJ=class e{constructor(e=[0,0,0],t=0){this.radius=-0,this.center=new Y,this.fromCenterRadius(e,t)}fromCenterRadius(e,t){return this.center.from(e),this.radius=t,this}fromCornerPoints(e,t){return t=Qq.from(t),this.center=new Y().from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}equals(e){return this===e||!!e&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new e(this.center,this.radius)}union(e){let t=this.center,n=this.radius,r=e.center,i=e.radius,a=Qq.copy(r).subtract(t),o=a.magnitude();if(n>=o+i)return this.clone();if(i>=o+n)return e.clone();let s=(n+o+i)*.5;return $q.copy(a).scale((-n+s)/o).add(t),this.center.copy($q),this.radius=s,this}expand(e){let t=Qq.from(e).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);let t=nu(Qq,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){let t=this.distanceTo(e);return t*t}distanceTo(e){let t=Qq.from(e).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){let t=this.center,n=this.radius,r=e.normal.dot(t)+e.distance;return r<-n?Jq.OUTSIDE:r=s?Jq.INSIDE:Jq.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let t=nJ.from(e).subtract(this.center),n=this.halfAxes,r=n.getColumn(0,rJ),i=n.getColumn(1,iJ),a=n.getColumn(2,aJ),o=r.magnitude(),s=i.magnitude(),c=a.magnitude();r.normalize(),i.normalize(),a.normalize();let l=0,u;return u=Math.abs(t.dot(r))-o,u>0&&(l+=u*u),u=Math.abs(t.dot(i))-s,u>0&&(l+=u*u),u=Math.abs(t.dot(a))-c,u>0&&(l+=u*u),l}computePlaneDistances(e,t,n=[-0,-0]){let r=1/0,i=-1/0,a=this.center,o=this.halfAxes,s=o.getColumn(0,rJ),c=o.getColumn(1,iJ),l=o.getColumn(2,aJ),u=oJ.copy(s).add(c).add(l).add(a),d=sJ.copy(u).subtract(e),f=t.dot(d);return r=Math.min(f,r),i=Math.max(f,i),u.copy(a).add(s).add(c).subtract(l),d.copy(u).subtract(e),f=t.dot(d),r=Math.min(f,r),i=Math.max(f,i),u.copy(a).add(s).subtract(c).add(l),d.copy(u).subtract(e),f=t.dot(d),r=Math.min(f,r),i=Math.max(f,i),u.copy(a).add(s).subtract(c).subtract(l),d.copy(u).subtract(e),f=t.dot(d),r=Math.min(f,r),i=Math.max(f,i),a.copy(u).subtract(s).add(c).add(l),d.copy(u).subtract(e),f=t.dot(d),r=Math.min(f,r),i=Math.max(f,i),a.copy(u).subtract(s).add(c).subtract(l),d.copy(u).subtract(e),f=t.dot(d),r=Math.min(f,r),i=Math.max(f,i),a.copy(u).subtract(s).subtract(c).add(l),d.copy(u).subtract(e),f=t.dot(d),r=Math.min(f,r),i=Math.max(f,i),a.copy(u).subtract(s).subtract(c).subtract(l),d.copy(u).subtract(e),f=t.dot(d),r=Math.min(f,r),i=Math.max(f,i),n[0]=r,n[1]=i,n}transform(e){this.center.transformAsPoint(e);let t=this.halfAxes.getColumn(0,rJ);t.transformAsPoint(e);let n=this.halfAxes.getColumn(1,iJ);n.transformAsPoint(e);let r=this.halfAxes.getColumn(2,aJ);return r.transformAsPoint(e),this.halfAxes=new Bl([...t,...n,...r]),this}getTransform(){throw Error(`not implemented`)}},uJ=new Y,dJ=new Y,fJ=class e{constructor(e=[0,0,1],t=0){this.normal=new Y,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return zc(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=uJ.from(e),this.normal.from(t).normalize();let n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,t,n,r){return this.normal.set(e,t,n),zc(jc(this.normal.len(),1)),this.distance=r,this}clone(){return new e(this.normal,this.distance)}equals(e){return jc(this.distance,e.distance)&&jc(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){let t=dJ.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,t)}projectPointOntoPlane(e,t=[0,0,0]){let n=uJ.from(e),r=this.getPointDistance(n),i=dJ.copy(this.normal).scale(r);return n.subtract(i).to(t)}},pJ=[new Y([1,0,0]),new Y([0,1,0]),new Y([0,0,1])],mJ=new Y,hJ=new Y,gJ=class e{constructor(e=[]){this.planes=e}fromBoundingSphere(e){this.planes.length=2*pJ.length;let t=e.center,n=e.radius,r=0;for(let e of pJ){let i=this.planes[r],a=this.planes[r+1];i||=this.planes[r]=new fJ,a||=this.planes[r+1]=new fJ;let o=mJ.copy(e).scale(-n).add(t);i.fromPointNormal(o,e);let s=mJ.copy(e).scale(n).add(t),c=hJ.copy(e).negate();a.fromPointNormal(s,c),r+=2}return this}computeVisibility(e){let t=Jq.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case Jq.OUTSIDE:return Jq.OUTSIDE;case Jq.INTERSECTING:t=Jq.INTERSECTING;break;default:}return t}computeVisibilityWithPlaneMask(t,n){if(zc(Number.isFinite(n),`parentPlaneMask is required.`),n===e.MASK_OUTSIDE||n===e.MASK_INSIDE)return n;let r=e.MASK_INSIDE,i=this.planes;for(let a=0;as;)DJ(o,bJ),xJ.copy(bJ).transpose(),o.multiplyRight(bJ),o.multiplyLeft(xJ),a.multiplyRight(bJ),++r>2&&(++i,r=0);return t.unitary=a.toTarget(t.unitary),t.diagonal=o.toTarget(t.diagonal),t}function CJ(e){let t=0;for(let n=0;n<9;++n){let r=e[n];t+=r*r}return Math.sqrt(t)}var wJ=[1,0,0],TJ=[2,2,1];function EJ(e){let t=0;for(let n=0;n<3;++n){let r=e[_J.getElementIndex(TJ[n],wJ[n])];t+=2*r*r}return Math.sqrt(t)}function DJ(e,t){let n=td,r=0,i=1;for(let t=0;t<3;++t){let n=Math.abs(e[_J.getElementIndex(TJ[t],wJ[t])]);n>r&&(i=t,r=n)}let a=wJ[i],o=TJ[i],s=1,c=0;if(Math.abs(e[_J.getElementIndex(o,a)])>n){let t=e[_J.getElementIndex(o,o)],n=e[_J.getElementIndex(a,a)],r=e[_J.getElementIndex(o,a)],i=(t-n)/2/r,l;l=i<0?-1/(-i+Math.sqrt(1+i*i)):1/(i+Math.sqrt(1+i*i)),s=1/Math.sqrt(1+l*l),c=l*s}return Bl.IDENTITY.to(t),t[_J.getElementIndex(a,a)]=t[_J.getElementIndex(o,o)]=s,t[_J.getElementIndex(o,a)]=c,t[_J.getElementIndex(a,o)]=-c,t}var OJ=new Y,kJ=new Y,AJ=new Y,jJ=new Y,MJ=new Y,NJ=new Bl,PJ={diagonal:new Bl,unitary:new Bl};function FJ(e,t=new lJ){if(!e||e.length===0)return t.halfAxes=new Bl([0,0,0,0,0,0,0,0,0]),t.center=new Y,t;let n=e.length,r=new Y(0,0,0);for(let t of e)r.add(t);let i=1/n;r.multiplyByScalar(i);let a=0,o=0,s=0,c=0,l=0,u=0;for(let t of e){let e=OJ.copy(t).subtract(r);a+=e.x*e.x,o+=e.x*e.y,s+=e.x*e.z,c+=e.y*e.y,l+=e.y*e.z,u+=e.z*e.z}a*=i,o*=i,s*=i,c*=i,l*=i,u*=i;let d=NJ;d[0]=a,d[1]=o,d[2]=s,d[3]=o,d[4]=c,d[5]=l,d[6]=s,d[7]=l,d[8]=u;let{unitary:f}=SJ(d,PJ),p=t.halfAxes.copy(f),m=p.getColumn(0,AJ),h=p.getColumn(1,jJ),g=p.getColumn(2,MJ),_=-Number.MAX_VALUE,v=-Number.MAX_VALUE,y=-Number.MAX_VALUE,b=Number.MAX_VALUE,x=Number.MAX_VALUE,S=Number.MAX_VALUE;for(let t of e)OJ.copy(t),_=Math.max(OJ.dot(m),_),v=Math.max(OJ.dot(h),v),y=Math.max(OJ.dot(g),y),b=Math.min(OJ.dot(m),b),x=Math.min(OJ.dot(h),x),S=Math.min(OJ.dot(g),S);m=m.multiplyByScalar(.5*(b+_)),h=h.multiplyByScalar(.5*(x+v)),g=g.multiplyByScalar(.5*(S+y)),t.center.copy(m).add(h).add(g);let C=kJ.set(_-b,v-x,y-S).multiplyByScalar(.5),w=new Bl([C[0],0,0,0,C[1],0,0,0,C[2]]);return t.halfAxes.multiplyRight(w),t}var IJ=512,LJ=3,RJ=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],zJ=RJ.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),BJ=zJ.concat([[.25,.5],[.75,.5]]),VJ=class e{constructor(e,t,n){this.x=e,this.y=t,this.z=n}get children(){if(!this._children){let t=this.x*2,n=this.y*2,r=this.z+1;this._children=[new e(t,n,r),new e(t,n+1,r),new e(t+1,n,r),new e(t+1,n+1,r)]}return this._children}update(e){let{viewport:t,cullingVolume:n,elevationBounds:r,minZ:i,maxZ:a,bounds:o,offset:s,project:c}=e,l=this.getBoundingVolume(r,s,c);if(o&&!this.insideBounds(o)||n.computeVisibility(l)<0)return!1;if(!this.childVisible){let{z:e}=this;if(e=i){let n=l.distanceTo(t.cameraPosition)*t.scale/t.height;e+=Math.floor(Math.log2(n))}if(e>=a)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(let t of this.children)t.update(e);return!0}getSelected(e=[]){if(this.selected&&e.push(this),this._children)for(let t of this._children)t.getSelected(e);return e}insideBounds([e,t,n,r]){let i=IJ/2**this.z;return this.x*ie&&(this.y+1)*i>t}getBoundingVolume(e,t,n){if(n){let t=this.z<1?BJ:this.z<2?zJ:RJ,r=[];for(let i of t){let t=eY(this.x+i[0],this.y+i[1],this.z);t[2]=e[0],r.push(n(t)),e[0]!==e[1]&&(t[2]=e[1],r.push(n(t)))}return FJ(r)}let r=IJ/2**this.z,i=this.x*r+t*IJ,a=IJ-(this.y+1)*r;return new Zq([i,a,e[0]],[i+r,a+r,e[1]])}};function HJ(e,t,n,r){let i=e instanceof fv&&e.resolution?e.projectPosition:null,a=new gJ(Object.values(e.getFrustumPlanes()).map(({normal:e,distance:t})=>new fJ(e.clone().negate(),t))),o=e.distanceScales.unitsPerMeter[2],s=n&&n[0]*o||0,c=n&&n[1]*o||0,l=e instanceof yh&&e.pitch<=60?t:0;if(r){let[e,t,n,i]=r,a=rm([e,i]),o=rm([n,t]);r=[a[0],IJ-a[1],o[0],IJ-o[1]]}let u=new VJ(0,0,0),d={viewport:e,project:i,cullingVolume:a,elevationBounds:[s,c],minZ:l,maxZ:t,bounds:r,offset:0};if(u.update(d),e instanceof yh&&e.subViewports&&e.subViewports.length>1){for(d.offset=-1;u.update(d)&&!(--d.offset<-3););for(d.offset=1;u.update(d)&&!(++d.offset>LJ););}return u.getSelected()}var UJ=512,WJ=[-1/0,-1/0,1/0,1/0],GJ={type:`object`,value:null,validate:(e,t)=>t.optional&&e===null||typeof e==`string`||Array.isArray(e)&&e.every(e=>typeof e==`string`),equal:(e,t)=>{if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;re[0])),Math.min(...n.map(e=>e[1])),Math.max(...n.map(e=>e[0])),Math.max(...n.map(e=>e[1]))]}function qJ(e){return Math.abs(e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0))}function JJ(e,t){if(!e||!e.length)return null;let{index:n,id:r}=t;if(Array.isArray(e)){let t=qJ(r)%e.length;e=e[t]}let i=e;for(let e of Object.keys(n)){let t=RegExp(`{${e}}`,`g`);i=i.replace(t,String(n[e]))}return Number.isInteger(n.y)&&Number.isInteger(n.z)&&(i=i.replace(/\{-y\}/g,String(2**n.z-n.y-1))),i}function YJ(e,t,n){let r;if(t&&t.length===2){let[n,i]=t,a=e.getBounds({z:n}),o=e.getBounds({z:i});r=[Math.min(a[0],o[0]),Math.min(a[1],o[1]),Math.max(a[2],o[2]),Math.max(a[3],o[3])]}else r=e.getBounds();return e.isGeospatial?[Math.max(r[0],n[0]),Math.max(r[1],n[1]),Math.min(r[2],n[2]),Math.min(r[3],n[3])]:[Math.max(Math.min(r[0],n[2]),n[0]),Math.max(Math.min(r[1],n[3]),n[1]),Math.min(Math.max(r[2],n[0]),n[2]),Math.min(Math.max(r[3],n[1]),n[3])]}function XJ({viewport:e,z:t,cullRect:n}){return(e.subViewports||[e]).map(e=>ZJ(e,t||0,n))}function ZJ(e,t,n){if(!Array.isArray(t)){let r=n.x-e.x,i=n.y-e.y,{width:a,height:o}=n,s={targetZ:t},c=e.unproject([r,i],s),l=e.unproject([r+a,i],s),u=e.unproject([r,i+o],s),d=e.unproject([r+a,i+o],s);return[Math.min(c[0],l[0],u[0],d[0]),Math.min(c[1],l[1],u[1],d[1]),Math.max(c[0],l[0],u[0],d[0]),Math.max(c[1],l[1],u[1],d[1])]}let r=ZJ(e,t[0],n),i=ZJ(e,t[1],n);return[Math.min(r[0],i[0]),Math.min(r[1],i[1]),Math.max(r[2],i[2]),Math.max(r[3],i[3])]}function QJ(e,t,n){return n?KJ(e,n).map(e=>e*t/UJ):e.map(e=>e*t/UJ)}function $J(e,t){return 2**e*UJ/t}function eY(e,t,n){let r=$J(n,UJ),i=e/r*360-180,a=Math.PI-2*Math.PI*t/r;return[i,180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)))]}function tY(e,t,n,r){let i=$J(n,r);return[e/i*UJ,t/i*UJ]}function nY(e,t,n,r,i=UJ){if(e.isGeospatial){let[e,i]=eY(t,n,r),[a,o]=eY(t+1,n+1,r);return{west:e,north:i,east:a,south:o}}let[a,o]=tY(t,n,r,i),[s,c]=tY(t+1,n+1,r,i);return{left:a,top:o,right:s,bottom:c}}function rY(e,t,n,r,i){let[a,o,s,c]=QJ(YJ(e,null,r),$J(t,n),i),l=[];for(let e=Math.floor(a);et&&(d=t),l!=null&&e.zoomu)return[];let f=i;return o&&s&&i&&!e.isGeospatial&&(f=KJ(i,o)),e.isGeospatial?HJ(e,d,r,i):rY(e,d,a,f||WJ,s)}function aY(e){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}function oY(e){return Number.isFinite(e.west)&&Number.isFinite(e.north)&&Number.isFinite(e.east)&&Number.isFinite(e.south)}function sY(e){let t={},n;return r=>{for(let i in r)if(!cY(r[i],t[i])){n=e(r),t=r;break}return n}}function cY(e,t){if(e===t)return!0;if(Array.isArray(e)){let n=e.length;if(!t||t.length!==n)return!1;for(let r=0;r{}},gY={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:`best-available`,zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0,visibleMinZoom:null,visibleMaxZoom:null,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{}},_Y=class{constructor(e){this._getCullBounds=sY(XJ),this.opts={...gY,...e},this.setOptions(this.opts),this.onTileLoad=e=>{this.opts.onTileLoad?.(e),this.opts.maxCacheByteSize!==null&&(this._cacheByteSize+=e.byteLength,this._resizeCache())},this._requestScheduler=new Kn({throttleRequests:this.opts.maxRequests>0||this.opts.debounceTime>0,maxRequests:this.opts.maxRequests,debounceTime:this.opts.debounceTime}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._zRange=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new wu,this._modelMatrixInverse=new wu}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles!==null&&this._selectedTiles.every(e=>e.isLoaded)}get needsReload(){return this._selectedTiles!==null&&this._selectedTiles.some(e=>e.needsReload)}setOptions(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom)),this._viewport=null}finalize(){for(let e of this._cache.values())e.isLoading&&e.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(let e of this._cache.keys()){let t=this._cache.get(e);!this._selectedTiles||!this._selectedTiles.includes(t)?this._cache.delete(e):t.setNeedsReload()}}update(e,{zRange:t,modelMatrix:n}={zRange:null,modelMatrix:null}){let r=n?new wu(n):new wu,i=!r.equals(this._modelMatrix);if(!this._viewport||!e.equals(this._viewport)||!jc(this._zRange,t)||i){i&&(this._modelMatrixInverse=r.clone().invert(),this._modelMatrix=r),this._viewport=e,this._zRange=t;let n=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:t,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=n.map(e=>this._getTile(e,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(e=>this._getTile(e.index,!0)));let a=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),a&&this._frameNumber++,this._frameNumber}isTileVisible(e,t,n){if(!e.isVisible)return!1;if(t&&this._viewport){let r=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:t}),{bbox:i}=e;for(let[e,t,a,o]of r){let r;if(`west`in i)r=i.weste&&i.southt;else{if(n&&!wu.IDENTITY.equals(n)){let[e,t,r,a]=KJ([i.left,i.top,i.right,i.bottom],n);i={left:e,top:t,right:r,bottom:a}}let s=Math.min(i.top,i.bottom),c=Math.max(i.top,i.bottom);r=i.lefte&&st}if(r)return!0}return!1}return!0}getTileIndices({viewport:e,maxZoom:t,minZoom:n,zRange:r,modelMatrix:i,modelMatrixInverse:a}){let{tileSize:o,extent:s,zoomOffset:c,visibleMinZoom:l,visibleMaxZoom:u}=this.opts;return iY({viewport:e,maxZoom:t,minZoom:n,zRange:r,tileSize:o,extent:s,modelMatrix:i,modelMatrixInverse:a,zoomOffset:c,visibleMinZoom:l,visibleMaxZoom:u})}getTileId(e){return`${e.x}-${e.y}-${e.z}`}getTileZoom(e){return e.z}getTileMetadata(e){let{tileSize:t}=this.opts;return{bbox:nY(this._viewport,e.x,e.y,e.z,t)}}getParentIndex(e){return{x:Math.floor(e.x/2),y:Math.floor(e.y/2),z:e.z-1}}updateTileStates(){let e=this.opts.refinementStrategy||`best-available`,t=Array(this._cache.size),n=0;for(let e of this._cache.values())t[n++]=e.isVisible,e.isSelected=!1,e.isVisible=!1;for(let e of this._selectedTiles)e.isSelected=!0,e.isVisible=!0;(typeof e==`function`?e:hY[e])(Array.from(this._cache.values())),n=0;for(let e of this._cache.values())if(t[n++]!==e.isVisible)return!0;return!1}_pruneRequests(){let{maxRequests:e=0}=this.opts,t=[],n=0;for(let e of this._cache.values())e.isLoading&&(n++,!e.isSelected&&!e.isVisible&&t.push(e));for(;e>0&&n>e&&t.length>0;)t.shift().abort(),n--}_rebuildTree(){let{_cache:e}=this;for(let t of e.values())t.parent=null,t.children&&(t.children.length=0);for(let t of e.values()){let e=this._getNearestAncestor(t);t.parent=e,e?.children&&e.children.push(t)}}_resizeCache(){let{_cache:e,opts:t}=this,n=t.maxCacheSize??(t.maxCacheByteSize===null?mY*this.selectedTiles.length:1/0),r=t.maxCacheByteSize??1/0;if(e.size>n||this._cacheByteSize>r){for(let[i,a]of e)if(!a.isVisible&&!a.isSelected&&(this._cacheByteSize-=t.maxCacheByteSize===null?0:a.byteLength,e.delete(i),this.opts.onTileUnload?.(a)),e.size<=n&&this._cacheByteSize<=r)break;this._rebuildTree(),this._dirty=!0}this._dirty&&=(this._tiles=Array.from(this._cache.values()).sort((e,t)=>e.zoom-t.zoom),!1)}_getTile(e,t){let n=this.getTileId(e),r=this._cache.get(n),i=!1;return!r&&t?(r=new qq(e),Object.assign(r,this.getTileMetadata(r.index)),Object.assign(r,{id:n,zoom:this.getTileZoom(r.index)}),i=!0,this._cache.set(n,r),this._dirty=!0):r&&r.needsReload&&(i=!0),r&&i&&r.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),r}_getNearestAncestor(e){let{_minZoom:t=0}=this,n=e.index;for(;this.getTileZoom(n)>t;){n=this.getParentIndex(n);let e=this._getTile(n);if(e)return e}return null}};function vY(e){for(let t of e)t.state=0;for(let t of e)t.isSelected&&!bY(t)&&xY(t);for(let t of e)t.isVisible=!!(t.state&uY)}function yY(e){for(let t of e)t.state=0;for(let t of e)t.isSelected&&bY(t);let t=Array.from(e).sort((e,t)=>e.zoom-t.zoom);for(let e of t)if(e.isVisible=!!(e.state&uY),e.children&&(e.isVisible||e.state&lY))for(let t of e.children)t.state=lY;else e.isSelected&&xY(e)}function bY(e){let t=e;for(;t;){if(t.isLoaded||t.content)return t.state|=uY,!0;t=t.parent}return!1}function xY(e){for(let t of e.children)t.isLoaded||t.content?t.state|=uY:xY(t)}var SY={TilesetClass:_Y,data:{type:`data`,value:[]},dataComparator:GJ.equal,renderSubLayers:{type:`function`,value:e=>new aL(e)},getTileData:{type:`function`,optional:!0,value:null},onViewportLoad:{type:`function`,optional:!0,value:null},onTileLoad:{type:`function`,value:e=>{}},onTileUnload:{type:`function`,value:e=>{}},onTileError:{type:`function`,value:e=>console.error(e)},extent:{type:`array`,optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:pY,zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0,visibleMinZoom:null,visibleMaxZoom:null},CY=class extends fx{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){this.state?.tileset?.finalize()}get isLoaded(){return!!this.state?.tileset?.selectedTiles?.every(e=>e.isLoaded&&(!e.content||!e.layers||e.layers.every(e=>e.isLoaded)))}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({changeFlags:e}){let{tileset:t}=this.state,n=e.propsOrDataChanged||e.updateTriggersChanged,r=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getTileData);t?n&&(t.setOptions(this._getTilesetOptions()),r?t.reloadAll():t.tiles.forEach(e=>{e.layers=null})):(t=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:t})),this._updateTileset()}_getTilesetOptions(){let{tileSize:e,maxCacheSize:t,maxCacheByteSize:n,refinementStrategy:r,extent:i,maxZoom:a,minZoom:o,maxRequests:s,debounceTime:c,zoomOffset:l,visibleMinZoom:u,visibleMaxZoom:d}=this.props;return{maxCacheSize:t,maxCacheByteSize:n,maxZoom:a,minZoom:o,tileSize:e,refinementStrategy:r,extent:i,maxRequests:s,debounceTime:c,zoomOffset:l,visibleMinZoom:u,visibleMaxZoom:d,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){let e=this.state.tileset,{zRange:t,modelMatrix:n}=this.props,r=e.update(this.context.viewport,{zRange:t,modelMatrix:n}),{isLoaded:i}=e,a=this.state.isLoaded!==i,o=this.state.frameNumber!==r;i&&(a||o)&&this._onViewportLoad(),o&&this.setState({frameNumber:r}),this.state.isLoaded=i}_onViewportLoad(){let{tileset:e}=this.state,{onViewportLoad:t}=this.props;t&&t(e.selectedTiles)}_onTileLoad(e){this.props.onTileLoad(e),e.layers=null,this.setNeedsUpdate()}_onTileError(e,t){this.props.onTileError(e),t.layers=null,this.setNeedsUpdate()}_onTileUnload(e){this.props.onTileUnload(e)}getTileData(e){let{data:t,getTileData:n,fetch:r}=this.props,{signal:i}=e;return e.url=typeof t==`string`||Array.isArray(t)?JJ(t,e):null,n?n(e):r&&e.url?r(e.url,{propName:`data`,layer:this,signal:i}):null}renderSubLayers(e){return this.props.renderSubLayers(e)}getSubLayerPropsByTile(e){return null}getPickingInfo(e){let t=e.sourceLayer,n=t.props.tile,r=e.info;return r.picked&&(r.tile=n),r.sourceTile=n,r.sourceTileSubLayer=t,r}_updateAutoHighlight(e){e.sourceTileSubLayer.updateAutoHighlight(e)}renderLayers(){let{visibleMinZoom:e,visibleMaxZoom:t,minZoom:n,extent:r}=this.props,i=this.context.viewport.zoom;if(e!=null&&it||n!=null&&!r&&i{let t=this.getSubLayerPropsByTile(e);return!e.isLoaded&&!e.content||(e.layers?t&&e.layers[0]&&Object.keys(t).some(n=>e.layers[0].props[n]!==t[n])&&(e.layers=e.layers.map(e=>e.clone(t))):e.layers=M_(this.renderSubLayers({...this.props,...this.getSubLayerProps({id:e.id,updateTriggers:this.props.updateTriggers}),data:e.content,_offset:0,tile:e}),Boolean).map(n=>n.clone({tile:e,...t}))),e.layers})}filterSubLayer({layer:e,cullRect:t}){let{tile:n}=e.props,{modelMatrix:r}=this.props;return this.state.tileset.isTileVisible(n,t,r?new wu(r):null)}};CY.defaultProps=SY,CY.layerName=`TileLayer`;var wY=`layout(std140) uniform tripsUniforms { + bool fadeTrail; + float trailLength; + float currentTime; +} trips; +`,TY={name:`trips`,vs:wY,fs:wY,uniformTypes:{fadeTrail:`f32`,trailLength:`f32`,currentTime:`f32`}},EY={fadeTrail:!0,trailLength:{type:`number`,value:120,min:0},currentTime:{type:`number`,value:0,min:0},getTimestamps:{type:`accessor`,value:e=>e.timestamps}},DY=class extends uF{getShaders(){let e=super.getShaders();return e.inject={"vs:#decl":`in float instanceTimestamps; +in float instanceNextTimestamps; +out float vTime; +`,"vs:#main-end":`vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength; +`,"fs:#decl":`in float vTime; +`,"fs:#main-start":`if(vTime > trips.currentTime || (trips.fadeTrail && (vTime < trips.currentTime - trips.trailLength))) { + discard; +} +`,"fs:DECKGL_FILTER_COLOR":`if(trips.fadeTrail) { + color.a *= 1.0 - (trips.currentTime - vTime) / trips.trailLength; +} +`},e.modules=[...e.modules,TY],e}initializeState(){super.initializeState(),this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:`getTimestamps`,shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}draw(e){let{fadeTrail:t,trailLength:n,currentTime:r}=this.props,i={fadeTrail:t,trailLength:n,currentTime:r};this.state.model.shaderInputs.setProps({trips:i}),super.draw(e)}};DY.layerName=`TripsLayer`,DY.defaultProps=EY;var OY=10;function kY(e,t){let n;return n=e==null?t:typeof e==`object`?{...e,coverage:t}:{getHexagon:e,coverage:t},n}var AY={...UF.defaultProps,highPrecision:`auto`,coverage:{type:`number`,min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:`accessor`,value:e=>e.hexagon},extruded:!0},jY=class e extends fx{initializeState(){e._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}shouldUpdateState({changeFlags:e}){return this._shouldUseHighPrecision()?e.propsOrDataChanged:e.somethingChanged}updateState({props:e,changeFlags:t}){if(e.highPrecision!==!0&&(t.dataChanged||t.updateTriggersChanged&&t.updateTriggersChanged.getHexagon)){let e=this._calculateH3DataProps();this.setState(e)}this._updateVertices(this.context.viewport)}_calculateH3DataProps(){let e=-1,t=!1,n=!1,{iterable:r,objectInfo:i}=Ty(this.props.data);for(let a of r){i.index++;let r=this.props.getHexagon(a,i),o=SW(r);if(e<0){if(e=o,!this.props.highPrecision)break}else if(e!==o){n=!0;break}if(xW(r)){t=!0;break}}return{resolution:e,edgeLengthKM:e>=0?NW(e,`km`):0,hasMultipleRes:n,hasPentagon:t}}_shouldUseHighPrecision(){if(this.props.highPrecision===`auto`){let{resolution:e,hasPentagon:t,hasMultipleRes:n}=this.state,{viewport:r}=this.context;return!!r?.resolution||n||t||e>=0&&e<=5}return this.props.highPrecision}_updateVertices(e){if(this._shouldUseHighPrecision())return;let{resolution:t,edgeLengthKM:n,centerHex:r}=this.state;if(t<0)return;let i=this.props.centerHexagon||CW(e.latitude,e.longitude,t);if(r===i)return;if(r)try{if(jW(r,i)*n{let n=e.projectFlat(t);return[(n[0]-l)/a[0],(n[1]-u)/a[1]]}),this.setState({centerHex:i,vertices:o})}renderLayers(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}_getForwardProps(){let{elevationScale:e,material:t,coverage:n,extruded:r,wireframe:i,stroked:a,filled:o,lineWidthUnits:s,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:u,getFillColor:d,getElevation:f,getLineColor:p,getLineWidth:m,transitions:h,updateTriggers:g}=this.props;return{elevationScale:e,extruded:r,coverage:n,wireframe:i,stroked:a,filled:o,lineWidthUnits:s,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:u,material:t,getElevation:f,getFillColor:d,getLineColor:p,getLineWidth:m,transitions:h,updateTriggers:{getFillColor:g.getFillColor,getElevation:g.getElevation,getLineColor:g.getLineColor,getLineWidth:g.getLineWidth}}}_renderPolygonLayer(){let{data:e,getHexagon:t,updateTriggers:n,coverage:r}=this.props,i=this.getSubLayerClass(`hexagon-cell-hifi`,UF),a=this._getForwardProps();return a.updateTriggers.getPolygon=kY(n.getHexagon,r),new i(a,this.getSubLayerProps({id:`hexagon-cell-hifi`,updateTriggers:a.updateTriggers}),{data:e,_normalize:!1,_windingOrder:`CCW`,positionFormat:`XY`,getPolygon:(e,n)=>VW(BW(t(e,n),r))})}_renderColumnLayer(){let{data:e,getHexagon:t,updateTriggers:n}=this.props,r=this.getSubLayerClass(`hexagon-cell`,JP),i=this._getForwardProps();return i.updateTriggers.getPosition=n.getHexagon,new r(i,this.getSubLayerProps({id:`hexagon-cell`,flatShading:!0,updateTriggers:i.updateTriggers}),{data:e,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:zW.bind(null,t)})}};jY.defaultProps=AY,jY.layerName=`H3HexagonLayer`,jY._checkH3Lib=()=>{};var MY={getHexagons:{type:`accessor`,value:e=>e.hexagons}},NY=class extends cL{initializeState(){jY._checkH3Lib()}updateState({props:e,changeFlags:t}){if(t.dataChanged||t.updateTriggersChanged&&t.updateTriggersChanged.getHexagons){let{data:t,getHexagons:n}=e,r=[],{iterable:i,objectInfo:a}=Ty(t);for(let e of i){a.index++;let t=kW(n(e,a),!0);for(let n of t){for(let e of n)LW(e);r.push(this.getSubLayerRow({polygon:n},e,a.index))}}this.setState({polygons:r})}}indexToBounds(){let{getElevation:e,getFillColor:t,getLineColor:n,getLineWidth:r}=this.props;return{data:this.state.polygons,getPolygon:e=>e.polygon,getElevation:this.getSubLayerAccessor(e),getFillColor:this.getSubLayerAccessor(t),getLineColor:this.getSubLayerAccessor(n),getLineWidth:this.getSubLayerAccessor(r)}}};NY.layerName=`H3ClusterLayer`,NY.defaultProps=MY;var PY=Math.PI/180,FY=new Float32Array(16),IY=new Float32Array(12);function LY(e,t,n){let r=t[0]*PY,i=t[1]*PY,a=t[2]*PY,o=Math.sin(a),s=Math.sin(r),c=Math.sin(i),l=Math.cos(a),u=Math.cos(r),d=Math.cos(i),f=n[0],p=n[1],m=n[2];e[0]=f*d*u,e[1]=f*c*u,e[2]=f*-s,e[3]=p*(-c*l+d*s*o),e[4]=p*(d*l+c*s*o),e[5]=p*u*o,e[6]=m*(c*o+d*s*l),e[7]=m*(-d*o+c*s*l),e[8]=m*u*l}function RY(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var zY={size:12,accessor:[`getOrientation`,`getScale`,`getTranslation`,`getTransformMatrix`],shaderAttributes:{instanceModelMatrixCol0:{size:3,elementOffset:0},instanceModelMatrixCol1:{size:3,elementOffset:3},instanceModelMatrixCol2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(e,{startRow:t,endRow:n}){let{data:r,getOrientation:i,getScale:a,getTranslation:o,getTransformMatrix:s}=this.props,c=Array.isArray(s),l=c&&s.length===16,u=Array.isArray(a),d=Array.isArray(i),f=Array.isArray(o),p=l||!c&&!!s(r[0]);p?e.constant=l:e.constant=d&&u&&f;let m=e.value;if(e.constant){let t;p?(FY.set(s),t=RY(FY)):(t=IY,LY(t,i,a),t.set(o,9)),e.value=new Float32Array(t)}else{let c=t*e.size,{iterable:h,objectInfo:g}=Ty(r,t,n);for(let e of h){g.index++;let t;if(p)FY.set(l?s:s(e,g)),t=RY(FY);else{t=IY;let n=d?i:i(e,g),r=u?a:a(e,g);LY(t,n,r),t.set(f?o:o(e,g),9)}m[c++]=t[0],m[c++]=t[1],m[c++]=t[2],m[c++]=t[3],m[c++]=t[4],m[c++]=t[5],m[c++]=t[6],m[c++]=t[7],m[c++]=t[8],m[c++]=t[9],m[c++]=t[10],m[c++]=t[11]}}}};function BY(e,t){return t===`cartesian`||t===`meter-offsets`||t==="default"&&!e.isGeospatial}var VY=`layout(std140) uniform simpleMeshUniforms { + float sizeScale; + bool composeModelMatrix; + bool hasTexture; + bool flatShading; +} simpleMesh; +`,HY={name:`simpleMesh`,vs:VY,fs:VY,uniformTypes:{sizeScale:`f32`,composeModelMatrix:`f32`,hasTexture:`f32`,flatShading:`f32`}},UY=`#version 300 es +#define SHADER_NAME simple-mesh-layer-vs +in vec3 positions; +in vec3 normals; +in vec3 colors; +in vec2 texCoords; +in vec3 instancePositions; +in vec3 instancePositions64Low; +in vec4 instanceColors; +in vec3 instancePickingColors; +in vec3 instanceModelMatrixCol0; +in vec3 instanceModelMatrixCol1; +in vec3 instanceModelMatrixCol2; +in vec3 instanceTranslation; +out vec2 vTexCoord; +out vec3 cameraPosition; +out vec3 normals_commonspace; +out vec4 position_commonspace; +out vec4 vColor; +void main(void) { +geometry.worldPosition = instancePositions; +geometry.uv = texCoords; +geometry.pickingColor = instancePickingColors; +vTexCoord = texCoords; +cameraPosition = project.cameraPosition; +vColor = vec4(colors * instanceColors.rgb, instanceColors.a); +mat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2); +vec3 pos = (instanceModelMatrix * positions) * simpleMesh.sizeScale + instanceTranslation; +if (simpleMesh.composeModelMatrix) { +DECKGL_FILTER_SIZE(pos, geometry); +normals_commonspace = project_normal(instanceModelMatrix * normals); +geometry.worldPosition += pos; +gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace); +geometry.position = position_commonspace; +} +else { +pos = project_size(pos); +DECKGL_FILTER_SIZE(pos, geometry); +gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace); +geometry.position = position_commonspace; +normals_commonspace = project_normal(instanceModelMatrix * normals); +} +geometry.normal = normals_commonspace; +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +DECKGL_FILTER_COLOR(vColor, geometry); +} +`,WY=`#version 300 es +#define SHADER_NAME simple-mesh-layer-fs +precision highp float; +uniform sampler2D sampler; +in vec2 vTexCoord; +in vec3 cameraPosition; +in vec3 normals_commonspace; +in vec4 position_commonspace; +in vec4 vColor; +out vec4 fragColor; +void main(void) { +geometry.uv = vTexCoord; +vec3 normal; +if (simpleMesh.flatShading) { +normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz))); +} else { +normal = normals_commonspace; +} +vec4 color = simpleMesh.hasTexture ? texture(sampler, vTexCoord) : vColor; +DECKGL_FILTER_COLOR(color, geometry); +vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal); +fragColor = vec4(lightColor, color.a * layer.opacity); +} +`;function GY(e){let t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],c=s&&s.length;for(let e=0;ei?c:i,a=l>a?l:a,o=u>o?u:o}return[[t,n,r],[i,a,o]]}function KY(e){let t=e.positions||e.POSITION;fo.assert(t,`no "postions" or "POSITION" attribute in mesh`);let n=t.value.length/t.size,r=e.COLOR_0||e.colors;r||={size:3,value:new Float32Array(n*3).fill(1)};let i=e.NORMAL||e.normals;i||={size:3,value:new Float32Array(n*3).fill(0)};let a=e.TEXCOORD_0||e.texCoords;return a||={size:2,value:new Float32Array(n*2).fill(0)},{positions:t,colors:r,normals:i,texCoords:a}}function qY(e){return e instanceof Jg?(e.attributes=KY(e.attributes),e):e.attributes?new Jg({...e,topology:`triangle-list`,attributes:KY(e.attributes)}):new Jg({topology:`triangle-list`,attributes:KY(e)})}var JY={mesh:{type:`object`,value:null,async:!0},texture:{type:`image`,value:null,async:!0},sizeScale:{type:`number`,value:1,min:0},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:`accessor`,value:e=>e.position},getColor:{type:`accessor`,value:[0,0,0,255]},getOrientation:{type:`accessor`,value:[0,0,0]},getScale:{type:`accessor`,value:[1,1,1]},getTranslation:{type:`accessor`,value:[0,0,0]},getTransformMatrix:{type:`accessor`,value:[]},textureParameters:{type:`object`,ignore:!0,value:null}},YY=class extends dx{getShaders(){return super.getShaders({vs:UY,fs:WY,modules:[Bp,Ld,jm,HY]})}getBounds(){if(this.props._instanced)return super.getBounds();let e=this.state.positionBounds;if(e)return e;let{mesh:t}=this.props;if(!t)return null;if(e=t.header?.boundingBox,!e){let{attributes:n}=qY(t);n.POSITION=n.POSITION||n.positions,e=GY(n)}return this.state.positionBounds=e,e}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:`float64`,fp64:this.use64bitPositions(),size:3,accessor:`getPosition`},instanceColors:{type:`unorm8`,transition:!0,size:this.props.colorFormat.length,accessor:`getColor`,defaultValue:[0,0,0,255]},instanceModelMatrix:zY}),this.setState({emptyTexture:this.context.device.createTexture({data:new Uint8Array(4),width:1,height:1})})}updateState(e){super.updateState(e);let{props:t,oldProps:n,changeFlags:r}=e;if(t.mesh!==n.mesh||r.extensionsChanged){if(this.state.positionBounds=null,this.state.model?.destroy(),t.mesh){this.state.model=this.getModel(t.mesh);let e=t.mesh.attributes||t.mesh;this.setState({hasNormals:!!(e.NORMAL||e.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==n.texture&&t.texture instanceof Se&&this.setTexture(t.texture),this.state.model&&this.state.model.setTopology(this.props.wireframe?`line-strip`:`triangle-list`)}finalizeState(e){super.finalizeState(e),this.state.emptyTexture.delete()}draw({uniforms:e}){let{model:t}=this.state;if(!t)return;let{viewport:n,renderPass:r}=this.context,{sizeScale:i,coordinateSystem:a,_instanced:o}=this.props,s={sizeScale:i,composeModelMatrix:!o||BY(n,a),flatShading:!this.state.hasNormals};t.shaderInputs.setProps({simpleMesh:s}),t.draw(r)}get isLoaded(){return!!(this.state?.model&&super.isLoaded)}getModel(e){let t=new Rg(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:qY(e),isInstanced:!0}),{texture:n}=this.props,{emptyTexture:r}=this.state,i={sampler:n||r,hasTexture:!!n};return t.shaderInputs.setProps({simpleMesh:i}),t}setTexture(e){let{emptyTexture:t,model:n}=this.state;if(n){let r={sampler:e||t,hasTexture:!!e};n.shaderInputs.setProps({simpleMesh:r})}}};YY.defaultProps=JY,YY.layerName=`SimpleMeshLayer`;var XY;(function(e){e[e.POINTS=0]=`POINTS`,e[e.LINES=1]=`LINES`,e[e.LINE_LOOP=2]=`LINE_LOOP`,e[e.LINE_STRIP=3]=`LINE_STRIP`,e[e.TRIANGLES=4]=`TRIANGLES`,e[e.TRIANGLE_STRIP=5]=`TRIANGLE_STRIP`,e[e.TRIANGLE_FAN=6]=`TRIANGLE_FAN`,e[e.ONE=1]=`ONE`,e[e.SRC_ALPHA=770]=`SRC_ALPHA`,e[e.ONE_MINUS_SRC_ALPHA=771]=`ONE_MINUS_SRC_ALPHA`,e[e.FUNC_ADD=32774]=`FUNC_ADD`,e[e.LINEAR=9729]=`LINEAR`,e[e.NEAREST=9728]=`NEAREST`,e[e.NEAREST_MIPMAP_NEAREST=9984]=`NEAREST_MIPMAP_NEAREST`,e[e.LINEAR_MIPMAP_NEAREST=9985]=`LINEAR_MIPMAP_NEAREST`,e[e.NEAREST_MIPMAP_LINEAR=9986]=`NEAREST_MIPMAP_LINEAR`,e[e.LINEAR_MIPMAP_LINEAR=9987]=`LINEAR_MIPMAP_LINEAR`,e[e.TEXTURE_MIN_FILTER=10241]=`TEXTURE_MIN_FILTER`,e[e.TEXTURE_WRAP_S=10242]=`TEXTURE_WRAP_S`,e[e.TEXTURE_WRAP_T=10243]=`TEXTURE_WRAP_T`,e[e.REPEAT=10497]=`REPEAT`,e[e.CLAMP_TO_EDGE=33071]=`CLAMP_TO_EDGE`,e[e.MIRRORED_REPEAT=33648]=`MIRRORED_REPEAT`,e[e.UNPACK_FLIP_Y_WEBGL=37440]=`UNPACK_FLIP_Y_WEBGL`})(XY||={});function ZY(e){return{addressModeU:QY(e.wrapS),addressModeV:QY(e.wrapT),magFilter:$Y(e.magFilter),...eX(e.minFilter)}}function QY(e){switch(e){case XY.CLAMP_TO_EDGE:return`clamp-to-edge`;case XY.REPEAT:return`repeat`;case XY.MIRRORED_REPEAT:return`mirror-repeat`;default:return}}function $Y(e){switch(e){case XY.NEAREST:return`nearest`;case XY.LINEAR:return`linear`;default:return}}function eX(e){switch(e){case XY.NEAREST:return{minFilter:`nearest`};case XY.LINEAR:return{minFilter:`linear`};case XY.NEAREST_MIPMAP_NEAREST:return{minFilter:`nearest`,mipmapFilter:`nearest`};case XY.LINEAR_MIPMAP_NEAREST:return{minFilter:`linear`,mipmapFilter:`nearest`};case XY.NEAREST_MIPMAP_LINEAR:return{minFilter:`nearest`,mipmapFilter:`linear`};case XY.LINEAR_MIPMAP_LINEAR:return{minFilter:`linear`,mipmapFilter:`linear`};default:return{}}}var tX=[rX(`baseColor`,`pbr_baseColorSampler`,`baseColorTexture`,[`pbrMetallicRoughness`,`baseColorTexture`]),rX(`metallicRoughness`,`pbr_metallicRoughnessSampler`,`metallicRoughnessTexture`,[`pbrMetallicRoughness`,`metallicRoughnessTexture`]),rX(`normal`,`pbr_normalSampler`,`normalTexture`,[`normalTexture`]),rX(`occlusion`,`pbr_occlusionSampler`,`occlusionTexture`,[`occlusionTexture`]),rX(`emissive`,`pbr_emissiveSampler`,`emissiveTexture`,[`emissiveTexture`]),rX(`specularColor`,`pbr_specularColorSampler`,`KHR_materials_specular.specularColorTexture`,[`extensions`,`KHR_materials_specular`,`specularColorTexture`]),rX(`specularIntensity`,`pbr_specularIntensitySampler`,`KHR_materials_specular.specularTexture`,[`extensions`,`KHR_materials_specular`,`specularTexture`]),rX(`transmission`,`pbr_transmissionSampler`,`KHR_materials_transmission.transmissionTexture`,[`extensions`,`KHR_materials_transmission`,`transmissionTexture`]),rX(`thickness`,`pbr_thicknessSampler`,`KHR_materials_volume.thicknessTexture`,[`extensions`,`KHR_materials_volume`,`thicknessTexture`]),rX(`clearcoat`,`pbr_clearcoatSampler`,`KHR_materials_clearcoat.clearcoatTexture`,[`extensions`,`KHR_materials_clearcoat`,`clearcoatTexture`]),rX(`clearcoatRoughness`,`pbr_clearcoatRoughnessSampler`,`KHR_materials_clearcoat.clearcoatRoughnessTexture`,[`extensions`,`KHR_materials_clearcoat`,`clearcoatRoughnessTexture`]),rX(`clearcoatNormal`,`pbr_clearcoatNormalSampler`,`KHR_materials_clearcoat.clearcoatNormalTexture`,[`extensions`,`KHR_materials_clearcoat`,`clearcoatNormalTexture`]),rX(`sheenColor`,`pbr_sheenColorSampler`,`KHR_materials_sheen.sheenColorTexture`,[`extensions`,`KHR_materials_sheen`,`sheenColorTexture`]),rX(`sheenRoughness`,`pbr_sheenRoughnessSampler`,`KHR_materials_sheen.sheenRoughnessTexture`,[`extensions`,`KHR_materials_sheen`,`sheenRoughnessTexture`]),rX(`iridescence`,`pbr_iridescenceSampler`,`KHR_materials_iridescence.iridescenceTexture`,[`extensions`,`KHR_materials_iridescence`,`iridescenceTexture`]),rX(`iridescenceThickness`,`pbr_iridescenceThicknessSampler`,`KHR_materials_iridescence.iridescenceThicknessTexture`,[`extensions`,`KHR_materials_iridescence`,`iridescenceThicknessTexture`]),rX(`anisotropy`,`pbr_anisotropySampler`,`KHR_materials_anisotropy.anisotropyTexture`,[`extensions`,`KHR_materials_anisotropy`,`anisotropyTexture`])],nX=new Map(tX.map(e=>[e.slot,e]));function rX(e,t,n,r){return{slot:e,binding:t,displayName:n,pathSegments:r,uvSetUniform:`${e}UVSet`,uvTransformUniform:`${e}UVTransform`}}function iX(){return tX}function aX(e){let t=nX.get(e);if(!t)throw Error(`Unknown PBR texture transform slot ${e}`);return t}function oX(e){let t=e?.extensions?.KHR_texture_transform;return{offset:t?.offset?[t.offset[0],t.offset[1]]:[0,0],rotation:t?.rotation??0,scale:t?.scale?[t.scale[0],t.scale[1]]:[1,1]}}function sX(e){return e?.extensions?.KHR_texture_transform?.texCoord??e?.texCoord??0}function cX(e){return tX.find(t=>t.pathSegments.length===e.length&&t.pathSegments.every((t,n)=>e[n]===t))||null}function lX(e){let t=new Bl().set(1,0,0,0,1,0,e.offset[0],e.offset[1],1),n=new Bl().set(Math.cos(e.rotation),Math.sin(e.rotation),0,-Math.sin(e.rotation),Math.cos(e.rotation),0,0,0,1),r=new Bl().set(e.scale[0],0,0,0,e.scale[1],0,0,0,1);return Array.from(t.multiplyRight(n).multiplyRight(r))}function uX(e,t){let n=new Bl(lX(e)),r=new Bl(lX(t)),i=new Bl(n).invert();return Array.from(r.multiplyRight(i))}function dX(e,t,n,r){let i={defines:{MANUAL_SRGB:!0,SRGB_FAST_APPROXIMATION:!0},bindings:{},uniforms:{camera:[0,0,0],metallicRoughnessValues:[1,1]},parameters:{},glParameters:{},generatedTextures:[]};i.defines.USE_TEX_LOD=!0;let{imageBasedLightingEnvironment:a}=r;return a&&(i.bindings.pbr_diffuseEnvSampler=a.diffuseEnvSampler.texture,i.bindings.pbr_specularEnvSampler=a.specularEnvSampler.texture,i.bindings.pbr_brdfLUT=a.brdfLutTexture.texture,i.uniforms.IBLenabled=!0,i.uniforms.scaleIBLAmbient=[1,1]),r?.pbrDebug&&(i.defines.PBR_DEBUG=!0,i.uniforms.scaleDiffBaseMR=[0,0,0,0],i.uniforms.scaleFGDSpec=[0,0,0,0]),n.NORMAL&&(i.defines.HAS_NORMALS=!0),n.TANGENT&&r?.useTangents&&(i.defines.HAS_TANGENTS=!0),n.TEXCOORD_0&&(i.defines.HAS_UV=!0),n.TEXCOORD_1&&(i.defines.HAS_UV_1=!0),n.JOINTS_0&&n.WEIGHTS_0&&(i.defines.HAS_SKIN=!0),n.COLOR_0&&(i.defines.HAS_COLORS=!0),r?.imageBasedLightingEnvironment&&(i.defines.USE_IBL=!0),r?.lights&&(i.defines.USE_LIGHTS=!0),t&&(r.validateAttributes!==!1&&fX(t,n),hX(e,t,i,n,r.gltf)),i}function fX(e,t){let n=pX(e,0);n.length>0&&!t.TEXCOORD_0&&z.warn(`glTF material uses ${n.join(`, `)} but primitive is missing TEXCOORD_0; textured shading will sample the default UV coordinates`)();let r=pX(e,1);if(r.length>0&&!t.TEXCOORD_1&&z.warn(`glTF material uses ${r.join(`, `)} with TEXCOORD_1 but primitive is missing TEXCOORD_1; those textures will be skipped`)(),e.unlit||e.extensions?.KHR_materials_unlit||t.NORMAL)return;let i=e.normalTexture?`lit PBR shading with normalTexture`:`lit PBR shading`;z.warn(`glTF primitive is missing NORMAL while using ${i}; shading will fall back to geometric normals`)()}function pX(e,t){let n=[];for(let r of iX()){let i=mX(e,r.pathSegments);i&&sX(i)===t&&n.push(r.displayName)}return n}function mX(e,t){let n=e;for(let e of t)if(n=n?.[e],!n)return null;return n}function hX(e,t,n,r,i){if(n.uniforms.unlit=!!(t.unlit||t.extensions?.KHR_materials_unlit),t.pbrMetallicRoughness&&vX(e,t.pbrMetallicRoughness,n,r,i),t.normalTexture){AX(e,t.normalTexture,`pbr_normalSampler`,n,{featureOptions:{define:`HAS_NORMALMAP`,enabledUniformName:`normalMapEnabled`},gltf:i,attributes:r,textureTransformSlot:`normal`});let{scale:a=1}=t.normalTexture;n.uniforms.normalScale=a}if(t.occlusionTexture){AX(e,t.occlusionTexture,`pbr_occlusionSampler`,n,{featureOptions:{define:`HAS_OCCLUSIONMAP`,enabledUniformName:`occlusionMapEnabled`},gltf:i,attributes:r,textureTransformSlot:`occlusion`});let{strength:a=1}=t.occlusionTexture;n.uniforms.occlusionStrength=a}switch(n.uniforms.emissiveFactor=t.emissiveFactor||[0,0,0],t.emissiveTexture&&AX(e,t.emissiveTexture,`pbr_emissiveSampler`,n,{featureOptions:{define:`HAS_EMISSIVEMAP`,enabledUniformName:`emissiveMapEnabled`},gltf:i,attributes:r,textureTransformSlot:`emissive`}),yX(e,t.extensions,n,i,r),t.alphaMode||`OPAQUE`){case`OPAQUE`:break;case`MASK`:{let{alphaCutoff:e=.5}=t;n.defines.ALPHA_CUTOFF=!0,n.uniforms.alphaCutoffEnabled=!0,n.uniforms.alphaCutoff=e;break}case`BLEND`:z.warn(`glTF BLEND alphaMode might not work well because it requires mesh sorting`)(),gX(n);break}}function gX(e){e.parameters.blend=!0,e.parameters.blendColorOperation=`add`,e.parameters.blendColorSrcFactor=`src-alpha`,e.parameters.blendColorDstFactor=`one-minus-src-alpha`,e.parameters.blendAlphaOperation=`add`,e.parameters.blendAlphaSrcFactor=`one`,e.parameters.blendAlphaDstFactor=`one-minus-src-alpha`,e.glParameters.blend=!0,e.glParameters.blendEquation=XY.FUNC_ADD,e.glParameters.blendFunc=[XY.SRC_ALPHA,XY.ONE_MINUS_SRC_ALPHA,XY.ONE,XY.ONE_MINUS_SRC_ALPHA]}function _X(e){e.parameters.blend=!0,e.parameters.depthWriteEnabled=!1,e.parameters.blendColorOperation=`add`,e.parameters.blendColorSrcFactor=`one`,e.parameters.blendColorDstFactor=`one-minus-src-alpha`,e.parameters.blendAlphaOperation=`add`,e.parameters.blendAlphaSrcFactor=`one`,e.parameters.blendAlphaDstFactor=`one-minus-src-alpha`,e.glParameters.blend=!0,e.glParameters.depthMask=!1,e.glParameters.blendEquation=XY.FUNC_ADD,e.glParameters.blendFunc=[XY.ONE,XY.ONE_MINUS_SRC_ALPHA,XY.ONE,XY.ONE_MINUS_SRC_ALPHA]}function vX(e,t,n,r,i){t.baseColorTexture&&AX(e,t.baseColorTexture,`pbr_baseColorSampler`,n,{featureOptions:{define:`HAS_BASECOLORMAP`,enabledUniformName:`baseColorMapEnabled`},gltf:i,attributes:r,textureTransformSlot:`baseColor`}),n.uniforms.baseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&AX(e,t.metallicRoughnessTexture,`pbr_metallicRoughnessSampler`,n,{featureOptions:{define:`HAS_METALROUGHNESSMAP`,enabledUniformName:`metallicRoughnessMapEnabled`},gltf:i,attributes:r,textureTransformSlot:`metallicRoughness`});let{metallicFactor:a=1,roughnessFactor:o=1}=t;n.uniforms.metallicRoughnessValues=[a,o]}function yX(e,t,n,r,i={}){t&&(bX(t)&&(n.defines.USE_MATERIAL_EXTENSIONS=!0),xX(e,t.KHR_materials_specular,n,r,i),SX(t.KHR_materials_ior,n),CX(e,t.KHR_materials_transmission,n,r,i),wX(e,t.KHR_materials_volume,n,r,i),TX(e,t.KHR_materials_clearcoat,n,r,i),EX(e,t.KHR_materials_sheen,n,r,i),DX(e,t.KHR_materials_iridescence,n,r,i),OX(e,t.KHR_materials_anisotropy,n,r,i),kX(t.KHR_materials_emissive_strength,n))}function bX(e){return!!(e.KHR_materials_specular||e.KHR_materials_ior||e.KHR_materials_transmission||e.KHR_materials_volume||e.KHR_materials_clearcoat||e.KHR_materials_sheen||e.KHR_materials_iridescence||e.KHR_materials_anisotropy)}function xX(e,t,n,r,i={}){t&&(t.specularColorFactor&&(n.uniforms.specularColorFactor=t.specularColorFactor),t.specularFactor!==void 0&&(n.uniforms.specularIntensityFactor=t.specularFactor),t.specularColorTexture&&AX(e,t.specularColorTexture,`pbr_specularColorSampler`,n,{featureOptions:{define:`HAS_SPECULARCOLORMAP`,enabledUniformName:`specularColorMapEnabled`},gltf:r,attributes:i,textureTransformSlot:`specularColor`}),t.specularTexture&&AX(e,t.specularTexture,`pbr_specularIntensitySampler`,n,{featureOptions:{define:`HAS_SPECULARINTENSITYMAP`,enabledUniformName:`specularIntensityMapEnabled`},gltf:r,attributes:i,textureTransformSlot:`specularIntensity`}))}function SX(e,t){e?.ior!==void 0&&(t.uniforms.ior=e.ior)}function CX(e,t,n,r,i={}){t&&(t.transmissionFactor!==void 0&&(n.uniforms.transmissionFactor=t.transmissionFactor),t.transmissionTexture&&AX(e,t.transmissionTexture,`pbr_transmissionSampler`,n,{featureOptions:{define:`HAS_TRANSMISSIONMAP`,enabledUniformName:`transmissionMapEnabled`},gltf:r,attributes:i,textureTransformSlot:`transmission`}),((t.transmissionFactor??0)>0||t.transmissionTexture)&&(z.warn(`KHR_materials_transmission uses a premultiplied-alpha blending approximation and may require mesh sorting`)(),_X(n)))}function wX(e,t,n,r,i={}){t&&(t.thicknessFactor!==void 0&&(n.uniforms.thicknessFactor=t.thicknessFactor),t.thicknessTexture&&AX(e,t.thicknessTexture,`pbr_thicknessSampler`,n,{featureOptions:{define:`HAS_THICKNESSMAP`},gltf:r,attributes:i,textureTransformSlot:`thickness`}),t.attenuationDistance!==void 0&&(n.uniforms.attenuationDistance=t.attenuationDistance),t.attenuationColor&&(n.uniforms.attenuationColor=t.attenuationColor))}function TX(e,t,n,r,i={}){t&&(t.clearcoatFactor!==void 0&&(n.uniforms.clearcoatFactor=t.clearcoatFactor),t.clearcoatRoughnessFactor!==void 0&&(n.uniforms.clearcoatRoughnessFactor=t.clearcoatRoughnessFactor),t.clearcoatTexture&&AX(e,t.clearcoatTexture,`pbr_clearcoatSampler`,n,{featureOptions:{define:`HAS_CLEARCOATMAP`,enabledUniformName:`clearcoatMapEnabled`},gltf:r,attributes:i,textureTransformSlot:`clearcoat`}),t.clearcoatRoughnessTexture&&AX(e,t.clearcoatRoughnessTexture,`pbr_clearcoatRoughnessSampler`,n,{featureOptions:{define:`HAS_CLEARCOATROUGHNESSMAP`,enabledUniformName:`clearcoatRoughnessMapEnabled`},gltf:r,attributes:i,textureTransformSlot:`clearcoatRoughness`}),t.clearcoatNormalTexture&&AX(e,t.clearcoatNormalTexture,`pbr_clearcoatNormalSampler`,n,{featureOptions:{define:`HAS_CLEARCOATNORMALMAP`},gltf:r,attributes:i,textureTransformSlot:`clearcoatNormal`}))}function EX(e,t,n,r,i={}){t&&(t.sheenColorFactor&&(n.uniforms.sheenColorFactor=t.sheenColorFactor),t.sheenRoughnessFactor!==void 0&&(n.uniforms.sheenRoughnessFactor=t.sheenRoughnessFactor),t.sheenColorTexture&&AX(e,t.sheenColorTexture,`pbr_sheenColorSampler`,n,{featureOptions:{define:`HAS_SHEENCOLORMAP`,enabledUniformName:`sheenColorMapEnabled`},gltf:r,attributes:i,textureTransformSlot:`sheenColor`}),t.sheenRoughnessTexture&&AX(e,t.sheenRoughnessTexture,`pbr_sheenRoughnessSampler`,n,{featureOptions:{define:`HAS_SHEENROUGHNESSMAP`,enabledUniformName:`sheenRoughnessMapEnabled`},gltf:r,attributes:i,textureTransformSlot:`sheenRoughness`}))}function DX(e,t,n,r,i={}){t&&(t.iridescenceFactor!==void 0&&(n.uniforms.iridescenceFactor=t.iridescenceFactor),t.iridescenceIor!==void 0&&(n.uniforms.iridescenceIor=t.iridescenceIor),(t.iridescenceThicknessMinimum!==void 0||t.iridescenceThicknessMaximum!==void 0)&&(n.uniforms.iridescenceThicknessRange=[t.iridescenceThicknessMinimum??100,t.iridescenceThicknessMaximum??400]),t.iridescenceTexture&&AX(e,t.iridescenceTexture,`pbr_iridescenceSampler`,n,{featureOptions:{define:`HAS_IRIDESCENCEMAP`,enabledUniformName:`iridescenceMapEnabled`},gltf:r,attributes:i,textureTransformSlot:`iridescence`}),t.iridescenceThicknessTexture&&AX(e,t.iridescenceThicknessTexture,`pbr_iridescenceThicknessSampler`,n,{featureOptions:{define:`HAS_IRIDESCENCETHICKNESSMAP`},gltf:r,attributes:i,textureTransformSlot:`iridescenceThickness`}))}function OX(e,t,n,r,i={}){t&&(t.anisotropyStrength!==void 0&&(n.uniforms.anisotropyStrength=t.anisotropyStrength),t.anisotropyRotation!==void 0&&(n.uniforms.anisotropyRotation=t.anisotropyRotation),t.anisotropyTexture&&AX(e,t.anisotropyTexture,`pbr_anisotropySampler`,n,{featureOptions:{define:`HAS_ANISOTROPYMAP`,enabledUniformName:`anisotropyMapEnabled`},gltf:r,attributes:i,textureTransformSlot:`anisotropy`}))}function kX(e,t){e?.emissiveStrength!==void 0&&(t.uniforms.emissiveStrength=e.emissiveStrength)}function AX(e,t,n,r,i={}){let{featureOptions:a={},gltf:o,attributes:s={},textureTransformSlot:c}=i,{define:l,enabledUniformName:u}=a,d=sX(t);if(d>1){z.warn(`Skipping ${String(n)} because ${d} is not supported; only TEXCOORD_0 and TEXCOORD_1 are currently available`)();return}if(d===1&&!s.TEXCOORD_1){z.warn(`Skipping ${String(n)} because it requires TEXCOORD_1 but the primitive does not provide TEXCOORD_1`)();return}let f=jX(t,o),p=f.texture?.source?.image;if(!p){z.warn(`Skipping unresolved glTF texture for ${String(n)}`)();return}let m={wrapS:10497,wrapT:10497,minFilter:9729,magFilter:9729,...f?.texture?.sampler},h={id:f.uniformName||f.id,sampler:ZY(m)},g;if(p.compressed)g=FX(e,p,h);else{let{width:t,height:n}=e.getExternalImageSize(p);g=e.createTexture({...h,width:t,height:n,data:p})}if(r.bindings[n]=g,l&&(r.defines[l]=!0),u&&(r.uniforms[u]=!0),c){let e=aX(c);r.uniforms[e.uvSetUniform]=d,r.uniforms[e.uvTransformUniform]=lX(oX(t))}r.generatedTextures.push(g)}function jX(e,t){if(e.texture||e.index===void 0||!t?.textures)return e;let n=t.textures[e.index];return n?`texture`in n&&n.texture?{...n,...e,texture:n.texture}:`source`in n?{...e,texture:n}:e:e}function MX(e,t){return e.createTexture({...t,format:`rgba8unorm`,width:1,height:1,mipLevels:1})}function NX(e){return e.textureFormat}function PX(e,t,n){let{blockWidth:r=1,blockHeight:i=1}=Ie.getInfo(n),a=1;for(let n=1;;n++){let o=Math.max(1,e>>n),s=Math.max(1,t>>n);if(o>e),c=Math.max(1,o>>e);if(t.width!==i||t.height!==c){z.warn(`createCompressedTexture: mip level ${e} dimensions ${t.width}x${t.height} don't match expected ${i}x${c}, truncating`)();break}u++}let d=e.createTexture({...n,format:s,usage:Se.TEXTURE|Se.COPY_DST,width:a,height:o,mipLevels:u,data:i.data});for(let e=1;ee*255):sd(e,!1)}function RX(e,t,n,r){let i=WX(e),a=[1,0,0];return r!==void 0&&r>0&&(a=[1,0,1/(r*r)]),{type:`point`,position:i,color:t,intensity:n,attenuation:a}}function zX(e,t,n){return{type:`directional`,direction:GX(e),color:t,intensity:n}}function BX(e,t,n,r,i={}){let a=WX(e),o=GX(e),s=[1,0,0];return r!==void 0&&r>0&&(s=[1,0,1/(r*r)]),{type:`spot`,position:a,direction:o,color:t,intensity:n,attenuation:s,innerConeAngle:i.innerConeAngle??0,outerConeAngle:i.outerConeAngle??Math.PI/4}}function VX(e){let t=new Map;for(let n of e)for(let e of n.children||[])t.set(e.id,n);return t}function HX(e,t,n){let r=n.get(e.id);if(r)return r;let i=UX(e),a=t.get(e.id),o=a?new wu(HX(a,t,n)).multiplyRight(i):i;return n.set(e.id,o),o}function UX(e){if(e.matrix)return new wu(e.matrix);let t=new wu;return e.translation&&t.translate(e.translation),e.rotation&&t.multiplyRight(new wu().fromQuaternion(e.rotation)),e.scale&&t.scale(e.scale),t}function WX(e){return e.transformAsPoint([0,0,0])}function GX(e){return e.transformDirection([0,0,-1])}function KX(e){switch(e){case XY.POINTS:return`point-list`;case XY.LINES:return`line-list`;case XY.LINE_STRIP:return`line-strip`;case XY.TRIANGLES:return`triangle-list`;case XY.TRIANGLE_STRIP:return`triangle-strip`;default:throw Error(String(e))}}var qX=` +struct VertexInputs { + @location(0) positions: vec3f, +#ifdef HAS_NORMALS + @location(1) normals: vec3f, +#endif +#ifdef HAS_TANGENTS + @location(2) TANGENT: vec4f, +#endif +#ifdef HAS_UV + @location(3) texCoords: vec2f, +#endif +#ifdef HAS_UV_1 + @location(4) texCoords1: vec2f, +#endif +#ifdef HAS_SKIN + @location(5) JOINTS_0: vec4u, + @location(6) WEIGHTS_0: vec4f, +#endif +}; + +struct FragmentInputs { + @builtin(position) position: vec4f, + @location(0) pbrPosition: vec3f, + @location(1) pbrUV0: vec2f, + @location(2) pbrUV1: vec2f, + @location(3) pbrNormal: vec3f, +#ifdef HAS_TANGENTS + @location(4) pbrTangent: vec4f, +#endif +}; + +@vertex +fn vertexMain(inputs: VertexInputs) -> FragmentInputs { + var outputs: FragmentInputs; + var position = vec4f(inputs.positions, 1.0); + var normal = vec3f(0.0, 0.0, 1.0); + var tangent = vec4f(1.0, 0.0, 0.0, 1.0); + var uv0 = vec2f(0.0, 0.0); + var uv1 = vec2f(0.0, 0.0); + +#ifdef HAS_NORMALS + normal = inputs.normals; +#endif +#ifdef HAS_UV + uv0 = inputs.texCoords; +#endif +#ifdef HAS_UV_1 + uv1 = inputs.texCoords1; +#endif +#ifdef HAS_TANGENTS + tangent = inputs.TANGENT; +#endif +#ifdef HAS_SKIN + let skinMatrix = getSkinMatrix(inputs.WEIGHTS_0, inputs.JOINTS_0); + position = skinMatrix * position; + normal = normalize((skinMatrix * vec4f(normal, 0.0)).xyz); +#ifdef HAS_TANGENTS + tangent = vec4f(normalize((skinMatrix * vec4f(tangent.xyz, 0.0)).xyz), tangent.w); +#endif +#endif + + let worldPosition = pbrProjection.modelMatrix * position; + +#ifdef HAS_NORMALS + normal = normalize((pbrProjection.normalMatrix * vec4f(normal, 0.0)).xyz); +#endif +#ifdef HAS_TANGENTS + let worldTangent = normalize((pbrProjection.modelMatrix * vec4f(tangent.xyz, 0.0)).xyz); + outputs.pbrTangent = vec4f(worldTangent, tangent.w); +#endif + + outputs.position = pbrProjection.modelViewProjectionMatrix * position; + outputs.pbrPosition = worldPosition.xyz / worldPosition.w; + outputs.pbrUV0 = uv0; + outputs.pbrUV1 = uv1; + outputs.pbrNormal = normal; + return outputs; +} + +@fragment +fn fragmentMain(inputs: FragmentInputs) -> @location(0) vec4f { + fragmentInputs.pbr_vPosition = inputs.pbrPosition; + fragmentInputs.pbr_vUV0 = inputs.pbrUV0; + fragmentInputs.pbr_vUV1 = inputs.pbrUV1; + fragmentInputs.pbr_vNormal = inputs.pbrNormal; +#ifdef HAS_TANGENTS + let tangent = normalize(inputs.pbrTangent.xyz); + let bitangent = normalize(cross(inputs.pbrNormal, tangent)) * inputs.pbrTangent.w; + fragmentInputs.pbr_vTBN = mat3x3f(tangent, bitangent, inputs.pbrNormal); +#endif + return pbr_filterColor(vec4f(1.0)); +} +`,JX=`#version 300 es + + // in vec4 POSITION; + in vec4 positions; + + #ifdef HAS_NORMALS + // in vec4 NORMAL; + in vec4 normals; + #endif + + #ifdef HAS_TANGENTS + in vec4 TANGENT; + #endif + + #ifdef HAS_UV + // in vec2 TEXCOORD_0; + in vec2 texCoords; + #endif + + #ifdef HAS_UV_1 + in vec2 texCoords1; + #endif + + #ifdef HAS_SKIN + in uvec4 JOINTS_0; + in vec4 WEIGHTS_0; + #endif + + void main(void) { + vec4 _NORMAL = vec4(0.); + vec4 _TANGENT = vec4(0.); + vec2 _TEXCOORD_0 = vec2(0.); + vec2 _TEXCOORD_1 = vec2(0.); + + #ifdef HAS_NORMALS + _NORMAL = normals; + #endif + + #ifdef HAS_TANGENTS + _TANGENT = TANGENT; + #endif + + #ifdef HAS_UV + _TEXCOORD_0 = texCoords; + #endif + + #ifdef HAS_UV_1 + _TEXCOORD_1 = texCoords1; + #endif + + vec4 pos = positions; + + #ifdef HAS_SKIN + mat4 skinMat = getSkinMatrix(WEIGHTS_0, JOINTS_0); + pos = skinMat * pos; + _NORMAL = skinMat * _NORMAL; + _TANGENT = vec4((skinMat * vec4(_TANGENT.xyz, 0.)).xyz, _TANGENT.w); + #endif + + pbr_setPositionNormalTangentUV(pos, _NORMAL, _TANGENT, _TEXCOORD_0, _TEXCOORD_1); + gl_Position = pbrProjection.modelViewProjectionMatrix * pos; + } +`,YX=`#version 300 es + out vec4 fragmentColor; + + void main(void) { + vec3 pos = pbr_vPosition; + fragmentColor = pbr_filterColor(vec4(1.0)); + } +`;function XX(e,t){let n=t.materialFactory||new Bg(e,{modules:[Hd]}),r={...t.parsedPPBRMaterial.uniforms};delete r.camera;let i=Object.fromEntries(Object.entries({...r,...t.parsedPPBRMaterial.bindings}).filter(([e,t])=>n.ownsBinding(e)&&QX(t))),a=n.createMaterial({id:t.id,bindings:i});return a.setProps({pbrMaterial:r}),a}function ZX(e,t){let{id:n,geometry:r,parsedPPBRMaterial:i,vertexCount:a,modelOptions:o={}}=t;z.info(4,`createGLTFModel defines: `,i.defines)();let s=[],c={depthWriteEnabled:!0,depthCompare:`less`,depthFormat:`depth24plus`,cullMode:`back`},l={id:n,source:qX,vs:JX,fs:YX,geometry:r,topology:r.topology,vertexCount:a,modules:[Hd,_d],...o,defines:{...i.defines,...o.defines},parameters:{...c,...i.parameters,...o.parameters}},u=t.material||XX(e,{id:n?`${n}-material`:void 0,parsedPPBRMaterial:i});l.material=u;let d=new Rg(e,l),f={...i.uniforms,...o.uniforms,...i.bindings,...o.bindings},p=$X(d.shaderInputs.getModules(),u,f);return d.shaderInputs.setProps(p),new n_({managedResources:s,model:d})}function QX(e){return e instanceof U||e instanceof Og||e instanceof B||e instanceof Se||e instanceof Ce}function $X(e,t,n){let r=new Map;for(let t of e){for(let e of Object.keys(t.uniformTypes||{}))r.set(e,t.name);for(let e of t.bindingLayout||[])r.set(e.name,t.name)}let i={};for(let[e,a]of Object.entries(n)){if(a===void 0)continue;let n=r.get(e);!n||t.ownsModule(n)||(i[n]||={},i[n][e]=a)}return i}var eZ={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:void 0,lights:!0,useTangents:!1,useByteColors:!0};function tZ(e,t,n={}){let r={...eZ,...n},i=new Bg(e,{modules:[Hd]}),a=(t.materials||[]).map((n,a)=>XX(e,{id:sZ(n,a),parsedPPBRMaterial:dX(e,n,{},{...r,gltf:t,validateAttributes:!1}),materialFactory:i})),o=new Map;(t.materials||[]).forEach((e,t)=>{o.set(e.id,a[t])});let s=new Map;t.meshes.forEach((n,i)=>{let a=rZ(e,n,t,o,r);s.set(n.id,a)});let c=new Map,l=new Map;return t.nodes.forEach((t,n)=>{let i=nZ(e,t,r);c.set(n,i),l.set(t.id,i)}),t.nodes.forEach((e,t)=>{if(c.get(t).add((e.children??[]).map(({id:e})=>{let n=l.get(e);if(!n)throw Error(`Cannot find child ${e} of node ${t}`);return n})),e.mesh){let n=s.get(e.mesh.id);if(!n)throw Error(`Cannot find mesh child ${e.mesh.id} of node ${t}`);c.get(t).add(n)}}),{scenes:t.scenes.map(e=>{let t=(e.nodes||[]).map(({id:t})=>{let n=l.get(t);if(!n)throw Error(`Cannot find child ${t} of scene ${e.name||e.id}`);return n});return new t_({id:e.name||e.id,children:t})}),materials:a,gltfMeshIdToNodeMap:s,gltfNodeIdToNodeMap:l,gltfNodeIndexToNodeMap:c}}function nZ(e,t,n){return new t_({id:t.name||t.id,children:[],matrix:t.matrix,position:t.translation,rotation:t.rotation,scale:t.scale})}function rZ(e,t,n,r,i){let a=(t.primitives||[]).map((a,o)=>iZ({device:e,gltfPrimitive:a,primitiveIndex:o,gltfMesh:t,gltf:n,gltfMaterialIdToMaterialMap:r,options:i}));return new t_({id:t.name||t.id,children:a})}function iZ({device:e,gltfPrimitive:t,primitiveIndex:n,gltfMesh:r,gltf:i,gltfMaterialIdToMaterialMap:a,options:o}){let s=t.name||`${r.name||r.id}-primitive-${n}`,c=KX(t.mode??4),l=t.indices?t.indices.count:aZ(t.attributes),u=oZ(s,t,c),d=dX(e,t.material,u.attributes,{...o,gltf:i}),f=ZX(e,{id:s,geometry:u,material:t.material&&a.get(t.material.id)||null,parsedPPBRMaterial:d,modelOptions:o.modelOptions,vertexCount:l});return f.bounds=[t.attributes.POSITION.min,t.attributes.POSITION.max],f}function aZ(e){let t=1/0;for(let n of Object.values(e))if(n){let{value:e,size:r,components:i}=n,a=r??i;e?.length!==void 0&&a>=1&&(t=Math.min(t,e.length/a))}if(!Number.isFinite(t))throw Error(`Could not determine vertex count from attributes`);return t}function oZ(e,t,n){let r={};for(let[e,n]of Object.entries(t.attributes)){let{components:t,size:i,value:a,normalized:o}=n;r[e]={size:i??t,value:a,normalized:o}}return new Jg({id:e,topology:n,indices:t.indices?.value,attributes:r})}function sZ(e,t){return e.name||e.id||`material-${t}`}function cZ(e,t,n){switch(t){case`translation`:return e.setPosition(n).updateMatrix();case`rotation`:return e.setRotation(n).updateMatrix();case`scale`:return e.setScale(n).updateMatrix();default:return z.warn(`Bad animation path ${t}`)(),null}}function lZ(e,{input:t,interpolation:n,output:r},i,a){let o=uZ(e,{input:t,interpolation:n,output:r},a);o&&cZ(i,a,o)}function uZ(e,{input:t,interpolation:n,output:r},i){let a=t[t.length-1];if(!Number.isFinite(a)||a<=0)return r[0]||null;let o=e%a,s=t.findIndex(e=>e>=o);if(s<0)return r[r.length-1]||null;let c=Math.max(0,s-1),l=t[c],u=t[s];switch(n){case`STEP`:return r[c];case`LINEAR`:if(u>l){let e=(o-l)/(u-l);return dZ(i,r[c],r[s],e)}return r[c]||null;case`CUBICSPLINE`:if(u>l){let e=(o-l)/(u-l),t=u-l,n=r[3*c+1],i=r[3*c+2],a=r[3*s+0],d=r[3*s+1];return fZ({p0:n,outTangent0:i,inTangent1:a,p1:d,tDiff:t,ratio:e})}return r[3*c+1]||null;default:return z.warn(`Interpolation ${n} not supported`)(),null}}function dZ(e,t,n,r){if(e===`rotation`)return new Qu().slerp({start:t,target:n,ratio:r});let i=[];for(let e=0;ee.type!==`node`)&&!this.materials.length)throw Error(`Animation ${this.animation.name} targets materials, but GLTFAnimator was created without a materials array`)}setTime(e){if(!this.playing)return;let t=(e/1e3-this.startTime)*this.speed;this.animation.channels.forEach(e=>{if(e.type===`node`){let{sampler:n,targetNodeId:r,path:i}=e,a=this.gltfNodeIdToNodeMap.get(r);if(!a)throw Error(`Cannot find animation target node ${r}`);lZ(t,n,a,i);return}let n=this.materials[e.targetMaterialIndex];if(!n)throw Error(`Cannot find animation target material ${e.targetMaterialIndex} for ${e.pointer}`);let r=uZ(t,e.sampler);r&&(e.type===`material`?hZ(n,e,r):vZ(n,e,r,this.materialTextureTransformState))})}},mZ=class{animations;constructor(e){this.animations=e.animations.map((t,n)=>{let r=t.name||`Animation-${n}`;return new pZ({gltfNodeIdToNodeMap:e.gltfNodeIdToNodeMap,materials:e.materials,animation:{name:r,channels:t.channels}})})}animate(e){z.warn(`GLTFAnimator#animate is deprecated. Use GLTFAnimator#setTime instead`)(),this.setTime(e)}setTime(e){this.animations.forEach(t=>t.setTime(e))}getAnimations(){return this.animations}};function hZ(e,t,n){let r=t.component===void 0?{[t.property]:n.length===1?n[0]:n}:{[t.property]:_Z(gZ(e,t.property),t.component,n[0])};e.setProps({pbrMaterial:r})}function gZ(e,t){let n=e.shaderInputs.getUniformValues().pbrMaterial?.[t];return Array.isArray(n)?[...n]:[]}function _Z(e,t,n){let r=[...e];return r[t]=n,r}function vZ(e,t,n,r){let i=aX(t.textureSlot),a=yZ(r,e,t);switch(t.path){case`offset`:t.component===void 0?a.offset=[n[0],n[1]]:a.offset[t.component]=n[0];break;case`rotation`:a.rotation=n[0];break;case`scale`:t.component===void 0?a.scale=[n[0],n[1]]:a.scale[t.component]=n[0];break}e.setProps({pbrMaterial:{[i.uvTransformUniform]:uX(t.baseTransform,a)}})}function yZ(e,t,n){let r=e.get(t)||{},i=r[n.textureSlot];return i||(i={offset:[...n.baseTransform.offset],rotation:n.baseTransform.rotation,scale:[...n.baseTransform.scale]},r[n.textureSlot]=i,e.set(t,r)),i}var bZ={supportLevel:`none`,comment:`Not currently listed in the luma.gl glTF extension support registry.`},xZ={KHR_draco_mesh_compression:{supportLevel:`built-in`,comment:`Decoded by loaders.gl before luma.gl builds the scenegraph.`},EXT_meshopt_compression:{supportLevel:`built-in`,comment:`Meshopt-compressed primitives are decoded during load.`},KHR_mesh_quantization:{supportLevel:`built-in`,comment:`Quantized accessors are unpacked before geometry creation.`},KHR_lights_punctual:{supportLevel:`built-in`,comment:`Parsed into luma.gl Light objects.`},KHR_materials_unlit:{supportLevel:`built-in`,comment:`Unlit materials bypass the default lighting path.`},KHR_materials_emissive_strength:{supportLevel:`built-in`,comment:`Applied by the stock PBR shader.`},KHR_texture_basisu:{supportLevel:`built-in`,comment:`BasisU / KTX2 textures pass through when the device supports them.`},KHR_texture_transform:{supportLevel:`built-in`,comment:`UV transforms are applied during load.`},EXT_texture_webp:{supportLevel:`loader-only`,comment:`Texture source is resolved during load; final support depends on browser and device decode support.`},EXT_texture_avif:{supportLevel:`loader-only`,comment:`Texture source is resolved during load; final support depends on browser and device decode support.`},KHR_materials_specular:{supportLevel:`built-in`,comment:`The stock shader now applies specular factors and textures to the dielectric F0 term.`},KHR_materials_ior:{supportLevel:`built-in`,comment:`The stock shader now drives dielectric reflectance from the glTF IOR value.`},KHR_materials_transmission:{supportLevel:`built-in`,comment:`The stock shader now applies transmission to the base layer and exposes transparency through alpha, without a scene-color refraction buffer.`},KHR_materials_volume:{supportLevel:`built-in`,comment:`Thickness and attenuation now tint transmitted light in the stock shader.`},KHR_materials_clearcoat:{supportLevel:`built-in`,comment:`The stock shader now adds a secondary clearcoat specular lobe.`},KHR_materials_sheen:{supportLevel:`built-in`,comment:`The stock shader now adds a sheen lobe for cloth-like materials.`},KHR_materials_iridescence:{supportLevel:`built-in`,comment:`The stock shader now tints specular response with a view-dependent thin-film iridescence approximation.`},KHR_materials_anisotropy:{supportLevel:`built-in`,comment:`The stock shader now shapes highlights and IBL response with an anisotropy-direction approximation.`},KHR_materials_pbrSpecularGlossiness:{supportLevel:`loader-only`,comment:`Extension data can be loaded, but it is not translated into the default metallic-roughness material path.`},KHR_materials_variants:{supportLevel:`loader-only`,comment:`Variant metadata can be loaded, but applications must choose and apply variants.`},EXT_mesh_gpu_instancing:{supportLevel:`none`,comment:`GPU instancing data is not yet converted into luma.gl instanced draw setup.`},KHR_node_visibility:{supportLevel:`none`,comment:`Node-visibility animations and toggles are not mapped onto runtime scenegraph state.`},KHR_animation_pointer:{supportLevel:`parsed-and-wired`,comment:`Selected node TRS, material factor, and KHR_texture_transform offset/rotation/scale pointers are wired to runtime updates; unsupported targets are skipped.`},KHR_materials_diffuse_transmission:{supportLevel:`none`,comment:`Diffuse-transmission shading is not implemented in the stock PBR shader.`},KHR_materials_dispersion:{supportLevel:`none`,comment:`Chromatic dispersion is not implemented in the stock PBR shader.`},KHR_materials_volume_scatter:{supportLevel:`none`,comment:`Volume scattering is not implemented in the stock PBR shader.`},KHR_xmp:{supportLevel:`none`,comment:`Metadata payloads remain in the loaded glTF, but luma.gl does not interpret them.`},KHR_xmp_json_ld:{supportLevel:`none`,comment:`Metadata is preserved in the glTF, but luma.gl does not interpret it.`},EXT_lights_image_based:{supportLevel:`none`,comment:`Use loadPBREnvironment() or custom environment setup instead.`},EXT_texture_video:{supportLevel:`none`,comment:`Video textures are not created automatically by the stock pipeline.`},MSFT_lod:{supportLevel:`none`,comment:`Level-of-detail switching is not implemented in the stock scenegraph loader.`}};function SZ(e){let t=Array.from(wZ(e)).sort().map(e=>{let t=xZ[e]||bZ;return[e,{extensionName:e,supported:t.supportLevel===`built-in`||t.supportLevel===`parsed-and-wired`,supportLevel:t.supportLevel,comment:t.comment}]});return new Map(t)}function CZ(e){return xZ[e]||null}function wZ(e){let t=e,n=new Set;return TZ(n,e.extensionsUsed),TZ(n,e.extensionsRequired),TZ(n,t.extensionsRemoved),TZ(n,Object.keys(e.extensions||{})),(t.lights?.length||(e.nodes||[]).some(e=>`light`in e))&&n.add(`KHR_lights_punctual`),(e.materials||[]).some(e=>{let t=e;return t.unlit||t.extensions?.KHR_materials_unlit})&&n.add(`KHR_materials_unlit`),n}function TZ(e,t=[]){for(let n of t)e.add(n)}var EZ={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},DZ={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function OZ(e){let t=DZ[e.componentType],n=EZ[e.type],r=n*e.count,{buffer:i,byteOffset:a=0}=e.bufferView?.data??{};return{typedArray:new t(i,a+(e.byteOffset||0),r),components:n}}function kZ(e){let t=e.animations||[],n=new Map,r=new Map;return t.flatMap((t,i)=>{let a=t.name||`Animation-${i}`,o=new Map,s=t.channels.flatMap(({sampler:i,target:a})=>{let s=o.get(i);if(!s){let a=t.samplers[i];if(!a)throw Error(`Cannot find animation sampler ${i}`);let{input:c,interpolation:l=`LINEAR`,output:u}=a;s={input:UZ(e.accessors[c],n),interpolation:l,output:WZ(e.accessors[u],r)},o.set(i,s)}let c=AZ(e,a,s);return c?[c]:[]});return s.length?[{name:a,channels:s}]:[]})}function AZ(e,t,n){if(t.path===`pointer`)return jZ(e,t,n);let r=PZ(t.path);if(!r)return null;let i=e.nodes[t.node??0];if(!i)throw Error(`Cannot find animation target ${t.node}`);return{type:`node`,sampler:n,targetNodeId:i.id,path:r}}function jZ(e,t,n){let r=t.extensions?.KHR_animation_pointer?.pointer;if(typeof r!=`string`||!r.startsWith(`/`))return z.warn(`KHR_animation_pointer channel is missing a valid JSON pointer and will be skipped`)(),null;let i=RZ(r);switch(i[0]){case`nodes`:return MZ(e,i,n,r);case`materials`:return NZ(e,i,n,r);default:return HZ(r,`top-level target "${i[0]}" has no runtime animation mapping`),null}}function MZ(e,t,n,r){if(t.length!==3)return HZ(r,`node pointers must use /nodes/{index}/{translation|rotation|scale|weights}`),null;let i=Number(t[1]),a=e.nodes[i];if(!Number.isInteger(i)||!a)return z.warn(`KHR_animation_pointer target ${r} references a missing node and will be skipped`)(),null;let o=PZ(t[2]);return o?o===`weights`?(z.warn(`KHR_animation_pointer target ${r} will be skipped because morph weights are not implemented in GLTFAnimator`)(),null):{type:`node`,sampler:n,targetNodeId:a.id,path:o}:(HZ(r,`node property "${t[2]}" has no runtime animation mapping`),null)}function NZ(e,t,n,r){if(t.length<3)return HZ(r,`material pointers must include a material index and target property path`),null;let i=Number(t[1]),a=e.materials[i];if(!Number.isInteger(i)||!a)return z.warn(`KHR_animation_pointer target ${r} references a missing material and will be skipped`)(),null;let o=FZ(a,t.slice(2));return`reason`in o?(HZ(r,o.reason),null):{sampler:n,pointer:r,targetMaterialIndex:i,...o}}function PZ(e){switch(e){case`translation`:case`rotation`:case`scale`:case`weights`:return e;default:return null}}function FZ(e,t){let n=IZ(e,t);if(!(`reason`in n)||n.reason!==`not-a-texture-transform-target`)return n;switch(t.join(`/`)){case`pbrMetallicRoughness/baseColorFactor`:return e.pbrMetallicRoughness?{type:`material`,property:`baseColorFactor`}:{reason:zZ(t)};case`pbrMetallicRoughness/metallicFactor`:return e.pbrMetallicRoughness?{type:`material`,property:`metallicRoughnessValues`,component:0}:{reason:zZ(t)};case`pbrMetallicRoughness/roughnessFactor`:return e.pbrMetallicRoughness?{type:`material`,property:`metallicRoughnessValues`,component:1}:{reason:zZ(t)};case`normalTexture/scale`:return e.normalTexture?{type:`material`,property:`normalScale`}:{reason:zZ(t)};case`occlusionTexture/strength`:return e.occlusionTexture?{type:`material`,property:`occlusionStrength`}:{reason:zZ(t)};case`emissiveFactor`:return{type:`material`,property:`emissiveFactor`};case`alphaCutoff`:return{type:`material`,property:`alphaCutoff`};case`extensions/KHR_materials_specular/specularFactor`:return e.extensions?.KHR_materials_specular?{type:`material`,property:`specularIntensityFactor`}:{reason:zZ(t)};case`extensions/KHR_materials_specular/specularColorFactor`:return e.extensions?.KHR_materials_specular?{type:`material`,property:`specularColorFactor`}:{reason:zZ(t)};case`extensions/KHR_materials_ior/ior`:return e.extensions?.KHR_materials_ior?{type:`material`,property:`ior`}:{reason:zZ(t)};case`extensions/KHR_materials_transmission/transmissionFactor`:return e.extensions?.KHR_materials_transmission?{type:`material`,property:`transmissionFactor`}:{reason:zZ(t)};case`extensions/KHR_materials_volume/thicknessFactor`:return e.extensions?.KHR_materials_volume?{type:`material`,property:`thicknessFactor`}:{reason:zZ(t)};case`extensions/KHR_materials_volume/attenuationDistance`:return e.extensions?.KHR_materials_volume?{type:`material`,property:`attenuationDistance`}:{reason:zZ(t)};case`extensions/KHR_materials_volume/attenuationColor`:return e.extensions?.KHR_materials_volume?{type:`material`,property:`attenuationColor`}:{reason:zZ(t)};case`extensions/KHR_materials_clearcoat/clearcoatFactor`:return e.extensions?.KHR_materials_clearcoat?{type:`material`,property:`clearcoatFactor`}:{reason:zZ(t)};case`extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor`:return e.extensions?.KHR_materials_clearcoat?{type:`material`,property:`clearcoatRoughnessFactor`}:{reason:zZ(t)};case`extensions/KHR_materials_sheen/sheenColorFactor`:return e.extensions?.KHR_materials_sheen?{type:`material`,property:`sheenColorFactor`}:{reason:zZ(t)};case`extensions/KHR_materials_sheen/sheenRoughnessFactor`:return e.extensions?.KHR_materials_sheen?{type:`material`,property:`sheenRoughnessFactor`}:{reason:zZ(t)};case`extensions/KHR_materials_iridescence/iridescenceFactor`:return e.extensions?.KHR_materials_iridescence?{type:`material`,property:`iridescenceFactor`}:{reason:zZ(t)};case`extensions/KHR_materials_iridescence/iridescenceIor`:return e.extensions?.KHR_materials_iridescence?{type:`material`,property:`iridescenceIor`}:{reason:zZ(t)};case`extensions/KHR_materials_iridescence/iridescenceThicknessMinimum`:return e.extensions?.KHR_materials_iridescence?{type:`material`,property:`iridescenceThicknessRange`,component:0}:{reason:zZ(t)};case`extensions/KHR_materials_iridescence/iridescenceThicknessMaximum`:return e.extensions?.KHR_materials_iridescence?{type:`material`,property:`iridescenceThicknessRange`,component:1}:{reason:zZ(t)};case`extensions/KHR_materials_anisotropy/anisotropyStrength`:return e.extensions?.KHR_materials_anisotropy?{type:`material`,property:`anisotropyStrength`}:{reason:zZ(t)};case`extensions/KHR_materials_anisotropy/anisotropyRotation`:return e.extensions?.KHR_materials_anisotropy?{type:`material`,property:`anisotropyRotation`}:{reason:zZ(t)};case`extensions/KHR_materials_emissive_strength/emissiveStrength`:return e.extensions?.KHR_materials_emissive_strength?{type:`material`,property:`emissiveStrength`}:{reason:zZ(t)};default:return{reason:zZ(t)}}}function IZ(e,t){let n=t.lastIndexOf(`extensions`);if(n<0||t[n+1]!==`KHR_texture_transform`||n<1)return{reason:`not-a-texture-transform-target`};let r=cX(t.slice(0,n));if(!r)return{reason:BZ(t.slice(0,n))};let i=LZ(e,r.pathSegments);if(!i)return{reason:`texture-transform target "${t.slice(0,n).join(`/`)}" does not exist on the referenced material`};let a=t[n+2];if(a===`texCoord`)return{reason:`animated KHR_texture_transform.texCoord is unsupported because texCoord selection is structural, not a runtime float/vector update`};if(a!==`offset`&&a!==`rotation`&&a!==`scale`)return{reason:`KHR_texture_transform property "${a}" is not animatable; supported properties are offset, rotation, and scale`};let o=t[n+3];if(t.length>n+4)return{reason:`KHR_texture_transform.${a} does not support nested property paths`};let s;if(o!==void 0){if(s=Number(o),a===`rotation`)return{reason:`KHR_texture_transform.rotation does not support component indices`};if(!Number.isInteger(s)||s<0||s>1)return{reason:`KHR_texture_transform.${a} component index "${o}" is invalid; only 0 and 1 are supported`}}return{type:`textureTransform`,textureSlot:r.slot,path:a,component:s,baseTransform:oX(i)}}function LZ(e,t){let n=e;for(let e of t)if(n=n?.[e],!n)return null;return n}function RZ(e){return e.slice(1).split(`/`).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`))}function zZ(e){let t=VZ(e);if(t){let e=CZ(t);if(e?.supportLevel===`none`)return`${t} is referenced by this pointer, but ${e.comment.charAt(0).toLowerCase()}${e.comment.slice(1)}`}return`no runtime target exists for material property "${e.join(`/`)}"`}function BZ(e){let t=VZ(e);if(t){let e=CZ(t);if(e?.supportLevel===`none`)return`${t} is referenced by this pointer, but ${e.comment.charAt(0).toLowerCase()}${e.comment.slice(1)}`}return`texture-transform target "${e.join(`/`)}" has no runtime texture-slot mapping`}function VZ(e){let t=e.indexOf(`extensions`),n=e[t+1];return t>=0&&n?n:null}function HZ(e,t){z.warn(`KHR_animation_pointer target ${e} will be skipped because ${t}`)()}function UZ(e,t){if(t.has(e))return t.get(e);let{typedArray:n,components:r}=OZ(e);GZ(r===1,`accessorToJsArray1D must have exactly 1 component`);let i=Array.from(n);return t.set(e,i),i}function WZ(e,t){if(t.has(e))return t.get(e);let{typedArray:n,components:r}=OZ(e);GZ(r>=1,`accessorToJsArray2D must have at least 1 component`);let i=[];for(let e=0;eqZ(e.getBounds()));return{scenes:r,materials:i,animator:c,lights:l,extensionSupport:u,sceneBounds:d,modelBounds:JZ(d),gltfMeshIdToNodeMap:a,gltfNodeIdToNodeMap:o,gltfNodeIndexToNodeMap:s,gltf:t}}function qZ(e){if(!e)return{bounds:null,center:[0,0,0],size:[0,0,0],radius:.5,recommendedOrbitDistance:1};let t=[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]]],n=[t[1][0]-t[0][0],t[1][1]-t[0][1],t[1][2]-t[0][2]],r=[t[0][0]+n[0]*.5,t[0][1]+n[1]*.5,t[0][2]+n[2]*.5],i=Math.max(n[0],n[1],n[2])*.5,a=Math.max(.5*Math.hypot(n[0],n[1],n[2]),.001);return{bounds:t,center:r,size:n,radius:a,recommendedOrbitDistance:Math.max(Math.max(i,.001)/Math.tan(Math.PI/6)*1.15,a*1.1)}}function JZ(e){let t=null;for(let n of e)if(n.bounds){if(!t){t=[[...n.bounds[0]],[...n.bounds[1]]];continue}for(let e=0;e<3;e++)t[0][e]=Math.min(t[0][e],n.bounds[0][e]),t[1][e]=Math.max(t[1][e],n.bounds[1][e])}return qZ(t)}async function YZ(e){let t=[];return e.scenes.forEach(e=>{e.traverse(e=>{})}),await XZ(()=>t.some(e=>!e.loaded))}async function XZ(e){for(;e();)await new Promise(e=>requestAnimationFrame(e))}var ZZ=`layout(std140) uniform scenegraphUniforms { + float sizeScale; + float sizeMinPixels; + float sizeMaxPixels; + mat4 sceneModelMatrix; + bool composeModelMatrix; +} scenegraph; +`,QZ={name:`scenegraph`,vs:ZZ,fs:ZZ,uniformTypes:{sizeScale:`f32`,sizeMinPixels:`f32`,sizeMaxPixels:`f32`,sceneModelMatrix:`mat4x4`,composeModelMatrix:`f32`}},$Z=`#version 300 es +#define SHADER_NAME scenegraph-layer-vertex-shader +in vec3 instancePositions; +in vec3 instancePositions64Low; +in vec4 instanceColors; +in vec3 instancePickingColors; +in vec3 instanceModelMatrixCol0; +in vec3 instanceModelMatrixCol1; +in vec3 instanceModelMatrixCol2; +in vec3 instanceTranslation; +in vec3 positions; +#ifdef HAS_UV +in vec2 texCoords; +#endif +#ifdef LIGHTING_PBR +#ifdef HAS_NORMALS +in vec3 normals; +#endif +#endif +out vec4 vColor; +#ifndef LIGHTING_PBR +#ifdef HAS_UV +out vec2 vTEXCOORD_0; +#endif +#endif +void main(void) { +#if defined(HAS_UV) && !defined(LIGHTING_PBR) +vTEXCOORD_0 = texCoords; +geometry.uv = texCoords; +#endif +geometry.worldPosition = instancePositions; +geometry.pickingColor = instancePickingColors; +mat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2); +vec3 normal = vec3(0.0, 0.0, 1.0); +#ifdef LIGHTING_PBR +#ifdef HAS_NORMALS +normal = instanceModelMatrix * (scenegraph.sceneModelMatrix * vec4(normals, 0.0)).xyz; +#endif +#endif +float originalSize = project_size_to_pixel(scenegraph.sizeScale); +float clampedSize = clamp(originalSize, scenegraph.sizeMinPixels, scenegraph.sizeMaxPixels); +vec3 pos = (instanceModelMatrix * (scenegraph.sceneModelMatrix * vec4(positions, 1.0)).xyz) * scenegraph.sizeScale * (clampedSize / originalSize) + instanceTranslation; +if(scenegraph.composeModelMatrix) { +DECKGL_FILTER_SIZE(pos, geometry); +geometry.normal = project_normal(normal); +geometry.worldPosition += pos; +gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position); +} +else { +pos = project_size(pos); +DECKGL_FILTER_SIZE(pos, geometry); +gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position); +geometry.normal = project_normal(normal); +} +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +#ifdef LIGHTING_PBR +pbr_vPosition = geometry.position.xyz; +#ifdef HAS_NORMALS +pbr_vNormal = geometry.normal; +#endif +#ifdef HAS_UV +pbr_vUV0 = texCoords; +#else +pbr_vUV0 = vec2(0., 0.); +#endif +pbr_vUV1 = vec2(0., 0.); +geometry.uv = pbr_vUV0; +#endif +vColor = instanceColors; +DECKGL_FILTER_COLOR(vColor, geometry); +} +`,eQ=`#version 300 es +#define SHADER_NAME scenegraph-layer-fragment-shader +in vec4 vColor; +out vec4 fragColor; +#ifndef LIGHTING_PBR +#if defined(HAS_UV) && defined(HAS_BASECOLORMAP) +in vec2 vTEXCOORD_0; +uniform sampler2D pbr_baseColorSampler; +#endif +#endif +void main(void) { +#ifdef LIGHTING_PBR +fragColor = vColor * pbr_filterColor(vec4(0)); +geometry.uv = pbr_vUV0; +#else +#if defined(HAS_UV) && defined(HAS_BASECOLORMAP) +fragColor = vColor * texture(pbr_baseColorSampler, vTEXCOORD_0); +geometry.uv = vTEXCOORD_0; +#else +fragColor = vColor; +#endif +#endif +fragColor.a *= layer.opacity; +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,tQ=[255,255,255,255],nQ={scenegraph:{type:`object`,value:null,async:!0},getScene:e=>e&&e.scenes?typeof e.scene==`object`?e.scene:e.scenes[e.scene||0]:e,getAnimator:e=>e&&e.animator,_animations:null,onFirstDraw:{type:`function`,value:()=>{}},sizeScale:{type:`number`,value:1,min:0},sizeMinPixels:{type:`number`,min:0,value:0},sizeMaxPixels:{type:`number`,min:0,value:2**53-1},getPosition:{type:`accessor`,value:e=>e.position},getColor:{type:`accessor`,value:tQ},_lighting:`flat`,_imageBasedLightingEnvironment:void 0,getOrientation:{type:`accessor`,value:[0,0,0]},getScale:{type:`accessor`,value:[1,1,1]},getTranslation:{type:`accessor`,value:[0,0,0]},getTransformMatrix:{type:`accessor`,value:[]},loaders:[PE]},rQ=class extends dx{getShaders(){let e={},t;this.props._lighting===`pbr`?(t=Hd,e.LIGHTING_PBR=1):t={name:`pbrMaterial`};let n=[Bp,jm,QZ,t];return super.getShaders({defines:e,vs:$Z,fs:eQ,modules:n})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:`float64`,fp64:this.use64bitPositions(),accessor:`getPosition`,transition:!0},instanceColors:{type:`unorm8`,size:this.props.colorFormat.length,accessor:`getColor`,defaultValue:tQ,transition:!0},instanceModelMatrix:zY})}updateState(e){super.updateState(e);let{props:t,oldProps:n}=e;t.scenegraph===n.scenegraph?t._animations!==n._animations&&this._applyAnimationsProp(this.state.animator,t._animations):this._updateScenegraph()}finalizeState(e){super.finalizeState(e),this._destroyScenegraphAssets()}get isLoaded(){return!!(this.state?.scenegraph&&super.isLoaded)}_updateScenegraph(){let e=this.props,{device:t}=this.context,n=null;if(e.scenegraph instanceof e_)n={scenes:[e.scenegraph]};else if(e.scenegraph&&typeof e.scenegraph==`object`){let r=e.scenegraph,i=KZ(t,r.json?GE(r):r,this._getModelOptions());n=i,YZ(i).then(()=>this.setNeedsRedraw()).catch(e=>{this.raiseError(e,`loading glTF`)})}let r={layer:this,device:this.context.device},i=e.getScene(n,r),a=e.getAnimator(n,r);if(i instanceof t_){this._destroyScenegraphAssets(),this._applyAnimationsProp(a,e._animations);let t=[];i.traverse(e=>{e instanceof n_&&t.push(e.model)}),this.setState({scenegraph:i,animator:a,materials:n?.materials||null,models:t,firstDrawSignaled:!1}),this.getAttributeManager().invalidateAll()}else i!==null&&fo.warn(`invalid scenegraph:`,i)()}_destroyScenegraphAssets(){this.state.scenegraph?.destroy(),this.state.materials?.forEach(e=>e.destroy()),this.state.scenegraph=null,this.state.animator=null,this.state.materials=null,this.state.models=[]}_applyAnimationsProp(e,t){if(!e||!t)return;let n=e.getAnimations();Object.keys(t).sort().forEach(e=>{let r=t[e];if(e===`*`)n.forEach(e=>{Object.assign(e,r)});else if(Number.isFinite(Number(e))){let t=Number(e);t>=0&&tt.name===e);t?Object.assign(t,r):fo.warn(`animation ${e} not found`)()}})}_getModelOptions(){let{_imageBasedLightingEnvironment:e}=this.props,t;return e&&(t=typeof e==`function`?e({gl:this.context.gl,layer:this}):e),{imageBasedLightingEnvironment:t,modelOptions:{id:this.props.id,isInstanced:!0,bufferLayout:this.getAttributeManager().getBufferLayouts(),...this.getShaders()},useTangents:!1}}draw({context:e}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.setTime(e.timeline.getTime()),this.setNeedsRedraw());let{viewport:t,renderPass:n}=this.context,{sizeScale:r,sizeMinPixels:i,sizeMaxPixels:a,coordinateSystem:o}=this.props,s={camera:t.cameraPosition},c=this.getNumInstances();this.state.scenegraph.traverse((e,{worldMatrix:l})=>{if(e instanceof n_){let{model:u}=e;u.setInstanceCount(c);let d={sizeScale:r,sizeMinPixels:i,sizeMaxPixels:a,composeModelMatrix:BY(t,o),sceneModelMatrix:l};u.shaderInputs.setProps({pbrProjection:s,scenegraph:d}),u.draw(n)}}),this.state.firstDrawSignaled||(this.state.firstDrawSignaled=!0,this.props.onFirstDraw?.())}};rQ.defaultProps=nQ,rQ.layerName=`ScenegraphLayer`;var iQ=n({ScenegraphLayer:()=>rQ,SimpleMeshLayer:()=>YY}),aQ=`layout(std140) uniform meshUniforms { + bool pickFeatureIds; +} mesh; +`,oQ={name:`mesh`,vs:aQ,fs:aQ,uniformTypes:{pickFeatureIds:`f32`}},sQ=`#version 300 es +#define SHADER_NAME simple-mesh-layer-vs +in vec3 positions; +in vec3 normals; +in vec3 colors; +in vec2 texCoords; +in vec4 uvRegions; +in vec3 featureIdsPickingColors; +in vec4 instanceColors; +in vec3 instancePickingColors; +in vec3 instanceModelMatrixCol0; +in vec3 instanceModelMatrixCol1; +in vec3 instanceModelMatrixCol2; +out vec2 vTexCoord; +out vec3 cameraPosition; +out vec3 normals_commonspace; +out vec4 position_commonspace; +out vec4 vColor; +vec2 applyUVRegion(vec2 uv) { +#ifdef HAS_UV_REGIONS +return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy; +#else +return uv; +#endif +} +void main(void) { +vec2 uv = applyUVRegion(texCoords); +geometry.uv = uv; +if (mesh.pickFeatureIds) { +geometry.pickingColor = featureIdsPickingColors; +} else { +geometry.pickingColor = instancePickingColors; +} +mat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2); +vTexCoord = uv; +cameraPosition = project.cameraPosition; +vColor = vec4(colors * instanceColors.rgb, instanceColors.a); +vec3 pos = (instanceModelMatrix * positions) * simpleMesh.sizeScale; +vec3 projectedPosition = project_position(positions); +position_commonspace = vec4(projectedPosition, 1.0); +gl_Position = project_common_position_to_clipspace(position_commonspace); +geometry.position = position_commonspace; +normals_commonspace = project_normal(instanceModelMatrix * normals); +geometry.normal = normals_commonspace; +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +#ifdef MODULE_PBRMATERIAL +pbr_vPosition = geometry.position.xyz; +#ifdef HAS_NORMALS +pbr_vNormal = geometry.normal; +#endif +#ifdef HAS_UV +pbr_vUV0 = uv; +#else +pbr_vUV0 = vec2(0., 0.); +#endif +pbr_vUV1 = vec2(0., 0.); +geometry.uv = pbr_vUV0; +#endif +DECKGL_FILTER_COLOR(vColor, geometry); +} +`,cQ=`#version 300 es +#define SHADER_NAME simple-mesh-layer-fs +precision highp float; +uniform sampler2D sampler; +in vec2 vTexCoord; +in vec3 cameraPosition; +in vec3 normals_commonspace; +in vec4 position_commonspace; +in vec4 vColor; +out vec4 fragColor; +void main(void) { +#ifdef MODULE_PBRMATERIAL +fragColor = vColor * pbr_filterColor(vec4(0)); +geometry.uv = pbr_vUV0; +fragColor.a *= layer.opacity; +#else +geometry.uv = vTexCoord; +vec3 normal; +if (simpleMesh.flatShading) { +normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz))); +} else { +normal = normals_commonspace; +} +vec4 color = simpleMesh.hasTexture ? texture(sampler, vTexCoord) : vColor; +vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal); +fragColor = vec4(lightColor, color.a * layer.opacity); +#endif +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`;function lQ(e){let t=e.positions||e.POSITION,n=t.value.length/t.size;e.COLOR_0||e.colors||(e.colors={size:4,value:new Uint8Array(n*4).fill(255),normalized:!0})}var uQ={pbrMaterial:{type:`object`,value:null},featureIds:{type:`array`,value:null,optional:!0}},dQ=class extends YY{getShaders(){let e=super.getShaders();return e.modules.push(Hd,oQ),{...e,vs:sQ,fs:cQ}}initializeState(){let{featureIds:e}=this.props;super.initializeState();let t=this.getAttributeManager();e&&t.add({featureIdsPickingColors:{type:`uint8`,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}updateState(e){super.updateState(e);let{props:t,oldProps:n}=e;t.pbrMaterial!==n.pbrMaterial&&this.updatePbrMaterialUniforms(t.pbrMaterial)}draw(e){let{featureIds:t}=this.props,{model:n}=this.state;if(!n)return;let r={pickFeatureIds:!!t},i={camera:this.context.viewport.cameraPosition};n.shaderInputs.setProps({pbrProjection:i,mesh:r}),super.draw(e)}getModel(e){let{id:t}=this.props,n=this.parseMaterial(this.props.pbrMaterial,e);this.setState({parsedPBRMaterial:n});let r=this.getShaders();return lQ(e.attributes),new Rg(this.context.device,{...this.getShaders(),id:t,geometry:e,bufferLayout:this.getAttributeManager().getBufferLayouts(),defines:{...r.defines,...n?.defines,HAS_UV_REGIONS:+!!e.attributes.uvRegions},parameters:n?.parameters,isInstanced:!0})}updatePbrMaterialUniforms(e){let{model:t}=this.state;if(t){let{mesh:n}=this.props,r=this.parseMaterial(e,n);this.setState({parsedPBRMaterial:r});let{pbr_baseColorSampler:i}=r.bindings,{emptyTexture:a}=this.state,o={sampler:i||a,hasTexture:!!i},{camera:s,...c}={...r.bindings,...r.uniforms};t.shaderInputs.setProps({simpleMesh:o,pbrMaterial:c})}}parseMaterial(e,t){let n=!!(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture);return dX(this.context.device,{unlit:n,...e},{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},{pbrDebug:!1,lights:!0,useTangents:!1})}calculateFeatureIdsPickingColors(e){let t=this.props.featureIds,n=new Uint8ClampedArray(t.length*e.size),r=[];for(let e=0;ee.destroy()),this.setState({parsedPBRMaterial:null})}};dQ.layerName=`MeshLayer`,dQ.defaultProps=uQ;var fQ=6378137,pQ=6378137,mQ=6356752.314245179;fQ*fQ,pQ*pQ,mQ*mQ,1/fQ,1/pQ,1/mQ,1/(fQ*fQ),1/(pQ*pQ),1/(mQ*mQ);function hQ(e){return e}new Y;function gQ(e,t=[],n=hQ){return`longitude`in e?(t[0]=n(e.longitude),t[1]=n(e.latitude),t[2]=e.height):`x`in e?(t[0]=n(e.x),t[1]=n(e.y),t[2]=e.z):(t[0]=n(e[0]),t[1]=n(e[1]),t[2]=e[2]),t}function _Q(e,t=[]){return gQ(e,t,Sc._cartographicRadians?hQ:Tc)}function vQ(e,t,n=hQ){return`longitude`in t?(t.longitude=n(e[0]),t.latitude=n(e[1]),t.height=e[2]):`x`in t?(t.x=n(e[0]),t.y=n(e[1]),t.z=e[2]):(t[0]=n(e[0]),t[1]=n(e[1]),t[2]=e[2]),t}function yQ(e,t){return vQ(e,t,Sc._cartographicRadians?hQ:Ec)}var bQ=1e-14,xQ=new Y,SQ={up:{south:`east`,north:`west`,west:`south`,east:`north`},down:{south:`west`,north:`east`,west:`north`,east:`south`},south:{up:`west`,down:`east`,west:`down`,east:`up`},north:{up:`east`,down:`west`,west:`up`,east:`down`},west:{up:`north`,down:`south`,north:`down`,south:`up`},east:{up:`south`,down:`north`,north:`up`,south:`down`}},CQ={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},wQ={east:new Y,north:new Y,up:new Y,west:new Y,south:new Y,down:new Y},TQ=new Y,EQ=new Y,DQ=new Y;function OQ(e,t,n,r,i,a){let o=SQ[t]&&SQ[t][n];zc(o&&(!r||r===o));let s,c,l,u=xQ.copy(i);if(jc(u.x,0,bQ)&&jc(u.y,0,bQ)){let e=Math.sign(u.z);s=TQ.fromArray(CQ[t]),t!==`east`&&t!==`west`&&s.scale(e),c=EQ.fromArray(CQ[n]),n!==`east`&&n!==`west`&&c.scale(e),l=DQ.fromArray(CQ[r]),r!==`east`&&r!==`west`&&l.scale(e)}else{let{up:i,east:a,north:o}=wQ;a.set(-u.y,u.x,0).normalize(),e.geodeticSurfaceNormal(u,i),o.copy(i).cross(a);let{down:d,west:f,south:p}=wQ;d.copy(i).scale(-1),f.copy(a).scale(-1),p.copy(o).scale(-1),s=wQ[t],c=wQ[n],l=wQ[r]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=c.x,a[5]=c.y,a[6]=c.z,a[7]=0,a[8]=l.x,a[9]=l.y,a[10]=l.z,a[11]=0,a[12]=u.x,a[13]=u.y,a[14]=u.z,a[15]=1,a}var kQ=new Y,AQ=new Y,jQ=new Y;function MQ(e,t,n=[]){let{oneOverRadii:r,oneOverRadiiSquared:i,centerToleranceSquared:a}=t;kQ.from(e);let o=kQ.x,s=kQ.y,c=kQ.z,l=r.x,u=r.y,d=r.z,f=o*o*l*l,p=s*s*u*u,m=c*c*d*d,h=f+p+m,g=Math.sqrt(1/h);if(!Number.isFinite(g))return;let _=AQ;if(_.copy(e).scale(g),hed);return kQ.scale([w,T,E]).to(n)}var NQ=new Y,PQ=new Y,FQ=new Y,IQ=new Y,LQ=new Y,RQ=new Y,zQ=class{constructor(e=0,t=0,n=0){this.centerToleranceSquared=$u,zc(e>=0),zc(t>=0),zc(n>=0),this.radii=new Y(e,t,n),this.radiiSquared=new Y(e*e,t*t,n*n),this.radiiToTheFourth=new Y(e*e*e*e,t*t*t*t,n*n*n*n),this.oneOverRadii=new Y(e===0?0:1/e,t===0?0:1/t,n===0?0:1/n),this.oneOverRadiiSquared=new Y(e===0?0:1/(e*e),t===0?0:1/(t*t),n===0?0:1/(n*n)),this.minimumRadius=Math.min(e,t,n),this.maximumRadius=Math.max(e,t,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||!!(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,t=[0,0,0]){let n=PQ,r=FQ,[,,i]=e;this.geodeticSurfaceNormalCartographic(e,n),r.copy(this.radiiSquared).scale(n);let a=Math.sqrt(n.dot(r));return r.scale(1/a),n.scale(i),r.add(n),r.to(t)}cartesianToCartographic(e,t=[0,0,0]){RQ.from(e);let n=this.scaleToGeodeticSurface(RQ,IQ);if(!n)return;let r=this.geodeticSurfaceNormal(n,PQ),i=LQ;return i.copy(RQ).subtract(n),yQ([Math.atan2(r.y,r.x),Math.asin(r.z),Math.sign(dl(i,RQ))*al(i)],t)}eastNorthUpToFixedFrame(e,t=new wu){return OQ(this,`east`,`north`,`up`,e,t)}localFrameToFixedFrame(e,t,n,r,i=new wu){return OQ(this,e,t,n,r,i)}geocentricSurfaceNormal(e,t=[0,0,0]){return NQ.from(e).normalize().to(t)}geodeticSurfaceNormalCartographic(e,t=[0,0,0]){let n=_Q(e),r=n[0],i=n[1],a=Math.cos(i);return NQ.set(a*Math.cos(r),a*Math.sin(r),Math.sin(i)).normalize(),NQ.to(t)}geodeticSurfaceNormal(e,t=[0,0,0]){return NQ.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(e,t){return MQ(e,this,t)}scaleToGeocentricSurface(e,t=[0,0,0]){IQ.from(e);let n=IQ.x,r=IQ.y,i=IQ.z,a=this.oneOverRadiiSquared,o=1/Math.sqrt(n*n*a.x+r*r*a.y+i*i*a.z);return IQ.multiplyScalar(o).to(t)}transformPositionToScaledSpace(e,t=[0,0,0]){return IQ.from(e).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(e,t=[0,0,0]){return IQ.from(e).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(e,t=0,n=[0,0,0]){zc(jc(this.radii.x,this.radii.y,td)),zc(this.radii.z>0),IQ.from(e);let r=IQ.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(r)>=this.radii.z-t))return IQ.set(0,0,r).to(n)}};zQ.WGS84=new zQ(fQ,pQ,mQ);var BQ=class{item;previous;next;constructor(e,t,n){this.item=e,this.previous=t,this.next=n}},VQ=class{head=null;tail=null;_length=0;get length(){return this._length}add(e){let t=new BQ(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t}remove(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}splice(e,t){e!==t&&(this.remove(t),this._insert(e,t))}_insert(e,t){let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e,++this._length}},HQ=class{_list;_sentinel;_trimTiles;constructor(){this._list=new VQ,this._sentinel=this._list.add(`sentinel`),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(e){let t=e._cacheNode;t&&this._list.splice(this._sentinel,t)}add(e,t,n){t._cacheNode||(t._cacheNode=this._list.add(t),n&&n(e,t))}unloadTile(e,t,n){let r=t._cacheNode;r&&(this._list.remove(r),t._cacheNode=null,n&&n(e,t))}unloadTiles(e,t){let n=this._trimTiles;this._trimTiles=!1;let r=this._list,i=e.maximumMemoryUsage*1024*1024,a=this._sentinel,o=r.head;for(;o!==a&&(e.gpuMemoryUsageInBytes>i||n);){let n=o.item;o=o.next,this.unloadTile(e,n,t)}}trim(){this._trimTiles=!0}};function UQ(e,t){bt(e),bt(t);let{rtcCenter:n,gltfUpAxis:r}=t,{computedTransform:i,boundingVolume:{center:a}}=e,o=new wu(i);switch(n&&o.translate(n),r){case`Z`:break;case`Y`:let e=new wu().rotateX(Math.PI/2);o=o.multiplyRight(e);break;case`X`:let t=new wu().rotateY(-Math.PI/2);o=o.multiplyRight(t);break;default:break}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);let s=new Y(a);t.cartesianModelMatrix=o,t.cartesianOrigin=s;let c=zQ.WGS84.cartesianToCartographic(s,new Y);t.cartographicModelMatrix=zQ.WGS84.eastNorthUpToFixedFrame(s).invert().multiplyRight(o),t.cartographicOrigin=c;let l=GQ(t);l&&(t.cartesianModelMatrix=new wu(o).multiplyRight(l.matrix),t.cartographicModelMatrix.multiplyRight(l.matrix),l.matrix=wu.IDENTITY),t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}var WQ=1e6**2;function GQ(e){let t=e.gltf;if(!t)return null;let n=typeof t.scene==`number`?t.scene:0,r=(t.scenes?.[n])?.nodes?.[0];if(!r?.matrix)return null;let i=r.matrix;return i[12]*i[12]+i[13]*i[13]+i[14]*i[14]<=WQ?null:r}var KQ=new Y,qQ=new Y,JQ=new gJ([new fJ,new fJ,new fJ,new fJ,new fJ,new fJ]);function YQ(e,t){let{cameraDirection:n,cameraUp:r,height:i}=e,{metersPerUnit:a}=e.distanceScales,o=$Q(e,e.center),s=zQ.WGS84.eastNorthUpToFixedFrame(o),c=e.unprojectPosition(e.cameraPosition),l=zQ.WGS84.cartographicToCartesian(c,new Y),u=new Y(s.transformAsVector(new Y(n).scale(a))).normalize(),d=new Y(s.transformAsVector(new Y(r).scale(a))).normalize();ZQ(e);let f=e.constructor,{longitude:p,latitude:m,width:h,bearing:g,zoom:_}=e,v=new f({longitude:p,latitude:m,height:i,width:h,bearing:g,zoom:_,pitch:0});return{camera:{position:l,direction:u,up:d},viewport:e,topDownViewport:v,height:i,cullingVolume:JQ,frameNumber:t,sseDenominator:1.15}}function XQ(e,t,n){if(n===0||e.length<=n)return[e,[]];let r=[],{longitude:i,latitude:a}=t.viewport;for(let[t,n]of e.entries()){let[e,o]=n.header.mbs,s=Math.abs(i-e),c=Math.abs(a-o),l=Math.sqrt(c*c+s*s);r.push([t,l])}let o=r.sort((e,t)=>e[1]-t[1]),s=[];for(let t=0;t0?o.normalize():o=new Y(0,1,0);let s=o.clone().cross(a);for(let e of[o,s,a]){g$.copy(e).scale(r);for(let e=0;e<2;e++)h$.copy(n),h$.add(g$),j$(t,h$),g$.negate()}return t}function A$(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function j$(e,t){zQ.WGS84.cartesianToCartographic(t,h$),e[0][0]=Math.min(e[0][0],h$[0]),e[0][1]=Math.min(e[0][1],h$[1]),e[0][2]=Math.min(e[0][2],h$[2]),e[1][0]=Math.max(e[1][0],h$[0]),e[1][1]=Math.max(e[1][1],h$[1]),e[1][2]=Math.max(e[1][2],h$[2])}new Y,new Y,new wu,new Y,new Y,new Y;function M$(e,t){let n=e*t;return 1-Math.exp(-(n*n))}function N$(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){let n=e.dynamicScreenSpaceErrorComputedDensity,r=e.dynamicScreenSpaceErrorFactor;return M$(t,n)*r}return 0}function P$(e,t,n){let r=e.tileset,i=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,a=n?i:e.lodMetricValue;if(a===0)return 0;let o=Math.max(e._distanceToCamera,1e-7),{height:s,sseDenominator:c}=t,{viewDistanceScale:l}=r.options,u=a*s*(l||1)/(o*c);return u-=N$(r,o),u}var F$=new Y,I$=new Y,L$=new Y,R$=new Y,z$=new Y,B$=new wu,V$=new wu;function H$(e,t){if(e.lodMetricValue===0||isNaN(e.lodMetricValue))return`DIG`;let n=2*U$(e,t);return n<2?`OUT`:!e.header.children||n<=e.lodMetricValue?`DRAW`:e.header.children?`DIG`:`OUT`}function U$(e,t){let{topDownViewport:n}=t,r=e.header.mbs[1],i=e.header.mbs[0],a=e.header.mbs[2],o=e.header.mbs[3],s=[...e.boundingVolume.center],c=n.unprojectPosition(n.cameraPosition);zQ.WGS84.cartographicToCartesian(c,F$),I$.copy(F$).subtract(s).normalize(),zQ.WGS84.eastNorthUpToFixedFrame(s,B$),V$.copy(B$).invert(),L$.copy(F$).transform(V$);let l=Math.sqrt(L$[0]*L$[0]+L$[1]*L$[1]),u=l*l/L$[2];R$.copy([L$[0],L$[1],u]);let d=R$.transform(B$).subtract(s).normalize(),f=I$.cross(d).normalize().scale(o).add(s),p=zQ.WGS84.cartesianToCartographic(f),m=n.project([i,r,a]),h=n.project(p);return z$.copy(m).subtract(h).magnitude()}function W$(e){return{assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||`Y`}}var G$=class{_map=new Map;_array;_length;constructor(e=0){this._array=Array(e),this._length=e}get length(){return this._length}set length(e){this._length=e,e>this._array.length&&(this._array.length=e)}get values(){return this._array}get(e){return bt(e=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}delete(e){let t=this._map.get(e);t>=0&&(this._array.splice(t,1),this._map.delete(e),this.length--)}peek(){return this._array[this._length-1]}push(e){if(!this._map.has(e)){let t=this.length++;this._array[t]=e,this._map.set(e,t)}}pop(){let e=this._array[--this.length];return this._map.delete(e),e}reserve(e){bt(e>=0),e>this._array.length&&(this._array.length=e)}resize(e){bt(e>=0),this.length=e}trim(e){e??=this.length,this._array.length=e}reset(){this._array=[],this._map=new Map,this._length=0}find(e){return this._map.has(e)}},K$={loadSiblings:!1,skipLevelOfDetail:!1,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:``},q$=class{options;root=null;selectedTiles={};requestedTiles={};emptyTiles={};lastUpdate=new Date().getTime();updateDebounceTime=1e3;_traversalStack=new G$;_emptyTraversalStack=new G$;_frameNumber=null;traversalFinished(e){return!0}constructor(e){this.options={...K$,...e}}traverse(e,t,n){this.root=e,this.options={...this.options,...n},this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(e,t){let n=this._traversalStack;for(e._selectionDepth=1,n.push(e);n.length>0;){let e=n.pop(),r=!1;this.canTraverse(e,t)&&(this.updateChildTiles(e,t),r=this.updateAndPushChildren(e,t,n,e.hasRenderContent?e._selectionDepth+1:e._selectionDepth));let i=e.parent,a=!!(!i||i._shouldRefine),o=!r;e.hasRenderContent?e.refine===l$.ADD?(this.loadTile(e,t),this.selectTile(e,t)):e.refine===l$.REPLACE&&(this.loadTile(e,t),o&&this.selectTile(e,t)):(this.emptyTiles[e.id]=e,this.loadTile(e,t),o&&this.selectTile(e,t)),this.touchTile(e,t),e._shouldRefine=r&&a}let r=new Date().getTime();(this.traversalFinished(t)||r-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=r,this.options.onTraversalEnd(t))}updateChildTiles(e,t){let n=e.children;for(let e of n)this.updateTile(e,t)}updateAndPushChildren(e,t,n,r){let{loadSiblings:i,skipLevelOfDetail:a}=this.options,o=e.children;o.sort(this.compareDistanceToCamera.bind(this));let s=e.refine===l$.REPLACE&&e.hasRenderContent&&!a,c=!1,l=!0;for(let e of o)if(e._selectionDepth=r,e.isVisibleAndInRequestVolume?(n.find(e)&&n.delete(e),n.push(e),c=!0):(s||i)&&(this.loadTile(e,t),this.touchTile(e,t)),s){let n;if(n=e._inRequestVolume?e.hasRenderContent?e.contentAvailable:this.executeEmptyTraversal(e,t):!1,l&&=n,!l)return!1}return c||(l=!1),l}updateTile(e,t){this.updateTileVisibility(e,t)}selectTile(e,t){this.shouldSelectTile(e)&&(e._selectedFrame=t.frameNumber,this.selectedTiles[e.id]=e)}loadTile(e,t){this.shouldLoadTile(e)&&(e._requestedFrame=t.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}touchTile(e,t){e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber}canTraverse(e,t){return e.hasChildren?e.hasTilesetContent?!e.contentExpired:this.shouldRefine(e,t):!1}shouldLoadTile(e){return e.hasUnloadedContent||e.contentExpired}shouldSelectTile(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(e,t,n=!1){let r=e._screenSpaceError;return n&&(r=e.getScreenSpaceError(t,!0)),r>e.tileset.memoryAdjustedScreenSpaceError}updateTileVisibility(e,t){let n=[];if(this.options.viewportTraversersMap)for(let e in this.options.viewportTraversersMap)this.options.viewportTraversersMap[e]===t.viewport.id&&n.push(e);else n.push(t.viewport.id);e.updateVisibility(t,n)}compareDistanceToCamera(e,t){return e._distanceToCamera-t._distanceToCamera}anyChildrenVisible(e,t){let n=!1;for(let r of e.children)r.updateVisibility(t),n||=r.isVisibleAndInRequestVolume;return n}executeEmptyTraversal(e,t){let n=!0,r=this._emptyTraversalStack;for(r.push(e);r.length>0;){let e=r.pop(),i=!e.hasRenderContent&&this.canTraverse(e,t),a=!e.hasRenderContent&&e.children.length===0;if(!i&&!e.contentAvailable&&!a&&(n=!1),this.updateTile(e,t),e.isVisibleAndInRequestVolume||(this.loadTile(e,t),this.touchTile(e,t)),i){let t=e.children;for(let e of t)r.push(e)}}return e.hasEmptyContent||n}},J$=new Y;function Y$(e){return e!=null}var X$=class{tileset;header;id;url;parent;refine;type;contentUrl;lodMetricType=`geometricError`;lodMetricValue=0;boundingVolume=null;content=null;contentState=c$.UNLOADED;gpuMemoryUsageInBytes=0;children=[];depth=0;viewportIds=[];transform=new wu;extensions=null;implicitTiling=null;userData={};computedTransform;hasEmptyContent=!1;hasTilesetContent=!1;traverser=new q$({});_cacheNode=null;_frameNumber=null;_expireDate=null;_expiredContent=null;_boundingBox=void 0;_distanceToCamera=0;_screenSpaceError=0;_visibilityPlaneMask;_visible=void 0;_contentBoundingVolume;_viewerRequestVolume;_initialTransform=new wu;_priority=0;_selectedFrame=0;_requestedFrame=0;_selectionDepth=0;_touchedFrame=0;_centerZDepth=0;_shouldRefine=!1;_stackLength=0;_visitedFrame=0;_inRequestVolume=!1;_lodJudge=null;tileDrawn=!0;constructor(e,t,n,r=``){this.header=t,this.tileset=e,this.id=r||t.id,this.url=t.url,this.parent=n,this.refine=this._getRefine(t.refine),this.type=t.type,this.contentUrl=t.contentUrl,this._initializeLodMetric(t),this._initializeTransforms(t),this._initializeBoundingVolumes(t),this._initializeContent(t),this._initializeRenderingState(t),Object.seal(this)}destroy(){this.header=null}isDestroyed(){return this.header===null}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===c$.READY||this.hasEmptyContent}get contentAvailable(){return!!(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===c$.UNLOADED}get contentExpired(){return this.contentState===c$.EXPIRED}get contentFailed(){return this.contentState===c$.FAILED}get distanceToCamera(){return this._distanceToCamera}get screenSpaceError(){return this._screenSpaceError}get boundingBox(){return this._boundingBox||=w$(this.header.boundingVolume,this.boundingVolume),this._boundingBox}getScreenSpaceError(e,t){switch(this.tileset.type){case d$.I3S:return U$(this,e);case d$.TILES3D:return P$(this,e,t);default:throw Error(`Unsupported tileset type`)}}unselect(){this._selectedFrame=0}_getGpuMemoryUsageInBytes(){return this.content.gpuMemoryUsageInBytes||this.content.byteLength||0}_getPriority(){let e=this.tileset._traverser,{skipLevelOfDetail:t}=e.options,n=this.refine===l$.ADD||t;if(n&&!this.isVisible&&this._visible!==void 0||this.tileset._frameNumber-this._touchedFrame>=1||this.contentState===c$.UNLOADED)return-1;let r=this.parent,i=r&&(!n||this._screenSpaceError===0||r.hasTilesetContent)?r._screenSpaceError:this._screenSpaceError,a=e.root?e.root._screenSpaceError:0;return Math.max(a-i,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=c$.LOADING;let e=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!e)return this.contentState=c$.UNLOADED,!1;try{let e=this.tileset.getTileUrl(this.contentUrl),t=this.tileset.loader,n=this.tileset.loadOptions[t.id]||{},r={...this.tileset.loadOptions,[t.id]:{...n,isTileset:this.type===`json`,...this._getLoaderSpecificOptions(t.id)}};return this.content=await ga(e,t,r),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=c$.READY,this._onContentLoaded(),!0}catch(e){throw this.contentState=c$.FAILED,e}finally{e.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=c$.UNLOADED,this.tileDrawn=!0,!0}updateVisibility(e,t){if(this._frameNumber===e.frameNumber)return;let n=this.parent,r=n?n._visibilityPlaneMask:gJ.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){let e=n?n.computedTransform:this.tileset.modelMatrix;this._updateTransform(e)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==gJ.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=t}visibility(e,t){let{cullingVolume:n}=e,{boundingVolume:r}=this;return n.computeVisibilityWithPlaneMask(r,t)}contentVisibility(){return!0}distanceToTile(e){let t=this.boundingVolume;return Math.sqrt(Math.max(t.distanceSquaredTo(e.camera.position),0))}cameraSpaceZDepth({camera:e}){let t=this.boundingVolume;return J$.subVectors(t.center,e.position),e.direction.dot(J$)}insideViewerRequestVolume(e){let t=this._viewerRequestVolume;return!t||t.distanceSquaredTo(e.camera.position)<=0}updateExpiration(){if(Y$(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){let e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=c$.EXPIRED,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(e){`lodMetricType`in e?this.lodMetricType=e.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn(`3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType`)),`lodMetricValue`in e?this.lodMetricValue=e.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn(`3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue`))}_initializeTransforms(e){this.transform=e.transform?new wu(e.transform):new wu;let t=this.parent,n=this.tileset,r=t&&t.computedTransform?t.computedTransform.clone():n.modelMatrix.clone();this.computedTransform=new wu(r).multiplyRight(this.transform);let i=t&&t._initialTransform?t._initialTransform.clone():new wu;this._initialTransform=new wu(i).multiplyRight(this.transform)}_initializeBoundingVolumes(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}_initializeContent(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=c$.UNLOADED,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=gJ.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(e){return e||this.parent&&this.parent.refine||l$.REPLACE}_isTileset(){return this.contentUrl.indexOf(`.json`)!==-1}_onContentLoaded(){switch(this.content&&this.content.type){case`vctr`:case`geom`:this.tileset._traverser.disableSkipLevelOfDetail=!0;break;default:}this._isTileset()?this.hasTilesetContent=!0:this.gpuMemoryUsageInBytes=this._getGpuMemoryUsageInBytes()}_updateBoundingVolume(e){this.boundingVolume=C$(e.boundingVolume,this.computedTransform,this.boundingVolume);let t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=C$(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=C$(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(e=new wu){let t=e.clone().multiplyRight(this.transform);t.equals(this.computedTransform)||(this.computedTransform=t,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(e){switch(e){case`i3s`:return{...this.tileset.options.i3s,_tileOptions:{attributeUrls:this.header.attributeUrls,textureUrl:this.header.textureUrl,textureFormat:this.header.textureFormat,textureLoaderOptions:this.header.textureLoaderOptions,materialDefinition:this.header.materialDefinition,isDracoGeometry:this.header.isDracoGeometry,mbs:this.header.mbs},_tilesetOptions:{store:this.tileset.tileset.store,attributeStorageInfo:this.tileset.tileset.attributeStorageInfo,fields:this.tileset.tileset.fields},isTileHeader:!1};default:return W$(this.tileset.tileset)}}},Z$=class extends q${compareDistanceToCamera(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}updateTileVisibility(e,t){if(super.updateTileVisibility(e,t),!e.isVisibleAndInRequestVolume)return;let n=e.children.length>0;if(e.hasTilesetContent&&n){let n=e.children[0];this.updateTileVisibility(n,t),e._visible=n._visible;return}if(this.meetsScreenSpaceErrorEarly(e,t)){e._visible=!1;return}let r=e.refine===l$.REPLACE,i=e._optimChildrenWithinParent===p$.USE_OPTIMIZATION;if(r&&i&&n&&!this.anyChildrenVisible(e,t)){e._visible=!1;return}}meetsScreenSpaceErrorEarly(e,t){let{parent:n}=e;return!n||n.hasTilesetContent||n.refine!==l$.ADD?!1:!this.shouldRefine(e,t,!0)}},Q$=class{frameNumberMap=new Map;register(e,t){let n=this.frameNumberMap.get(e)||new Map,r=n.get(t)||0;n.set(t,r+1),this.frameNumberMap.set(e,n)}deregister(e,t){let n=this.frameNumberMap.get(e);if(!n)return;let r=n.get(t)||1;n.set(t,r-1)}isZero(e,t){return(this.frameNumberMap.get(e)?.get(t)||0)===0}},$$={REQUESTED:`REQUESTED`,COMPLETED:`COMPLETED`,ERROR:`ERROR`},e1=class{_statusMap;pendingTilesRegister=new Q$;constructor(){this._statusMap={}}add(e,t,n,r){if(!this._statusMap[t]){let{frameNumber:i,viewport:{id:a}}=r;this._statusMap[t]={request:e,callback:n,key:t,frameState:r,status:$$.REQUESTED},this.pendingTilesRegister.register(a,i),e().then(e=>{this._statusMap[t].status=$$.COMPLETED;let{frameNumber:n,viewport:{id:i}}=this._statusMap[t].frameState;this.pendingTilesRegister.deregister(i,n),this._statusMap[t].callback(e,r)}).catch(e=>{this._statusMap[t].status=$$.ERROR;let{frameNumber:r,viewport:{id:i}}=this._statusMap[t].frameState;this.pendingTilesRegister.deregister(i,r),n(e)})}}update(e,t){if(this._statusMap[e]){let{frameNumber:n,viewport:{id:r}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(r,n);let{frameNumber:i,viewport:{id:a}}=t;this.pendingTilesRegister.register(a,i),this._statusMap[e].frameState=t}}find(e){return this._statusMap[e]}hasPendingTiles(e,t){return!this.pendingTilesRegister.isZero(e,t)}},t1=class extends q${_tileManager;constructor(e){super(e),this._tileManager=new e1}traversalFinished(e){return!this._tileManager.hasPendingTiles(e.viewport.id,this._frameNumber||0)}shouldRefine(e,t){return e._lodJudge=H$(e,t),e._lodJudge===`DIG`}updateChildTiles(e,t){let n=e.header.children||[],r=e.children,i=e.tileset;for(let a of n){let n=`${a.id}-${t.viewport.id}`,o=r&&r.find(e=>e.id===n);if(o)o&&this.updateTile(o,t);else{let r=()=>this._loadTile(a.id,i);this._tileManager.find(n)?this._tileManager.update(n,t):(i.tileset.nodePages&&(r=()=>i.tileset.nodePagesTile.formTileFromNodePages(a.id)),this._tileManager.add(r,n,t=>this._onTileLoad(t,e,n),t))}}return!1}async _loadTile(e,t){let{loader:n}=t;return await ga(t.getTileUrl(`${t.url}/nodes/${e}`),n,{...t.loadOptions,i3s:{...t.loadOptions.i3s,isTileHeader:!0}})}_onTileLoad(e,t,n){let r=new X$(t.tileset,e,t,n);t.children.push(r);let i=this._tileManager.find(r.id).frameState;this.updateTile(r,i),this._frameNumber===i.frameNumber&&(this.traversalFinished(i)||new Date().getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(r,i)}},n1={description:``,ellipsoid:zQ.WGS84,modelMatrix:new wu,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,memoryCacheOverflow:1,maximumTilesSelected:0,debounceTime:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:e=>e,onUpdate:()=>{},contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,memoryAdjustedScreenSpaceError:!1,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:``,i3s:{}},r1=`Tiles In Tileset(s)`,i1=`Tiles In Memory`,a1=`Tiles In View`,o1=`Tiles To Render`,s1=`Tiles Loaded`,c1=`Tiles Loading`,l1=`Tiles Unloaded`,u1=`Failed Tile Loads`,d1=`Points/Vertices`,f1=`Tile Memory Use`,p1=`Maximum Screen Space Error`,m1=class{options;loadOptions;type;tileset;loader;url;basePath;modelMatrix;ellipsoid;lodMetricType;lodMetricValue;refine;root=null;roots={};asset={};description=``;properties;extras=null;attributions={};credits={};stats;contentFormats={draco:!1,meshopt:!1,dds:!1,ktx2:!1};cartographicCenter=null;cartesianCenter=null;zoom=1;boundingVolume=null;dynamicScreenSpaceErrorComputedDensity=0;maximumMemoryUsage=32;gpuMemoryUsageInBytes=0;memoryAdjustedScreenSpaceError=0;_cacheBytes=0;_cacheOverflowBytes=0;_frameNumber=0;_queryParams={};_extensionsUsed=[];_tiles={};_pendingCount=0;selectedTiles=[];traverseCounter=0;geometricError=0;lastUpdatedVieports=null;_requestedTiles=[];_emptyTiles=[];frameStateData={};_traverser;_cache=new HQ;_requestScheduler;_heldTiles=new Set;updatePromise=null;tilesetInitializationPromise;constructor(e,t){this.options={...n1,...t},this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||ar(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.loadOptions=this.options.loadOptions||{},this._traverser=this._initializeTraverser(),this._requestScheduler=new Kn({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.memoryAdjustedScreenSpaceError=this.options.maximumScreenSpaceError,this._cacheBytes=this.options.maximumMemoryUsage*1024*1024,this._cacheOverflowBytes=this.options.memoryCacheOverflow*1024*1024,this.stats=new Te({id:this.url}),this._initializeStats(),this.tilesetInitializationPromise=this._initializeTileSet(e)}destroy(){this._destroy()}isLoaded(){return this._pendingCount===0&&this._frameNumber!==0&&this._requestedTiles.length===0}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return new URLSearchParams(this._queryParams).toString()}setProps(e){this.options={...this.options,...e}}getTileUrl(e){if(e.startsWith(`data:`))return e;let t=e;return this.queryParams.length&&(t=`${e}${e.includes(`?`)?`&`:`?`}${this.queryParams}`),t}hasExtension(e){return this._extensionsUsed.indexOf(e)>-1}update(e=null){this.tilesetInitializationPromise.then(()=>{!e&&this.lastUpdatedVieports?e=this.lastUpdatedVieports:this.lastUpdatedVieports=e,e&&this.doUpdate(e)})}async selectTiles(e=null){return await this.tilesetInitializationPromise,e&&(this.lastUpdatedVieports=e),this.updatePromise||=new Promise(e=>{setTimeout(()=>{this.lastUpdatedVieports&&this.doUpdate(this.lastUpdatedVieports),e(this._frameNumber),this.updatePromise=null},this.options.debounceTime)}),this.updatePromise}adjustScreenSpaceError(){this.gpuMemoryUsageInBytesthis._cacheBytes+this._cacheOverflowBytes&&(this.memoryAdjustedScreenSpaceError*=1.02)}doUpdate(e){if(`loadTiles`in this.options&&!this.options.loadTiles||this.traverseCounter>0)return;let t=e instanceof Array?e:[e];this._cache.reset(),this._frameNumber++,this.traverseCounter=t.length;let n=[];for(let e of t){let t=e.id;this._needTraverse(t)?n.push(t):this.traverseCounter--}for(let e of t){let t=e.id;if(this.roots[t]||(this.roots[t]=this._initializeTileHeaders(this.tileset,null)),!n.includes(t))continue;let r=YQ(e,this._frameNumber);this._traverser.traverse(this.roots[t],r,this.options)}}_needTraverse(e){let t=e;return this.options.viewportTraversersMap&&(t=this.options.viewportTraversersMap[e]),t===e}_onTraversalEnd(e){let t=e.viewport.id;this.frameStateData[t]||(this.frameStateData[t]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});let n=this.frameStateData[t],[r,i]=XQ(Object.values(this._traverser.selectedTiles),e,this.options.maximumTilesSelected);n.selectedTiles=r;for(let e of i)e.unselect();n._requestedTiles=Object.values(this._traverser.requestedTiles),n._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,!(this.traverseCounter>0)&&this._updateTiles()}_updateTiles(){let e=this.selectedTiles;this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(let e in this.frameStateData){let t=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(t.selectedTiles),this._requestedTiles=this._requestedTiles.concat(t._requestedTiles),this._emptyTiles=this._emptyTiles.concat(t._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);let t=new Set(this.selectedTiles.map(e=>e.id)),n=this.selectedTiles.some(e=>!e.tileDrawn),r=0;if(n){for(let e of t)this._heldTiles.add(e);for(let e of this._heldTiles){if(t.has(e))continue;let n=this._tiles[e];n&&n.contentAvailable?(n._selectedFrame=this._frameNumber,this.selectedTiles.push(n),r++):this._heldTiles.delete(e)}}else this._heldTiles=t;r>0&&setTimeout(()=>{this.selectTiles()},0);for(let e of this.selectedTiles)this._tiles[e.id]=e;this._loadTiles(),this._unloadTiles(),this._updateStats(),this._tilesChanged(e,this.selectedTiles)&&this.options.onUpdate()}_tilesChanged(e,t){if(e.length!==t.length)return!0;let n=new Set(e.map(e=>e.id)),r=new Set(t.map(e=>e.id)),i=e.filter(e=>!r.has(e.id)).length>0;return i||=t.filter(e=>!n.has(e.id)).length>0,i}_loadTiles(){this._requestedTiles.sort((e,t)=>e._priority-t._priority);for(let e of this._requestedTiles)e.contentUnloaded&&this._loadTile(e)}_unloadTiles(){this._cache.unloadTiles(this,(e,t)=>e._unloadTile(t))}_updateStats(){let e=0,t=0;for(let n of this.selectedTiles)n.contentAvailable&&n.content&&(e++,n.content.pointCount?t+=n.content.pointCount:t+=n.content.vertexCount);this.stats.get(a1).count=this.selectedTiles.length,this.stats.get(o1).count=e,this.stats.get(d1).count=t,this.stats.get(p1).count=this.memoryAdjustedScreenSpaceError}async _initializeTileSet(e){this.type===d$.I3S&&(this.calculateViewPropsI3S(),e.root=await e.root),this.root=this._initializeTileHeaders(e,null),this.type===d$.TILES3D&&(this._initializeTiles3DTileset(e),this.calculateViewPropsTiles3D()),this.type===d$.I3S&&this._initializeI3STileset()}calculateViewPropsI3S(){let e=this.tileset.fullExtent;if(e){let{xmin:t,xmax:n,ymin:r,ymax:i,zmin:a,zmax:o}=e;this.cartographicCenter=new Y(t+(n-t)/2,r+(i-r)/2,a+(o-a)/2),this.cartesianCenter=new Y,zQ.WGS84.cartographicToCartesian(this.cartographicCenter,this.cartesianCenter),this.zoom=a$(e,this.cartographicCenter,this.cartesianCenter);return}let t=this.tileset.store?.extent;if(t){let[e,n,r,i]=t;this.cartographicCenter=new Y(e+(r-e)/2,n+(i-n)/2,0),this.cartesianCenter=new Y,zQ.WGS84.cartographicToCartesian(this.cartographicCenter,this.cartesianCenter),this.zoom=o$(t,this.cartographicCenter,this.cartesianCenter);return}console.warn(`Extent is not defined in the tileset header`),this.cartographicCenter=new Y,this.zoom=1}calculateViewPropsTiles3D(){let e=this.root,{center:t}=e.boundingVolume;if(!t){console.warn(`center was not pre-calculated for the root tile`),this.cartographicCenter=new Y,this.zoom=1;return}t[0]!==0||t[1]!==0||t[2]!==0?(this.cartographicCenter=new Y,zQ.WGS84.cartesianToCartographic(t,this.cartographicCenter)):this.cartographicCenter=new Y(0,0,-zQ.WGS84.radii[0]),this.cartesianCenter=t,this.zoom=i$(e.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get(r1),this.stats.get(c1),this.stats.get(i1),this.stats.get(a1),this.stats.get(o1),this.stats.get(s1),this.stats.get(l1),this.stats.get(u1),this.stats.get(d1),this.stats.get(f1,`memory`),this.stats.get(p1)}_initializeTileHeaders(e,t){let n=new X$(this,e.root,t);if(t&&(t.children.push(n),n.depth=t.depth+1),this.type===d$.TILES3D){let e=[];for(e.push(n);e.length>0;){let t=e.pop();this.stats.get(r1).incrementCount();let n=t.header.children||[];for(let r of n){let n=new X$(this,r,t);if(n.contentUrl?.includes(`?session=`)){let e=new URL(n.contentUrl).searchParams.get(`session`);e&&(this._queryParams.session=e)}t.children.push(n),n.depth=t.depth+1,e.push(n)}}}return n}_initializeTraverser(){let e;switch(this.type){case d$.TILES3D:e=Z$;break;case d$.I3S:e=t1;break;default:e=q$}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(e){this._destroySubtree(e)}async _loadTile(e){let t;try{this._onStartTileLoading(),t=await e.loadContent()}catch(t){this._onTileLoadError(e,t instanceof Error?t:Error(`load failed`))}finally{this._onEndTileLoading(),this._onTileLoad(e,t)}}_onTileLoadError(e,t){this.stats.get(u1).incrementCount();let n=t.message||t.toString(),r=e.url;console.error(`A 3D tile failed to load: ${e.url} ${n}`),this.options.onTileError(e,n,r)}_onTileLoad(e,t){if(t){if(this.type===d$.I3S){let e=this.tileset?.nodePagesTile?.nodesInNodePages||0;this.stats.get(r1).reset(),this.stats.get(r1).addCount(e)}e&&e.content&&UQ(e,e.content),this.updateContentTypes(e),this._addTileToCache(e),this.options.onTileLoad(e)}}updateContentTypes(e){if(this.type===d$.I3S)switch(e.header.isDracoGeometry&&(this.contentFormats.draco=!0),e.header.textureFormat){case`dds`:this.contentFormats.dds=!0;break;case`ktx2`:this.contentFormats.ktx2=!0;break;default:}else if(this.type===d$.TILES3D){let{extensionsRemoved:t=[]}=e.content?.gltf||{};t.includes(`KHR_draco_mesh_compression`)&&(this.contentFormats.draco=!0),t.includes(`EXT_meshopt_compression`)&&(this.contentFormats.meshopt=!0),t.includes(`KHR_texture_basisu`)&&(this.contentFormats.ktx2=!0)}}_onStartTileLoading(){this._pendingCount++,this.stats.get(c1).incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get(c1).decrementCount()}_addTileToCache(e){this._cache.add(this,e,t=>t._updateCacheStats(e))}_updateCacheStats(e){this.stats.get(s1).incrementCount(),this.stats.get(i1).incrementCount(),this.gpuMemoryUsageInBytes+=e.gpuMemoryUsageInBytes||0,this.stats.get(f1).count=this.gpuMemoryUsageInBytes,this.options.memoryAdjustedScreenSpaceError&&this.adjustScreenSpaceError()}_unloadTile(e){this.gpuMemoryUsageInBytes-=e.gpuMemoryUsageInBytes||0,this.stats.get(i1).decrementCount(),this.stats.get(l1).incrementCount(),this.stats.get(f1).count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}_destroy(){let e=[];for(this.root&&e.push(this.root);e.length>0;){let t=e.pop();for(let n of t.children)e.push(n);this._destroyTile(t)}this.root=null}_destroySubtree(e){let t=e,n=[];for(n.push(t);n.length>0;){e=n.pop();for(let t of e.children)n.push(t);e!==t&&this._destroyTile(e)}t.children=[]}_destroyTile(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}_initializeTiles3DTileset(e){if(e.queryString){let t=new URLSearchParams(e.queryString),n=Object.fromEntries(t.entries());this._queryParams={...this._queryParams,...n}}if(this.asset=e.asset,!this.asset)throw Error(`Tileset must have an asset property.`);if(this.asset.version!==`0.0`&&this.asset.version!==`1.0`&&this.asset.version!==`1.1`)throw Error(`The tileset must be 3D Tiles version either 0.0 or 1.0 or 1.1.`);`tilesetVersion`in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||``,this.properties=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed||[],this.extras=e.extras}_initializeI3STileset(){let e=this.loadOptions.i3s;e&&typeof e==`object`&&`token`in e&&(this._queryParams.token=e.token)}},h1=`4.4.3`,g1={COMPOSITE:`cmpt`,POINT_CLOUD:`pnts`,BATCHED_3D_MODEL:`b3dm`,INSTANCED_3D_MODEL:`i3dm`,GEOMETRY:`geom`,VECTOR:`vect`,GLTF:`glTF`};Object.keys(g1);function _1(e,t,n){bt(e instanceof ArrayBuffer);let r=new TextDecoder(`utf8`),i=new Uint8Array(e,t,n);return r.decode(i)}function v1(e,t=0){let n=new DataView(e);return`\ +${String.fromCharCode(n.getUint8(t+0))}\ +${String.fromCharCode(n.getUint8(t+1))}\ +${String.fromCharCode(n.getUint8(t+2))}\ +${String.fromCharCode(n.getUint8(t+3))}`}var y1={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},b1={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},x1={...y1,...b1},S1={[b1.DOUBLE]:Float64Array,[b1.FLOAT]:Float32Array,[b1.UNSIGNED_SHORT]:Uint16Array,[b1.UNSIGNED_INT]:Uint32Array,[b1.UNSIGNED_BYTE]:Uint8Array,[b1.BYTE]:Int8Array,[b1.SHORT]:Int16Array,[b1.INT]:Int32Array},C1={DOUBLE:b1.DOUBLE,FLOAT:b1.FLOAT,UNSIGNED_SHORT:b1.UNSIGNED_SHORT,UNSIGNED_INT:b1.UNSIGNED_INT,UNSIGNED_BYTE:b1.UNSIGNED_BYTE,BYTE:b1.BYTE,SHORT:b1.SHORT,INT:b1.INT},w1=`Failed to convert GL type`,T1=class e{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(let t in S1)if(S1[t]===e)return t;throw Error(w1)}static fromName(e){let t=C1[e];if(!t)throw Error(w1);return t}static getArrayType(e){switch(e){case b1.UNSIGNED_SHORT_5_6_5:case b1.UNSIGNED_SHORT_4_4_4_4:case b1.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let t=S1[e];if(!t)throw Error(w1);return t}}static getByteSize(t){return e.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return!!e.getArrayType(t)}static createTypedArray(t,n,r=0,i){i===void 0&&(i=(n.byteLength-r)/e.getByteSize(t));let a=ArrayBuffer.isView(n)?n.buffer:n;return new(e.getArrayType(t))(a,r,i)}};function E1(e,t){if(!e)throw Error(`math.gl assertion failed. ${t}`)}function D1(e,t=[0,0,0]){let n=e>>11&31,r=e>>5&63,i=e&31;return t[0]=n<<3,t[1]=r<<2,t[2]=i<<3,t}new rl,new Y,new rl,new rl;function O1(e,t=255){return kc(e,0,t)/t*2-1}function k1(e){return e<0?-1:1}function A1(e,t,n,r){if(E1(r),e<0||e>n||t<0||t>n)throw Error(`x and y must be unsigned normalized integers between 0 and ${n}`);if(r.x=O1(e,n),r.y=O1(t,n),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){let e=r.x;r.x=(1-Math.abs(r.y))*k1(e),r.y=(1-Math.abs(e))*k1(r.y)}return r.normalize()}function j1(e,t,n){return A1(e,t,255,n)}var M1=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(e,t){this.json=e,this.buffer=t}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return!!this.json[e]}getGlobalProperty(e,t=x1.UNSIGNED_INT,n=1){let r=this.json[e];return r&&Number.isFinite(r.byteOffset)?this._getTypedArrayFromBinary(e,t,n,1,r.byteOffset):r}getPropertyArray(e,t,n){let r=this.json[e];return r&&Number.isFinite(r.byteOffset)?(`componentType`in r&&(t=T1.fromName(r.componentType)),this._getTypedArrayFromBinary(e,t,n,this.featuresLength,r.byteOffset)):this._getTypedArrayFromArray(e,t,r)}getProperty(e,t,n,r,i){let a=this.json[e];if(!a)return a;let o=this.getPropertyArray(e,t,n);if(n===1)return o[r];for(let e=0;ee[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},F1={SCALAR:(e,t,n)=>{t[n]=e},VEC2:(e,t,n)=>{t[2*n+0]=e[0],t[2*n+1]=e[1]},VEC3:(e,t,n)=>{t[3*n+0]=e[0],t[3*n+1]=e[1],t[3*n+2]=e[2]},VEC4:(e,t,n)=>{t[4*n+0]=e[0],t[4*n+1]=e[1],t[4*n+2]=e[2],t[4*n+3]=e[3]},MAT2:(e,t,n)=>{t[4*n+0]=e[0],t[4*n+1]=e[1],t[4*n+2]=e[2],t[4*n+3]=e[3]},MAT3:(e,t,n)=>{t[9*n+0]=e[0],t[9*n+1]=e[1],t[9*n+2]=e[2],t[9*n+3]=e[3],t[9*n+4]=e[4],t[9*n+5]=e[5],t[9*n+6]=e[6],t[9*n+7]=e[7],t[9*n+8]=e[8],t[9*n+9]=e[9]},MAT4:(e,t,n)=>{t[16*n+0]=e[0],t[16*n+1]=e[1],t[16*n+2]=e[2],t[16*n+3]=e[3],t[16*n+4]=e[4],t[16*n+5]=e[5],t[16*n+6]=e[6],t[16*n+7]=e[7],t[16*n+8]=e[8],t[16*n+9]=e[9],t[16*n+10]=e[10],t[16*n+11]=e[11],t[16*n+12]=e[12],t[16*n+13]=e[13],t[16*n+14]=e[14],t[16*n+15]=e[15]}};function I1(e,t,n,r){let{componentType:i}=e;bt(e.componentType);let a=typeof i==`string`?T1.fromName(i):i,o=N1[e.type],s=P1[e.type],c=F1[e.type];return n+=e.byteOffset,{values:T1.createTypedArray(a,t,n,o*r),type:a,size:o,unpacker:s,packer:c}}var L1=e=>e!==void 0;function R1(e,t,n){if(!t)return null;let r=e.getExtension(`3DTILES_batch_table_hierarchy`),i=t.HIERARCHY;return i&&(console.warn(`3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy.`),t.extensions=t.extensions||{},t.extensions[`3DTILES_batch_table_hierarchy`]=i,r=i),r?z1(r,n):null}function z1(e,t){let n,r,i,a=e.instancesLength,o=e.classes,s=e.classIds,c=e.parentCounts,l=e.parentIds,u=a;L1(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,GL.UNSIGNED_SHORT),s.type=AttributeType.SCALAR,i=getBinaryAccessor(s),s=i.createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,a));let d;if(L1(c))for(L1(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,a)),d=new Uint16Array(a),u=0,n=0;n0?V1(e,t,n):H1(e,t,n)}function V1(e,t,n){let r=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=r.length,c=scratchVisited;c.length=Math.max(c.length,s);let l=++marker,u=scratchStack;for(u.length=0,u.push(t);u.length>0;){if(t=u.pop(),c[t]===l)continue;c[t]=l;let r=n(e,t);if(L1(r))return r;let s=i[t],d=o[t];for(let e=0;ee,q1={HIERARCHY:!0,extensions:!0,extras:!0},J1=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(e,t,n,r={}){bt(n>=0),this.json=e||{},this.binary=t,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(let e in this.json)q1[e]||(this._properties[e]=this.json[e]);this._binaryProperties=this._initializeBinaryProperties(),r[`3DTILES_batch_table_hierarchy`]&&(this._hierarchy=R1(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,t){return this._checkBatchId(e),bt(typeof t==`string`,t),this._hierarchy?G1(B1(this._hierarchy,e,(e,n)=>{let r=e.classIds[n];return e.classes[r].name===t})):!1}isExactClass(e,t){return bt(typeof t==`string`,t),this.getExactClassName(e)===t}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){let t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}hasProperty(e,t){return this._checkBatchId(e),bt(typeof t==`string`,t),G1(this._properties[t])||this._hasPropertyInHierarchy(e,t)}getPropertyNames(e,t){this._checkBatchId(e),t=G1(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}getProperty(e,t){if(this._checkBatchId(e),bt(typeof t==`string`,t),this._binaryProperties){let n=this._binaryProperties[t];if(G1(n))return this._getBinaryProperty(n,e)}let n=this._properties[t];if(G1(n))return K1(n[e],!0);if(this._hierarchy){let n=this._getHierarchyProperty(e,t);if(G1(n))return n}}setProperty(e,t,n){let r=this.featureCount;if(this._checkBatchId(e),bt(typeof t==`string`,t),this._binaryProperties){let r=this._binaryProperties[t];if(r){this._setBinaryProperty(r,e,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,e,t,n))return;let i=this._properties[t];G1(i)||(this._properties[t]=Array(r),i=this._properties[t]),i[e]=K1(n,!0)}_checkBatchId(e){if(!(e>=0&&e{let r=e.classIds[n],i=e.classes[r].instances;return G1(i[t])})):!1}_getPropertyNamesInHierarchy(e,t){B1(this._hierarchy,e,(e,n)=>{let r=e.classIds[n],i=e.classes[r].instances;for(let e in i)i.hasOwnProperty(e)&&t.indexOf(e)===-1&&t.push(e)})}_getHierarchyProperty(e,t){return B1(this._hierarchy,e,(e,n)=>{let r=e.classIds[n],i=e.classes[r],a=e.classIndexes[n],o=i.instances[t];return G1(o)?G1(o.typedArray)?this._getBinaryProperty(o,a):K1(o[a],!0):null})}_setHierarchyProperty(e,t,n,r){return G1(B1(this._hierarchy,t,(e,i)=>{let a=e.classIds[i],o=e.classes[a],s=e.classIndexes[i],c=o.instances[n];return G1(c)?(bt(i===t,`Inherited property "${n}" is read-only.`),G1(c.typedArray)?this._setBinaryProperty(c,s,r):c[s]=K1(r,!0),!0):!1}))}},Y1=4;function X1(e,t,n=0){let r=new DataView(t);if(e.magic=r.getUint32(n,!0),n+=Y1,e.version=r.getUint32(n,!0),n+=Y1,e.byteLength=r.getUint32(n,!0),n+=Y1,e.version!==1)throw Error(`3D Tile Version ${e.version} not supported`);return n}var Z1=4,Q1=`b3dm tile in legacy format.`;function $1(e,t,n){let r=new DataView(t),i;e.header=e.header||{};let a=r.getUint32(n,!0);n+=Z1;let o=r.getUint32(n,!0);n+=Z1;let s=r.getUint32(n,!0);n+=Z1;let c=r.getUint32(n,!0);return n+=Z1,s>=570425344?(n-=Z1*2,i=a,s=o,c=0,a=0,o=0,console.warn(Q1)):c>=570425344&&(n-=Z1,i=s,s=a,c=o,a=0,o=0,console.warn(Q1)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=c,e.header.batchLength=i,n}function e0(e,t,n,r){return n=t0(e,t,n,r),n=n0(e,t,n,r),n}function t0(e,t,n,r){let{featureTableJsonByteLength:i,featureTableBinaryByteLength:a,batchLength:o}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){let r=_1(t,n,i);e.featureTableJson=JSON.parse(r)}return n+=i||0,e.featureTableBinary=new Uint8Array(t,n,a),n+=a||0,n}function n0(e,t,n,r){let{batchTableJsonByteLength:i,batchTableBinaryByteLength:a}=e.header||{};if(i&&i>0){let r=_1(t,n,i);e.batchTableJson=JSON.parse(r),n+=i,a&&a>0&&(e.batchTableBinary=new Uint8Array(t,n,a),e.batchTableBinary=new Uint8Array(e.batchTableBinary),n+=a)}return n}function r0(e,t,n){if(!t&&(!e||!e.batchIds||!n))return null;let{batchIds:r,isRGB565:i,pointCount:a=0}=e;if(r&&n){let e=new Uint8ClampedArray(a*3);for(let t=0;te*255);e[t*3]=a[0],e[t*3+1]=a[1],e[t*3+2]=a[2]}return{type:x1.UNSIGNED_BYTE,value:e,size:3,normalized:!0}}if(t&&i){let e=new Uint8ClampedArray(a*3);for(let n=0;n12;){let o={shape:`tile3d`};e.tiles.push(o),n=await a(t,n,r,i,o)}return n}async function D0(e,t,n,r){if(e.rotateYtoZ=!0,e.gltfUpAxis=n?.[`3d-tiles`]?.assetGltfUpAxis?n[`3d-tiles`].assetGltfUpAxis:`Y`,n?.[`3d-tiles`]?.loadGLTF){if(!r)return t.byteLength;e.gltf=GE(await yt(t,PE,n,r)),e.gpuMemoryUsageInBytes=lS(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function O0(e,t=0,n,r,i={shape:`tile3d`}){switch(i.byteOffset=t,i.type=v1(e,t),i.type){case g1.COMPOSITE:return await E0(i,e,t,n,r,O0);case g1.BATCHED_3D_MODEL:return await x0(i,e,t,n,r);case g1.GLTF:return await D0(i,e,n,r);case g1.INSTANCED_3D_MODEL:return await C0(i,e,t,n,r);case g1.POINT_CLOUD:return await c0(i,e,t,n,r);default:throw Error(`3DTileLoader: unknown type ${i.type}`)}}var k0=1952609651,A0=1;async function j0(e,t,n){if(new Uint32Array(e.slice(0,4))[0]!==k0)throw Error(`Wrong subtree file magic number`);if(new Uint32Array(e.slice(4,8))[0]!==A0)throw Error(`Wrong subtree file verson, must be 1`);let r=N0(e.slice(8,16)),i=new Uint8Array(e,24,r),a=new TextDecoder(`utf8`).decode(i),o=JSON.parse(a),s=N0(e.slice(16,24)),c=new ArrayBuffer(0);if(s&&(c=e.slice(24+r)),await M0(o,o.tileAvailability,c,n),Array.isArray(o.contentAvailability))for(let e of o.contentAvailability)await M0(o,e,c,n);else await M0(o,o.contentAvailability,c,n);return await M0(o,o.childSubtreeAvailability,c,n),o}async function M0(e,t,n,r){let i=Number.isFinite(t.bitstream)?t.bitstream:t.bufferView;if(typeof i!=`number`)return;let a=e.bufferViews[i],o=e.buffers[a.buffer];if(!r?.baseUrl)throw Error(`Url is not provided`);if(!r.fetch)throw Error(`fetch is not provided`);if(o.uri){let e=`${r?.baseUrl||``}/${o.uri}`,n=await(await r.fetch(e)).arrayBuffer();t.explicitBitstream=new Uint8Array(n,a.byteOffset,a.byteLength);return}let s=e.buffers.slice(0,a.buffer).reduce((e,t)=>e+t.byteLength,0);t.explicitBitstream=new Uint8Array(n.slice(s,s+o.byteLength),a.byteOffset,a.byteLength)}function N0(e){let t=new DataView(e);return t.getUint32(0,!0)+2**32*t.getUint32(4,!0)}var P0={dataType:null,batchType:null,id:`3d-tiles-subtree`,name:`3D Tiles Subtree`,module:`3d-tiles`,version:h1,extensions:[`subtree`],mimeTypes:[`application/octet-stream`],tests:[`subtree`],parse:j0,options:{}},F0=null;try{F0=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function I0(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}I0.prototype.__isLong__,Object.defineProperty(I0.prototype,"__isLong__",{value:!0});function L0(e){return(e&&e.__isLong__)===!0}function R0(e){var t=Math.clz32(e&-e);return e?31-t:t}I0.isLong=L0;var z0={},B0={};function V0(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=B0[e],r)?r:(n=U0(e,0,!0),i&&(B0[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=z0[e],r)?r:(n=U0(e,e<0?-1:0,!1),i&&(z0[e]=n),n))}I0.fromInt=V0;function H0(e,t){if(isNaN(e))return t?e2:$0;if(t){if(e<0)return e2;if(e>=X0)return a2}else{if(e<=-Z0)return o2;if(e+1>=Z0)return i2}return e<0?H0(-e,t).neg():U0(e%Y0|0,e/Y0|0,t)}I0.fromNumber=H0;function U0(e,t,n){return new I0(e,t,n)}I0.fromBits=U0;var W0=Math.pow;function G0(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?e2:$0;if(n||=10,n<2||360)throw Error(`interior hyphen`);if(r===0)return G0(e.substring(1),t,n).neg();for(var i=H0(W0(n,8)),a=$0,o=0;o>>0:this.low},Q.toNumber=function(){return this.unsigned?(this.high>>>0)*Y0+(this.low>>>0):this.high*Y0+(this.low>>>0)},Q.toString=function(e){if(e||=10,e<2||36>>0).toString(e);if(a=s,a.isZero())return c+o;for(;c.length<6;)c=`0`+c;o=``+c+o}},Q.getHighBits=function(){return this.high},Q.getHighBitsUnsigned=function(){return this.high>>>0},Q.getLowBits=function(){return this.low},Q.getLowBitsUnsigned=function(){return this.low>>>0},Q.getNumBitsAbs=function(){if(this.isNegative())return this.eq(o2)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<>21;return!e||!this.unsigned&&e===-1&&!(this.low===0&&this.high===-2097152)},Q.isZero=function(){return this.high===0&&this.low===0},Q.eqz=Q.isZero,Q.isNegative=function(){return!this.unsigned&&this.high<0},Q.isPositive=function(){return this.unsigned||this.high>=0},Q.isOdd=function(){return(this.low&1)==1},Q.isEven=function(){return(this.low&1)==0},Q.equals=function(e){return L0(e)||(e=K0(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},Q.eq=Q.equals,Q.notEquals=function(e){return!this.eq(e)},Q.neq=Q.notEquals,Q.ne=Q.notEquals,Q.lessThan=function(e){return this.comp(e)<0},Q.lt=Q.lessThan,Q.lessThanOrEqual=function(e){return this.comp(e)<=0},Q.lte=Q.lessThanOrEqual,Q.le=Q.lessThanOrEqual,Q.greaterThan=function(e){return this.comp(e)>0},Q.gt=Q.greaterThan,Q.greaterThanOrEqual=function(e){return this.comp(e)>=0},Q.gte=Q.greaterThanOrEqual,Q.ge=Q.greaterThanOrEqual,Q.compare=function(e){if(L0(e)||(e=K0(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},Q.comp=Q.compare,Q.negate=function(){return!this.unsigned&&this.eq(o2)?o2:this.not().add(t2)},Q.neg=Q.negate,Q.add=function(e){L0(e)||(e=K0(e));var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,i=this.low&65535,a=e.high>>>16,o=e.high&65535,s=e.low>>>16,c=e.low&65535,l=0,u=0,d=0,f=0;return f+=i+c,d+=f>>>16,f&=65535,d+=r+s,u+=d>>>16,d&=65535,u+=n+o,l+=u>>>16,u&=65535,l+=t+a,l&=65535,U0(d<<16|f,l<<16|u,this.unsigned)},Q.subtract=function(e){return L0(e)||(e=K0(e)),this.add(e.neg())},Q.sub=Q.subtract,Q.multiply=function(e){if(this.isZero())return this;if(L0(e)||(e=K0(e)),F0)return U0(F0.mul(this.low,this.high,e.low,e.high),F0.get_high(),this.unsigned);if(e.isZero())return this.unsigned?e2:$0;if(this.eq(o2))return e.isOdd()?o2:$0;if(e.eq(o2))return this.isOdd()?o2:$0;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(Q0)&&e.lt(Q0))return H0(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,i=this.low&65535,a=e.high>>>16,o=e.high&65535,s=e.low>>>16,c=e.low&65535,l=0,u=0,d=0,f=0;return f+=i*c,d+=f>>>16,f&=65535,d+=r*c,u+=d>>>16,d&=65535,d+=i*s,u+=d>>>16,d&=65535,u+=n*c,l+=u>>>16,u&=65535,u+=r*s,l+=u>>>16,u&=65535,u+=i*o,l+=u>>>16,u&=65535,l+=t*c+n*s+r*o+i*a,l&=65535,U0(d<<16|f,l<<16|u,this.unsigned)},Q.mul=Q.multiply,Q.divide=function(e){if(L0(e)||(e=K0(e)),e.isZero())throw Error(`division by zero`);if(F0)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:U0((this.unsigned?F0.div_u:F0.div_s)(this.low,this.high,e.low,e.high),F0.get_high(),this.unsigned);if(this.isZero())return this.unsigned?e2:$0;var t,n,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return e2;if(e.gt(this.shru(1)))return n2;r=e2}else{if(this.eq(o2))return e.eq(t2)||e.eq(r2)?o2:e.eq(o2)?t2:(t=this.shr(1).div(e).shl(1),t.eq($0)?e.isNegative()?t2:r2:(n=this.sub(e.mul(t)),r=t.add(n.div(e)),r));if(e.eq(o2))return this.unsigned?e2:$0;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=$0}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(t)/Math.LN2),a=i<=48?1:W0(2,i-48),o=H0(t),s=o.mul(e);s.isNegative()||s.gt(n);)t-=a,o=H0(t,this.unsigned),s=o.mul(e);o.isZero()&&(o=t2),r=r.add(o),n=n.sub(s)}return r},Q.div=Q.divide,Q.modulo=function(e){return L0(e)||(e=K0(e)),F0?U0((this.unsigned?F0.rem_u:F0.rem_s)(this.low,this.high,e.low,e.high),F0.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},Q.mod=Q.modulo,Q.rem=Q.modulo,Q.not=function(){return U0(~this.low,~this.high,this.unsigned)},Q.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},Q.clz=Q.countLeadingZeros,Q.countTrailingZeros=function(){return this.low?R0(this.low):R0(this.high)+32},Q.ctz=Q.countTrailingZeros,Q.and=function(e){return L0(e)||(e=K0(e)),U0(this.low&e.low,this.high&e.high,this.unsigned)},Q.or=function(e){return L0(e)||(e=K0(e)),U0(this.low|e.low,this.high|e.high,this.unsigned)},Q.xor=function(e){return L0(e)||(e=K0(e)),U0(this.low^e.low,this.high^e.high,this.unsigned)},Q.shiftLeft=function(e){return L0(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?U0(this.low<>>32-e,this.unsigned):U0(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):U0(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},Q.shr=Q.shiftRight,Q.shiftRightUnsigned=function(e){return L0(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?U0(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):U0(e===32?this.high:this.high>>>e-32,0,this.unsigned)},Q.shru=Q.shiftRightUnsigned,Q.shr_u=Q.shiftRightUnsigned,Q.rotateLeft=function(e){var t;return L0(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?U0(this.high,this.low,this.unsigned):e<32?(t=32-e,U0(this.low<>>t,this.high<>>t,this.unsigned)):(e-=32,t=32-e,U0(this.high<>>t,this.low<>>t,this.unsigned))},Q.rotl=Q.rotateLeft,Q.rotateRight=function(e){var t;return L0(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?U0(this.high,this.low,this.unsigned):e<32?(t=32-e,U0(this.high<>>e,this.low<>>e,this.unsigned)):(e-=32,t=32-e,U0(this.low<>>e,this.high<>>e,this.unsigned))},Q.rotr=Q.rotateRight,Q.toSigned=function(){return this.unsigned?U0(this.low,this.high,!1):this},Q.toUnsigned=function(){return this.unsigned?this:U0(this.low,this.high,!0)},Q.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},Q.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},Q.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},I0.fromBytes=function(e,t,n){return n?I0.fromBytesLE(e,t):I0.fromBytesBE(e,t)},I0.fromBytesLE=function(e,t){return new I0(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},I0.fromBytesBE=function(e,t){return new I0(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},typeof BigInt==`function`&&(I0.fromBigInt=function(e,t){return U0(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},I0.fromValue=function(e,t){return typeof e==`bigint`?I0.fromBigInt(e,t):K0(e,t)},Q.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<=0;e--){a=i-e;let t=r[e],n=0,s=0;t===`1`?s=1:t===`2`?(n=1,s=1):t===`3`&&(n=1);let c=2**(a-1);b2(c,o,n,s),o[0]+=c*n,o[1]+=c*s}if(n%2==1){let e=o[0];o[0]=o[1],o[1]=e}return{face:n,ij:o,level:a}}function m2(e){if(e.isZero())return``;let t=e.toString(2);for(;t.length<64;)t=`0`+t;let n=t.lastIndexOf(`1`),r=t.substring(0,3),i=t.substring(3,n),a=i.length/2,o=I0.fromString(r,!0,2).toString(10),s=``;if(a!==0)for(s=I0.fromString(i,!0,2).toString(4);s.length=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function _2(e){return[g2(e[0]),g2(e[1])]}function v2(e,[t,n]){switch(e){case 0:return[1,t,n];case 1:return[-t,1,n];case 2:return[-t,-n,1];case 3:return[-1,-n,-t];case 4:return[n,-1,-t];case 5:return[n,t,-1];default:throw Error(`Invalid face`)}}function y2([e,t,n]){let r=Math.atan2(n,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*f2,r*f2]}function b2(e,t,n,r){if(r===0){n===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let r=t[0];t[0]=t[1],t[1]=r}}function x2(e){let t=_2(h2(e.ij,e.level,[.5,.5]));return y2(v2(e.face,t))}var S2=100;function C2(e){let{face:t,ij:n,level:r}=e,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(S2*2**-r)),o=new Float64Array(4*a*2+2),s=0,c=0;for(let e=0;e<4;e++){let l=i[e].slice(0),u=i[e+1],d=(u[0]-l[0])/a,f=(u[1]-l[1])/a;for(let e=0;e89.999&&(e[0]=c);let i=e[0]-c;e[0]+=i>180?-360:i<-180?360:0,o[s++]=e[0],o[s++]=e[1],c=e[0]}}return o[s++]=o[0],o[s++]=o[1],o}function w2(e){return p2(T2(e))}function T2(e){return e.indexOf(`/`)>0?e:m2(c2(e))}function E2(e){return x2(w2(e))}function D2(e){let t;if(e.face===2||e.face===5){let n=null,r=0;for(let t=0;t<4;t++){let i=C2(w2(`${e.face}/${t}`));n??=new Float64Array(4*i.length),n.set(i,r),r+=i.length}t=O2(n)}else t=O2(C2(e));return t}function O2(e){if(e.length%2!=0)throw Error(`Invalid corners`);let t=[],n=[];for(let r=0;re-t),n.sort((e,t)=>e-t),{west:t[0],east:t[t.length-1],north:n[n.length-1],south:n[0]}}function k2(e,t){let n=t?.minimumHeight||0,r=t?.maximumHeight||0,i=D2(w2(e)),a=i.west,o=i.south,s=i.east,c=i.north,l=[];return l.push(new Y(a,c,n)),l.push(new Y(s,c,n)),l.push(new Y(s,o,n)),l.push(new Y(a,o,n)),l.push(new Y(a,c,r)),l.push(new Y(s,c,r)),l.push(new Y(s,o,r)),l.push(new Y(a,o,r)),l}function A2(e){let t=e.token,n={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},r=k2(t,n),i=E2(t),a=i[0],o=i[1],s=zQ.WGS84.cartographicToCartesian([a,o,n.maximumHeight]),c=new Y(s[0],s[1],s[2]);r.push(c);let l=FJ(r);return[...l.center,...l.halfAxes]}var j2={QUADTREE:4,OCTREE:8};function M2(e,t,n){if(e?.box){let r=l2(u2(c2(e.s2VolumeInfo.token),t)),i={...e.s2VolumeInfo};switch(i.token=r,n){case`OCTREE`:let t=e.s2VolumeInfo,n=t.maximumHeight-t.minimumHeight,r=n/2,i=t.minimumHeight+n/2;t.minimumHeight=i-r,t.maximumHeight=i+r;break;default:break}return{box:A2(i),s2VolumeInfo:i}}}async function N2(e){let{subtree:t,subtreeData:n={level:0,x:0,y:0,z:0},parentData:r={mortonIndex:0,localLevel:-1,localX:0,localY:0,localZ:0},childIndex:i=0,implicitOptions:a,loaderOptions:o,s2VolumeBox:s}=e,{subdivisionScheme:c,subtreeLevels:l,maximumLevel:u,contentUrlTemplate:d,subtreesUriTemplate:f,basePath:p}=a,m={children:[],lodMetricValue:0,contentUrl:``};if(!u)return W.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${d} won't be loaded...`),m;let h=r.localLevel+1,g=n.level+h;if(g>u)return m;let _=j2[c],v=Math.log2(_),y=i&1,b=i>>1&1,x=i>>2&1,S=L2(r.localX,y,1),C=L2(r.localY,b,1),w=L2(r.localZ,x,1),T=L2(n.x,S,h),E=L2(n.y,C,h),D=L2(n.z,w,h),O=L2(r.mortonIndex,i,v),k=h===l&&P2(t.childSubtreeAvailability,O),A,j,M,N;if(k?(A=await ga(R2(`${p}/${f}`,g,T,E,D),P0,o),N=0,j={level:g,x:T,y:E,z:D},M={mortonIndex:0,localLevel:0,localX:0,localY:0,localZ:0}):(A=t,N=(_**h-1)/(_-1)+O,j=n,M={mortonIndex:O,localLevel:h,localX:S,localY:C,localZ:w}),!P2(A.tileAvailability,N))return m;P2(A.contentAvailability,N)&&(m.contentUrl=R2(d,g,T,E,D));for(let e=0;e<_;e++){let t=M2(s,e,c),n=await N2({subtree:A,subtreeData:j,parentData:M,childIndex:e,implicitOptions:a,loaderOptions:o,s2VolumeBox:t});(n.contentUrl||n.children.length)&&m.children.push(n)}return m.contentUrl||m.children.length?F2(m,{level:g,x:T,y:E,z:D},a,s):m}function P2(e,t){let n;return Array.isArray(e)?(n=e[0],e.length>1&&W.once(`Not supported extension "3DTILES_multiple_contents" has been detected`)):n=e,`constant`in n?!!n.constant:n.explicitBitstream?B2(t,n.explicitBitstream):!1}function F2(e,t,n,r){let{basePath:i,refine:a,getRefine:o,lodMetricType:s,getTileType:c,rootLodMetricValue:l,rootBoundingVolume:u}=n,d=e.contentUrl&&e.contentUrl.replace(`${i}/`,``),f=l/2**t.level,p=I2(r?.box?{box:r.box}:u,t,n.subdivisionScheme);return{children:e.children,contentUrl:e.contentUrl,content:{uri:d},id:e.contentUrl,refine:o(a),type:c(e),lodMetricType:s,lodMetricValue:f,geometricError:f,transform:e.transform,boundingVolume:p}}function I2(e,t,n){if(e.region){let{level:r,x:i,y:a,z:o}=t,[s,c,l,u,d,f]=e.region,p=2**r,m=(l-s)/p,[h,g]=[s+m*i,s+m*(i+1)],_=(u-c)/p,[v,y]=[c+_*a,c+_*(a+1)],b,x;if(n===`OCTREE`){let e=(f-d)/p;[b,x]=[d+e*o,d+e*(o+1)]}else[b,x]=[d,f];return{region:[h,v,g,y,b,x]}}if(e.box)return e;throw Error(`Unsupported bounding volume type ${JSON.stringify(e)}`)}function L2(e,t,n){return(e<a[e])}function z2(e){let t={};for(let n in e)t[`{${n}}`]=e[n];return t}function B2(e,t){let n=Math.floor(e/8),r=e%8;return(t[n]>>r&1)==1}function V2(e,t=``){if(!t)return u$.EMPTY;let n=t.split(`?`)[0].split(`.`).pop();switch(n){case`pnts`:return u$.POINTCLOUD;case`i3dm`:case`b3dm`:case`glb`:case`gltf`:return u$.SCENEGRAPH;default:return n||u$.EMPTY}}function H2(e){switch(e){case`REPLACE`:case`replace`:return l$.REPLACE;case`ADD`:case`add`:return l$.ADD;default:return e}}function U2(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let n=new URL(e,`${t}/`);return decodeURI(n.toString())}else if(e.startsWith(`/`))return e;return or(t,e)}function W2(e,t){if(!e)return null;let n;if(e.content){let r=e.content.uri||e.content?.url;r!==void 0&&(n=U2(r,t))}return{...e,id:n,contentUrl:n,lodMetricType:f$.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:V2(e,n),refine:H2(e.refine)}}async function G2(e,t,n){let r=null,i=J2(e.root);r=i&&e.root?await K2(e.root,e,t,i,n):W2(e.root,t);let a=[];for(a.push(r);a.length>0;){let r=a.pop()||{},i=r.children||[],o=[];for(let r of i){let i=J2(r),s;s=i?await K2(r,e,t,i,n):W2(r,t),s&&(o.push(s),a.push(s))}r.children=o}return r}async function K2(e,t,n,r,i){let{subdivisionScheme:a,maximumLevel:o,availableLevels:s,subtreeLevels:c,subtrees:{uri:l}}=r,u=await ga(U2(R2(l,0,0,0,0),n),P0,i),d=e.content?.uri,f=d?U2(d,n):``,p=t?.root?.refine,m=e.geometricError,h=e.boundingVolume.extensions?.[`3DTILES_bounding_volume_S2`];h&&(e.boundingVolume={box:A2(h),s2VolumeInfo:h});let g=e.boundingVolume;return await q2(e,n,u,{contentUrlTemplate:f,subtreesUriTemplate:l,subdivisionScheme:a,subtreeLevels:c,maximumLevel:Number.isFinite(s)?s-1:o,refine:p,basePath:n,lodMetricType:f$.GEOMETRIC_ERROR,rootLodMetricValue:m,rootBoundingVolume:g,getTileType:V2,getRefine:H2},i)}async function q2(e,t,n,r,i){if(!e)return null;let{children:a,contentUrl:o}=await N2({subtree:n,implicitOptions:r,loaderOptions:i}),s,c=null;return o&&(s=o,c={uri:o.replace(`${t}/`,``)}),{...e,id:s,contentUrl:s,lodMetricType:f$.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:V2(e,s),refine:H2(e.refine),content:c||e.content,children:a}}function J2(e){return e?.extensions?.[`3DTILES_implicit_tiling`]||e?.implicitTiling}var Y2={dataType:null,batchType:null,id:`3d-tiles`,name:`3D Tiles`,module:`3d-tiles`,version:h1,extensions:[`cmpt`,`pnts`,`b3dm`,`i3dm`],mimeTypes:[`application/octet-stream`],tests:[`cmpt`,`pnts`,`b3dm`,`i3dm`],parse:X2,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:`auto`,assetGltfUpAxis:null}}};async function X2(e,t={},n){let r=t[`3d-tiles`]||{},i;return i=r.isTileset===`auto`?n?.url&&n.url.indexOf(`.json`)!==-1:r.isTileset,i?Z2(e,t,n):Q2(e,t,n)}async function Z2(e,t,n){let r=JSON.parse(new TextDecoder().decode(e)),i=n?.url||``,a=$2(i),o=await G2(r,a,t||{});return{...r,shape:`tileset3d`,loader:Y2,url:i,queryString:n?.queryString||``,basePath:a,root:o||r.root,type:d$.TILES3D,lodMetricType:f$.GEOMETRIC_ERROR,lodMetricValue:r.root?.geometricError||0}}async function Q2(e,t,n){let r={content:{shape:`tile3d`,featureIds:null}};return await O0(e,0,t,n,r.content),r.content}function $2(e){return ar(e)}var e4=class{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(e={}){Ht(e)}async compress(e){return await this.preload(),this.compressSync(e)}async decompress(e,t){return await this.preload(),this.decompressSync(e,t)}compressSync(e){throw Error(`${this.name}: sync compression not supported`)}decompressSync(e,t){throw Error(`${this.name}: sync decompression not supported`)}async*compressBatches(e){let t=await this.concatenate(e);yield this.compress(t)}async*decompressBatches(e){let t=await this.concatenate(e);yield this.decompress(t)}concatenate(e){return In(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}},t4=r((e=>{var t=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!=`object`)throw TypeError(r+`must be non-object`);for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+r),i);return}for(var a=0;a{var t=t4(),n=4,r=0,i=1,a=2;function o(e){for(var t=e.length;--t>=0;)e[t]=0}var s=0,c=1,l=2,u=3,d=258,f=29,p=256,m=p+1+f,h=30,g=19,_=2*m+1,v=15,y=16,b=7,x=256,S=16,C=17,w=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],E=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=512,A=Array((m+2)*2);o(A);var j=Array(h*2);o(j);var M=Array(k);o(M);var N=Array(d-u+1);o(N);var P=Array(f);o(P);var ee=Array(h);o(ee);function F(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var I,te,ne;function re(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function ie(e){return e<256?M[e]:M[256+(e>>>7)]}function ae(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function L(e,t,n){e.bi_valid>y-n?(e.bi_buf|=t<>y-e.bi_valid,e.bi_valid+=n-y):(e.bi_buf|=t<>>=1,n<<=1;while(--t>0);return n>>>1}function ce(e){e.bi_valid===16?(ae(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function le(e,t){var n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=v;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<_;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}}function ue(e,t,n){var r=Array(v+1),i=0,a,o;for(a=1;a<=v;a++)r[a]=i=i+n[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=se(r[s]++,s))}}function de(){var e,t,n,r,i,a=Array(v+1);for(n=0,r=0;r>=7;r8?ae(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function me(e,n,r,i){pe(e),i&&(ae(e,r),ae(e,~r)),t.arraySet(e.pending_buf,e.window,n,r,e.pending),e.pending+=r}function R(e,t,n,r){var i=t*2,a=n*2;return e[i]>1;o>=1;o--)z(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],z(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,z(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],le(e,t),ue(n,c,e.bl_count)}function _e(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s=3&&e.bl_tree[O[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function ye(e,t,n,r){var i;for(L(e,t-257,5),L(e,n-1,5),L(e,r-4,4),i=0;i>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return r;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return i;for(n=32;n0?(e.strm.data_type===a&&(e.strm.data_type=V(e)),ge(e,e.l_desc),ge(e,e.d_desc),u=B(e),o=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&t!==-1?xe(e,t,r,i):e.strategy===n||s===o?(L(e,(c<<1)+ +!!i,3),he(e,A,j)):(L(e,(l<<1)+ +!!i,3),ye(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),he(e,e.dyn_ltree,e.dyn_dtree)),fe(e),i&&pe(e)}function we(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(N[n]+p+1)*2]++,e.dyn_dtree[ie(t)*2]++),e.last_lit===e.lit_bufsize-1}e._tr_init=be,e._tr_stored_block=xe,e._tr_flush_block=Ce,e._tr_tally=we,e._tr_align=Se})),r4=r(((e,t)=>{function n(e,t,n,r){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}t.exports=n})),i4=r(((e,t)=>{function n(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var r=n();function i(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s>>8^a[(e^t[s])&255];return e^-1}t.exports=i})),a4=r(((e,t)=>{t.exports={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`}})),o4=r((e=>{var t=t4(),n=n4(),r=r4(),i=i4(),a=a4(),o=0,s=1,c=3,l=4,u=5,d=0,f=1,p=-2,m=-3,h=-5,g=-1,_=1,v=2,y=3,b=4,x=0,S=2,C=8,w=9,T=15,E=8,D=286,O=30,k=19,A=2*D+1,j=15,M=3,N=258,P=N+M+1,ee=32,F=42,I=69,te=73,ne=91,re=103,ie=113,ae=666,L=1,oe=2,se=3,ce=4,le=3;function ue(e,t){return e.msg=a[t],t}function de(e){return(e<<1)-(e>4?9:0)}function fe(e){for(var t=e.length;--t>=0;)e[t]=0}function pe(e){var n=e.state,r=n.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(t.arraySet(e.output,n.pending_buf,n.pending_out,r,e.next_out),e.next_out+=r,n.pending_out+=r,e.total_out+=r,e.avail_out-=r,n.pending-=r,n.pending===0&&(n.pending_out=0))}function me(e,t){n._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,pe(e.strm)}function R(e,t){e.pending_buf[e.pending++]=t}function z(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function he(e,n,a,o){var s=e.avail_in;return s>o&&(s=o),s===0?0:(e.avail_in-=s,t.arraySet(n,e.input,e.next_in,s,a),e.state.wrap===1?e.adler=r(e.adler,n,s,a):e.state.wrap===2&&(e.adler=i(e.adler,n,s,a)),e.next_in+=s,e.total_in+=s,s)}function ge(e,t){var n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-P?e.strstart-(e.w_size-P):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+N,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(i=t,l[i+o]!==m||l[i+o-1]!==p||l[i]!==l[r]||l[++i]!==l[r+1])continue;r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&ro){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead}function _e(e){var n=e.w_size,r,i,a,o,s;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-P)){t.arraySet(e.window,e.window,n,n,0),e.match_start-=n,e.strstart-=n,e.block_start-=n,i=e.hash_size,r=i;do a=e.head[--r],e.head[r]=a>=n?a-n:0;while(--i);i=n,r=i;do a=e.prev[--r],e.prev[r]=a>=n?a-n:0;while(--i);o+=n}if(e.strm.avail_in===0)break;if(i=he(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=i,e.lookahead+e.insert>=M)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(_e(e),e.lookahead===0&&t===o)return L;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,me(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-P&&(me(e,!1),e.strm.avail_out===0))return L}return e.insert=0,t===l?(me(e,!0),e.strm.avail_out===0?se:ce):(e.strstart>e.block_start&&(me(e,!1),e.strm.avail_out),L)}function B(e,t){for(var r,i;;){if(e.lookahead=M&&(e.ins_h=(e.ins_h<=M)if(i=n._tr_tally(e,e.strstart-e.match_start,e.match_length-M),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=M){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<=M&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=M-1)),e.prev_length>=M&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-M,i=n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-M),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=(e.ins_h<=M&&e.strstart>0&&(a=e.strstart-1,i=c[a],i===c[++a]&&i===c[++a]&&i===c[++a])){s=e.strstart+N;do;while(i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&ae.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=M?(r=n._tr_tally(e,1,e.match_length-M),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(me(e,!1),e.strm.avail_out===0))return L}return e.insert=0,t===l?(me(e,!0),e.strm.avail_out===0?se:ce):e.last_lit&&(me(e,!1),e.strm.avail_out===0)?L:oe}function H(e,t){for(var r;;){if(e.lookahead===0&&(_e(e),e.lookahead===0)){if(t===o)return L;break}if(e.match_length=0,r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(me(e,!1),e.strm.avail_out===0))return L}return e.insert=0,t===l?(me(e,!0),e.strm.avail_out===0?se:ce):e.last_lit&&(me(e,!1),e.strm.avail_out===0)?L:oe}function be(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var xe=[new be(0,0,0,0,ve),new be(4,4,8,4,B),new be(4,5,16,8,B),new be(4,6,32,32,B),new be(4,4,16,16,ye),new be(8,16,32,32,ye),new be(8,16,128,128,ye),new be(8,32,128,256,ye),new be(32,128,258,1024,ye),new be(32,258,258,4096,ye)];function Se(e){e.window_size=2*e.w_size,fe(e.head),e.max_lazy_match=xe[e.level].max_lazy,e.good_match=xe[e.level].good_length,e.nice_match=xe[e.level].nice_length,e.max_chain_length=xe[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=M-1,e.match_available=0,e.ins_h=0}function Ce(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=C,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new t.Buf16(A*2),this.dyn_dtree=new t.Buf16((2*O+1)*2),this.bl_tree=new t.Buf16((2*k+1)*2),fe(this.dyn_ltree),fe(this.dyn_dtree),fe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(j+1),this.heap=new t.Buf16(2*D+1),fe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*D+1),fe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function we(e){var t;return!e||!e.state?ue(e,p):(e.total_in=e.total_out=0,e.data_type=S,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?F:ie,e.adler=t.wrap===2?0:1,t.last_flush=o,n._tr_init(t),d)}function Te(e){var t=we(e);return t===d&&Se(e.state),t}function Ee(e,t){return!e||!e.state||e.state.wrap!==2?p:(e.state.gzhead=t,d)}function De(e,n,r,i,a,o){if(!e)return p;var s=1;if(n===g&&(n=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),a<1||a>w||r!==C||i<8||i>15||n<0||n>9||o<0||o>b)return ue(e,p);i===8&&(i=9);var c=new Ce;return e.state=c,c.strm=e,c.wrap=s,c.gzhead=null,c.w_bits=i,c.w_size=1<u||t<0)return e?ue(e,p):p;if(a=e.state,!e.output||!e.input&&e.avail_in!==0||a.status===ae&&t!==l)return ue(e,e.avail_out===0?h:p);if(a.strm=e,r=a.last_flush,a.last_flush=t,a.status===F)if(a.wrap===2)e.adler=0,R(a,31),R(a,139),R(a,8),a.gzhead?(R(a,+!!a.gzhead.text+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),R(a,a.gzhead.time&255),R(a,a.gzhead.time>>8&255),R(a,a.gzhead.time>>16&255),R(a,a.gzhead.time>>24&255),R(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),R(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(R(a,a.gzhead.extra.length&255),R(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=i(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=I):(R(a,0),R(a,0),R(a,0),R(a,0),R(a,0),R(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),R(a,le),a.status=ie);else{var _=C+(a.w_bits-8<<4)<<8,b=-1;b=a.strategy>=v||a.level<2?0:a.level<6?1:a.level===6?2:3,_|=b<<6,a.strstart!==0&&(_|=ee),_+=31-_%31,a.status=ie,z(a,_),a.strstart!==0&&(z(a,e.adler>>>16),z(a,e.adler&65535)),e.adler=1}if(a.status===I)if(a.gzhead.extra){for(m=a.pending;a.gzindex<(a.gzhead.extra.length&65535)&&!(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),pe(e),m=a.pending,a.pending===a.pending_buf_size));)R(a,a.gzhead.extra[a.gzindex]&255),a.gzindex++;a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=te)}else a.status=te;if(a.status===te)if(a.gzhead.name){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),pe(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindexm&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.gzindex=0,a.status=ne)}else a.status=ne;if(a.status===ne)if(a.gzhead.comment){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),pe(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindexm&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.status=re)}else a.status=re;if(a.status===re&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&pe(e),a.pending+2<=a.pending_buf_size&&(R(a,e.adler&255),R(a,e.adler>>8&255),e.adler=0,a.status=ie)):a.status=ie),a.pending!==0){if(pe(e),e.avail_out===0)return a.last_flush=-1,d}else if(e.avail_in===0&&de(t)<=de(r)&&t!==l)return ue(e,h);if(a.status===ae&&e.avail_in!==0)return ue(e,h);if(e.avail_in!==0||a.lookahead!==0||t!==o&&a.status!==ae){var x=a.strategy===v?H(a,t):a.strategy===y?V(a,t):xe[a.level].func(a,t);if((x===se||x===ce)&&(a.status=ae),x===L||x===se)return e.avail_out===0&&(a.last_flush=-1),d;if(x===oe&&(t===s?n._tr_align(a):t!==u&&(n._tr_stored_block(a,0,0,!1),t===c&&(fe(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),pe(e),e.avail_out===0))return a.last_flush=-1,d}return t===l?a.wrap<=0?f:(a.wrap===2?(R(a,e.adler&255),R(a,e.adler>>8&255),R(a,e.adler>>16&255),R(a,e.adler>>24&255),R(a,e.total_in&255),R(a,e.total_in>>8&255),R(a,e.total_in>>16&255),R(a,e.total_in>>24&255)):(z(a,e.adler>>>16),z(a,e.adler&65535)),pe(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending===0?f:d):d}function Ae(e){var t;return!e||!e.state?p:(t=e.state.status,t!==F&&t!==I&&t!==te&&t!==ne&&t!==re&&t!==ie&&t!==ae?ue(e,p):(e.state=null,t===ie?ue(e,m):d))}function je(e,n){var i=n.length,a,o,s,c,l,u,f,m;if(!e||!e.state||(a=e.state,c=a.wrap,c===2||c===1&&a.status!==F||a.lookahead))return p;for(c===1&&(e.adler=r(e.adler,n,i,0)),a.wrap=0,i>=a.w_size&&(c===0&&(fe(a.head),a.strstart=0,a.block_start=0,a.insert=0),m=new t.Buf8(a.w_size),t.arraySet(m,n,i-a.w_size,a.w_size,0),n=m,i=a.w_size),l=e.avail_in,u=e.next_in,f=e.input,e.avail_in=i,e.next_in=0,e.input=n,_e(a);a.lookahead>=M;){o=a.strstart,s=a.lookahead-(M-1);do a.ins_h=(a.ins_h<{var t=t4(),n=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var i=new t.Buf8(256),a=0;a<256;a++)i[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;i[254]=i[254]=1,e.string2buf=function(e){var n,r,i,a,o,s=e.length,c=0;for(a=0;a>>6,n[o++]=128|r&63):r<65536?(n[o++]=224|r>>>12,n[o++]=128|r>>>6&63,n[o++]=128|r&63):(n[o++]=240|r>>>18,n[o++]=128|r>>>12&63,n[o++]=128|r>>>6&63,n[o++]=128|r&63);return n};function o(e,i){if(i<65534&&(e.subarray&&r||!e.subarray&&n))return String.fromCharCode.apply(null,t.shrinkBuf(e,i));for(var a=``,o=0;o4){l[r++]=65533,n+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&n1){l[r++]=65533;continue}a<65536?l[r++]=a:(a-=65536,l[r++]=55296|a>>10&1023,l[r++]=56320|a&1023)}return o(l,r)},e.utf8border=function(e,t){var n;for(t||=e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+i[e[n]]>t?n:t}})),c4=r(((e,t)=>{function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}t.exports=n})),l4=r((e=>{var t=o4(),n=t4(),r=s4(),i=a4(),a=c4(),o=Object.prototype.toString,s=0,c=4,l=0,u=1,d=2,f=-1,p=0,m=8;function h(e){if(!(this instanceof h))return new h(e);this.options=n.assign({level:f,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:``},e||{});var s=this.options;s.raw&&s.windowBits>0?s.windowBits=-s.windowBits:s.gzip&&s.windowBits>0&&s.windowBits<16&&(s.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var c=t.deflateInit2(this.strm,s.level,s.method,s.windowBits,s.memLevel,s.strategy);if(c!==l)throw Error(i[c]);if(s.header&&t.deflateSetHeader(this.strm,s.header),s.dictionary){var u=typeof s.dictionary==`string`?r.string2buf(s.dictionary):o.call(s.dictionary)===`[object ArrayBuffer]`?new Uint8Array(s.dictionary):s.dictionary;if(c=t.deflateSetDictionary(this.strm,u),c!==l)throw Error(i[c]);this._dict_set=!0}}h.prototype.push=function(e,i){var a=this.strm,f=this.options.chunkSize,p,m;if(this.ended)return!1;m=i===~~i?i:i===!0?c:s,typeof e==`string`?a.input=r.string2buf(e):o.call(e)===`[object ArrayBuffer]`?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(a.avail_out===0&&(a.output=new n.Buf8(f),a.next_out=0,a.avail_out=f),p=t.deflate(a,m),p!==u&&p!==l)return this.onEnd(p),this.ended=!0,!1;(a.avail_out===0||a.avail_in===0&&(m===c||m===d))&&(this.options.to===`string`?this.onData(r.buf2binstring(n.shrinkBuf(a.output,a.next_out))):this.onData(n.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||a.avail_out===0)&&p!==u);return m===c?(p=t.deflateEnd(this.strm),this.onEnd(p),this.ended=!0,p===l):m===d?(this.onEnd(l),a.avail_out=0,!0):!0},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===l&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function g(e,t){var n=new h(t);if(n.push(e,!0),n.err)throw n.msg||i[n.err];return n.result}function _(e,t){return t||={},t.raw=!0,g(e,t)}function v(e,t){return t||={},t.gzip=!0,g(e,t)}e.Deflate=h,e.deflate=g,e.deflateRaw=_,e.gzip=v})),u4=r(((e,t)=>{t.exports=function(e,t){var n=e.state,r=e.next_in,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=e.input,E;i=r+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),c=n.dmax,l=n.wsize,u=n.whave,d=n.wnext,f=n.window,p=n.hold,m=n.bits,h=n.lencode,g=n.distcode,_=(1<>>24,p>>>=b,m-=b,b=y>>>16&255,b===0)E[a++]=y&65535;else if(b&16){x=y&65535,b&=15,b&&(m>>=b,m-=b),m<15&&(p+=T[r++]<>>24,p>>>=b,m-=b,b=y>>>16&255,b&16){if(S=y&65535,b&=15,mc){e.msg=`invalid distance too far back`,n.mode=30;break top}if(p>>>=b,m-=b,b=a-o,S>b){if(b=S-b,b>u&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break top}if(C=0,w=f,d===0){if(C+=l-b,b2;)E[a++]=w[C++],E[a++]=w[C++],E[a++]=w[C++],x-=3;x&&(E[a++]=w[C++],x>1&&(E[a++]=w[C++]))}else{C=a-S;do E[a++]=E[C++],E[a++]=E[C++],E[a++]=E[C++],x-=3;while(x>2);x&&(E[a++]=E[C++],x>1&&(E[a++]=E[C++]))}}else if(b&64){e.msg=`invalid distance code`,n.mode=30;break top}else{y=g[(y&65535)+(p&(1<>3,r-=x,m-=x<<3,p&=(1<{var n=t4(),r=15,i=852,a=592,o=0,s=1,c=2,l=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],u=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],d=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],f=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,p,m,h,g,_,v){var y=v.bits,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A,j,M,N,P,ee=null,F=0,I,te=new n.Buf16(r+1),ne=new n.Buf16(r+1),re=null,ie=0,ae,L,oe;for(b=0;b<=r;b++)te[b]=0;for(x=0;x=1&&te[C]===0;C--);if(w>C&&(w=C),C===0)return h[g++]=20971520,h[g++]=20971520,v.bits=1,0;for(S=1;S0&&(e===o||C!==1))return-1;for(ne[1]=0,b=1;bi||e===c&&O>a)return 1;for(;;){ae=b-E,_[x]I?(L=re[ie+_[x]],oe=ee[F+_[x]]):(L=96,oe=0),A=1<>E)+j]=ae<<24|L<<16|oe|0;while(j!==0);for(A=1<>=1;if(A===0?k=0:(k&=A-1,k+=A),x++,--te[b]===0){if(b===C)break;b=t[p+_[x]]}if(b>w&&(k&N)!==M){for(E===0&&(E=w),P+=S,T=b-E,D=1<i||e===c&&O>a)return 1;M=k&N,h[M]=w<<24|T<<16|P-g|0}}return k!==0&&(h[P+k]=b-E<<24|4194304),v.bits=w,0}})),f4=r((e=>{var t=t4(),n=r4(),r=i4(),i=u4(),a=d4(),o=0,s=1,c=2,l=4,u=5,d=6,f=0,p=1,m=2,h=-2,g=-3,_=-4,v=-5,y=8,b=1,x=2,S=3,C=4,w=5,T=6,E=7,D=8,O=9,k=10,A=11,j=12,M=13,N=14,P=15,ee=16,F=17,I=18,te=19,ne=20,re=21,ie=22,ae=23,L=24,oe=25,se=26,ce=27,le=28,ue=29,de=30,fe=31,pe=32,me=852,R=592,z=15;function he(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function ge(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _e(e){var n;return!e||!e.state?h:(n=e.state,e.total_in=e.total_out=n.total=0,e.msg=``,n.wrap&&(e.adler=n.wrap&1),n.mode=b,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new t.Buf32(me),n.distcode=n.distdyn=new t.Buf32(R),n.sane=1,n.back=-1,f)}function ve(e){var t;return!e||!e.state?h:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,_e(e))}function B(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?h:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,ve(e))}function ye(e,t){var n,r;return e?(r=new ge,e.state=r,r.window=null,n=B(e,t),n!==f&&(e.state=null),n):h}function V(e){return ye(e,z)}var H=!0,be,xe;function Se(e){if(H){var n;for(be=new t.Buf32(512),xe=new t.Buf32(32),n=0;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(a(s,e.lens,0,288,be,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;a(c,e.lens,0,32,xe,0,e.work,{bits:5}),H=!1}e.lencode=be,e.lenbits=9,e.distcode=xe,e.distbits=5}function Ce(e,n,r,i){var a,o=e.state;return o.window===null&&(o.wsize=1<=o.wsize?(t.arraySet(o.window,n,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(a=o.wsize-o.wnext,a>i&&(a=i),t.arraySet(o.window,n,r-i,a,o.wnext),i-=a,i?(t.arraySet(o.window,n,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,R.check=r(R.check,U,2,0),V=0,H=0,R.mode=x;break}if(R.flags=0,R.head&&(R.head.done=!1),!(R.wrap&1)||(((V&255)<<8)+(V>>8))%31){e.msg=`incorrect header check`,R.mode=de;break}if((V&15)!==y){e.msg=`unknown compression method`,R.mode=de;break}if(V>>>=4,H-=4,Pe=(V&15)+8,R.wbits===0)R.wbits=Pe;else if(Pe>R.wbits){e.msg=`invalid window size`,R.mode=de;break}R.dmax=1<>8&1),R.flags&512&&(U[0]=V&255,U[1]=V>>>8&255,R.check=r(R.check,U,2,0)),V=0,H=0,R.mode=S;case S:for(;H<32;){if(B===0)break inf_leave;B--,V+=z[_e++]<>>8&255,U[2]=V>>>16&255,U[3]=V>>>24&255,R.check=r(R.check,U,4,0)),V=0,H=0,R.mode=C;case C:for(;H<16;){if(B===0)break inf_leave;B--,V+=z[_e++]<>8),R.flags&512&&(U[0]=V&255,U[1]=V>>>8&255,R.check=r(R.check,U,2,0)),V=0,H=0,R.mode=w;case w:if(R.flags&1024){for(;H<16;){if(B===0)break inf_leave;B--,V+=z[_e++]<>>8&255,R.check=r(R.check,U,2,0)),V=0,H=0}else R.head&&(R.head.extra=null);R.mode=T;case T:if(R.flags&1024&&(we=R.length,we>B&&(we=B),we&&(R.head&&(Pe=R.head.extra_len-R.length,R.head.extra||(R.head.extra=Array(R.head.extra_len)),t.arraySet(R.head.extra,z,_e,we,Pe)),R.flags&512&&(R.check=r(R.check,z,we,_e)),B-=we,_e+=we,R.length-=we),R.length))break inf_leave;R.length=0,R.mode=E;case E:if(R.flags&2048){if(B===0)break inf_leave;we=0;do Pe=z[_e+we++],R.head&&Pe&&R.length<65536&&(R.head.name+=String.fromCharCode(Pe));while(Pe&&we>9&1,R.head.done=!0),e.adler=R.check=0,R.mode=j;break;case k:for(;H<32;){if(B===0)break inf_leave;B--,V+=z[_e++]<>>=H&7,H-=H&7,R.mode=ce;break}for(;H<3;){if(B===0)break inf_leave;B--,V+=z[_e++]<>>=1,--H,V&3){case 0:R.mode=N;break;case 1:if(Se(R),R.mode=ne,me===d){V>>>=2,H-=2;break inf_leave}break;case 2:R.mode=F;break;case 3:e.msg=`invalid block type`,R.mode=de}V>>>=2,H-=2;break;case N:for(V>>>=H&7,H-=H&7;H<32;){if(B===0)break inf_leave;B--,V+=z[_e++]<>>16^65535)){e.msg=`invalid stored block lengths`,R.mode=de;break}if(R.length=V&65535,V=0,H=0,R.mode=P,me===d)break inf_leave;case P:R.mode=ee;case ee:if(we=R.length,we){if(we>B&&(we=B),we>ye&&(we=ye),we===0)break inf_leave;t.arraySet(ge,z,_e,we,ve),B-=we,_e+=we,ye-=we,ve+=we,R.length-=we;break}R.mode=j;break;case F:for(;H<14;){if(B===0)break inf_leave;B--,V+=z[_e++]<>>=5,H-=5,R.ndist=(V&31)+1,V>>>=5,H-=5,R.ncode=(V&15)+4,V>>>=4,H-=4,R.nlen>286||R.ndist>30){e.msg=`too many length or distance symbols`,R.mode=de;break}R.have=0,R.mode=I;case I:for(;R.have>>=3,H-=3}for(;R.have<19;)R.lens[Re[R.have++]]=0;if(R.lencode=R.lendyn,R.lenbits=7,Ie={bits:R.lenbits},Fe=a(o,R.lens,0,19,R.lencode,0,R.work,Ie),R.lenbits=Ie.bits,Fe){e.msg=`invalid code lengths set`,R.mode=de;break}R.have=0,R.mode=te;case te:for(;R.have>>24,ke=De>>>16&255,Ae=De&65535,!(Oe<=H);){if(B===0)break inf_leave;B--,V+=z[_e++]<>>=Oe,H-=Oe,R.lens[R.have++]=Ae;else{if(Ae===16){for(Le=Oe+2;H>>=Oe,H-=Oe,R.have===0){e.msg=`invalid bit length repeat`,R.mode=de;break}Pe=R.lens[R.have-1],we=3+(V&3),V>>>=2,H-=2}else if(Ae===17){for(Le=Oe+3;H>>=Oe,H-=Oe,Pe=0,we=3+(V&7),V>>>=3,H-=3}else{for(Le=Oe+7;H>>=Oe,H-=Oe,Pe=0,we=11+(V&127),V>>>=7,H-=7}if(R.have+we>R.nlen+R.ndist){e.msg=`invalid bit length repeat`,R.mode=de;break}for(;we--;)R.lens[R.have++]=Pe}}if(R.mode===de)break;if(R.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,R.mode=de;break}if(R.lenbits=9,Ie={bits:R.lenbits},Fe=a(s,R.lens,0,R.nlen,R.lencode,0,R.work,Ie),R.lenbits=Ie.bits,Fe){e.msg=`invalid literal/lengths set`,R.mode=de;break}if(R.distbits=6,R.distcode=R.distdyn,Ie={bits:R.distbits},Fe=a(c,R.lens,R.nlen,R.ndist,R.distcode,0,R.work,Ie),R.distbits=Ie.bits,Fe){e.msg=`invalid distances set`,R.mode=de;break}if(R.mode=ne,me===d)break inf_leave;case ne:R.mode=re;case re:if(B>=6&&ye>=258){e.next_out=ve,e.avail_out=ye,e.next_in=_e,e.avail_in=B,R.hold=V,R.bits=H,i(e,xe),ve=e.next_out,ge=e.output,ye=e.avail_out,_e=e.next_in,z=e.input,B=e.avail_in,V=R.hold,H=R.bits,R.mode===j&&(R.back=-1);break}for(R.back=0;De=R.lencode[V&(1<>>24,ke=De>>>16&255,Ae=De&65535,!(Oe<=H);){if(B===0)break inf_leave;B--,V+=z[_e++]<>je)],Oe=De>>>24,ke=De>>>16&255,Ae=De&65535,!(je+Oe<=H);){if(B===0)break inf_leave;B--,V+=z[_e++]<>>=je,H-=je,R.back+=je}if(V>>>=Oe,H-=Oe,R.back+=Oe,R.length=Ae,ke===0){R.mode=se;break}if(ke&32){R.back=-1,R.mode=j;break}if(ke&64){e.msg=`invalid literal/length code`,R.mode=de;break}R.extra=ke&15,R.mode=ie;case ie:if(R.extra){for(Le=R.extra;H>>=R.extra,H-=R.extra,R.back+=R.extra}R.was=R.length,R.mode=ae;case ae:for(;De=R.distcode[V&(1<>>24,ke=De>>>16&255,Ae=De&65535,!(Oe<=H);){if(B===0)break inf_leave;B--,V+=z[_e++]<>je)],Oe=De>>>24,ke=De>>>16&255,Ae=De&65535,!(je+Oe<=H);){if(B===0)break inf_leave;B--,V+=z[_e++]<>>=je,H-=je,R.back+=je}if(V>>>=Oe,H-=Oe,R.back+=Oe,ke&64){e.msg=`invalid distance code`,R.mode=de;break}R.offset=Ae,R.extra=ke&15,R.mode=L;case L:if(R.extra){for(Le=R.extra;H>>=R.extra,H-=R.extra,R.back+=R.extra}if(R.offset>R.dmax){e.msg=`invalid distance too far back`,R.mode=de;break}R.mode=oe;case oe:if(ye===0)break inf_leave;if(we=xe-ye,R.offset>we){if(we=R.offset-we,we>R.whave&&R.sane){e.msg=`invalid distance too far back`,R.mode=de;break}we>R.wnext?(we-=R.wnext,Te=R.wsize-we):Te=R.wnext-we,we>R.length&&(we=R.length),Ee=R.window}else Ee=ge,Te=ve-R.offset,we=R.length;we>ye&&(we=ye),ye-=we,R.length-=we;do ge[ve++]=Ee[Te++];while(--we);R.length===0&&(R.mode=re);break;case se:if(ye===0)break inf_leave;ge[ve++]=R.length,ye--,R.mode=re;break;case ce:if(R.wrap){for(;H<32;){if(B===0)break inf_leave;B--,V|=z[_e++]<{t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}})),m4=r(((e,t)=>{function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}t.exports=n})),h4=r((e=>{var t=f4(),n=t4(),r=s4(),i=p4(),a=a4(),o=c4(),s=m4(),c=Object.prototype.toString;function l(e){if(!(this instanceof l))return new l(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:``},e||{});var u=this.options;u.raw&&u.windowBits>=0&&u.windowBits<16&&(u.windowBits=-u.windowBits,u.windowBits===0&&(u.windowBits=-15)),u.windowBits>=0&&u.windowBits<16&&!(e&&e.windowBits)&&(u.windowBits+=32),u.windowBits>15&&u.windowBits<48&&(u.windowBits&15||(u.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var d=t.inflateInit2(this.strm,u.windowBits);if(d!==i.Z_OK||(this.header=new s,t.inflateGetHeader(this.strm,this.header),u.dictionary&&(typeof u.dictionary==`string`?u.dictionary=r.string2buf(u.dictionary):c.call(u.dictionary)===`[object ArrayBuffer]`&&(u.dictionary=new Uint8Array(u.dictionary)),u.raw&&(d=t.inflateSetDictionary(this.strm,u.dictionary),d!==i.Z_OK))))throw Error(a[d])}l.prototype.push=function(e,a){var o=this.strm,s=this.options.chunkSize,l=this.options.dictionary,u,d,f,p,m,h=!1;if(this.ended)return!1;d=a===~~a?a:a===!0?i.Z_FINISH:i.Z_NO_FLUSH,typeof e==`string`?o.input=r.binstring2buf(e):c.call(e)===`[object ArrayBuffer]`?o.input=new Uint8Array(e):o.input=e,o.next_in=0,o.avail_in=o.input.length;do{if(o.avail_out===0&&(o.output=new n.Buf8(s),o.next_out=0,o.avail_out=s),u=t.inflate(o,i.Z_NO_FLUSH),u===i.Z_NEED_DICT&&l&&(u=t.inflateSetDictionary(this.strm,l)),u===i.Z_BUF_ERROR&&h===!0&&(u=i.Z_OK,h=!1),u!==i.Z_STREAM_END&&u!==i.Z_OK)return this.onEnd(u),this.ended=!0,!1;o.next_out&&(o.avail_out===0||u===i.Z_STREAM_END||o.avail_in===0&&(d===i.Z_FINISH||d===i.Z_SYNC_FLUSH))&&(this.options.to===`string`?(f=r.utf8border(o.output,o.next_out),p=o.next_out-f,m=r.buf2string(o.output,f),o.next_out=p,o.avail_out=s-p,p&&n.arraySet(o.output,o.output,f,p,0),this.onData(m)):this.onData(n.shrinkBuf(o.output,o.next_out))),o.avail_in===0&&o.avail_out===0&&(h=!0)}while((o.avail_in>0||o.avail_out===0)&&u!==i.Z_STREAM_END);return u===i.Z_STREAM_END&&(d=i.Z_FINISH),d===i.Z_FINISH?(u=t.inflateEnd(this.strm),this.onEnd(u),this.ended=!0,u===i.Z_OK):d===i.Z_SYNC_FLUSH?(this.onEnd(i.Z_OK),o.avail_out=0,!0):!0},l.prototype.onData=function(e){this.chunks.push(e)},l.prototype.onEnd=function(e){e===i.Z_OK&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function u(e,t){var n=new l(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}function d(e,t){return t||={},t.raw=!0,u(e,t)}e.Inflate=l,e.inflate=u,e.inflateRaw=d,e.ungzip=u})),g4=t(r(((e,t)=>{var n=t4().assign,r=l4(),i=h4(),a=p4(),o={};n(o,r,i,a),t.exports=o}))(),1),_4=t(te(),1),v4=class extends e4{name=`deflate`;extensions=[];contentEncodings=[`deflate`];isSupported=!0;options;_chunks=[];constructor(e={}){super(e),this.options=e}async compress(e){return!St&&this.options.deflate?.useZlib?Qn(this.options.deflate?.gzip?await nr(_4.default.gzip)(e):await nr(_4.default.deflate)(e)):this.compressSync(e)}async decompress(e){return!St&&this.options.deflate?.useZlib?Qn(this.options.deflate?.gzip?await nr(_4.default.gunzip)(e):await nr(_4.default.inflate)(e)):this.decompressSync(e)}compressSync(e){if(!St&&this.options.deflate?.useZlib)return Qn(this.options.deflate?.gzip?_4.default.gzipSync(e):_4.default.deflateSync(e));let t=this.options?.deflate||{},n=new Uint8Array(e);return Qn((this.options?.raw?g4.default.deflateRaw:g4.default.deflate)(n,t).buffer)}decompressSync(e){if(!St&&this.options.deflate?.useZlib)return Qn(this.options.deflate?.gzip?_4.default.gunzipSync(e):_4.default.inflateSync(e));let t=this.options?.deflate||{},n=new Uint8Array(e);return Qn((this.options?.raw?g4.default.inflateRaw:g4.default.inflate)(n,t).buffer)}async*compressBatches(e){let t=this.options?.deflate||{},n=new g4.default.Deflate(t);yield*this.transformBatches(n,e)}async*decompressBatches(e){let t=this.options?.deflate||{},n=new g4.default.Inflate(t);yield*this.transformBatches(n,e)}async*transformBatches(e,t){e.onData=this._onData.bind(this),e.onEnd=this._onEnd.bind(this);for await(let n of t){let t=new Uint8Array(n);if(!e.push(t,!1))throw Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array;e.push(n,!0),yield*this._getChunks()}_onData(e){this._chunks.push(e)}_onEnd(e){if(e!==0)throw Error(this._getError(e)+this._chunks.length)}_getChunks(){let e=this._chunks;return this._chunks=[],e}_getError(e=0){return`${this.name}: ${{2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`}[e]}`}},y4=class extends v4{name=`gzip`;extensions=[`gz`,`gzip`];contentEncodings=[`gzip`,`x-gzip`];isSupported=!0;constructor(e){super({...e,deflate:{...e?.gzip,gzip:!0}})}},b4=[0],x4={getPointColor:{type:`accessor`,value:[0,0,0,255]},pointSize:1,data:``,loader:Y2,onTilesetLoad:{type:`function`,value:e=>{}},onTileLoad:{type:`function`,value:e=>{}},onTileUnload:{type:`function`,value:e=>{}},onTileError:{type:`function`,value:(e,t,n)=>{}},_getMeshColor:{type:`function`,value:e=>[255,255,255]}},S4=class extends fx{initializeState(){`onTileLoadFail`in this.props&&fo.removed(`onTileLoadFail`,`onTileError`)(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}get isLoaded(){return!!(this.state?.tileset3d?.isLoaded()&&super.isLoaded)}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({props:e,oldProps:t,changeFlags:n}){if(e.data&&e.data!==t.data&&this._loadTileset(e.data),n.viewportChanged){let{activeViewports:e}=this.state;Object.keys(e).length&&(this._updateTileset(e),this.state.lastUpdatedViewports=e,this.state.activeViewports={})}if(n.propsChanged){let{layerMap:e}=this.state;for(let t in e)e[t].needsUpdate=!0}}finalizeState(e){this.state.tileset3d?.destroy(),this.state.tileset3d=null,this.state.layerMap={},this.state.activeViewports={},this.state.lastUpdatedViewports=null,super.finalizeState(e)}activateViewport(e){let{activeViewports:t,lastUpdatedViewports:n}=this.state;this.internalState.viewport=e,t[e.id]=e;let r=n?.[e.id];(!r||!e.equals(r))&&(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}getPickingInfo({info:e,sourceLayer:t}){let n=t&&t.props.tile;return e.picked&&(e.object=n),e.sourceTile=n,e}filterSubLayer({layer:e,viewport:t,cullRect:n,isPicking:r}){let{tile:i}=e.props,{id:a}=t;if(!i.selected||!i.viewportIds.includes(a))return!1;if(r&&n&&i.content?.cartographicOrigin){let[e,r]=t.project(i.content.cartographicOrigin),a=n.x+n.width/2,o=n.y+n.height/2,s=Math.max(t.width,t.height)/4,c=e-a,l=r-o;if(c*c+l*l>s*s)return!1}return!0}_updateAutoHighlight(e){let t=e.sourceTile,n=this.state.layerMap[t?.id];n&&n.layer&&n.layer.updateAutoHighlight(e)}async _loadTileset(e){let t=this.props.loadOptions||{},n=this.props.loaders?.length?this.props.loaders:this.props.loader,r=Array.isArray(n)?n[0]:n,{tileset:i,...a}=t,o={loadOptions:{...a},...i},s=e;if(`preload`in r&&typeof r.preload==`function`){let n=await r.preload(e,t);n.url&&(s=n.url),n.headers&&(o.loadOptions.core={...o.loadOptions.core,fetch:{...o.loadOptions.core?.fetch,headers:n.headers}}),Object.assign(o,n)}let c=new m1(await ga(s,r,o.loadOptions),{onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError,onUpdate:()=>this.setNeedsUpdate(),...o});this.setState({tileset3d:c,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(c)}_onTileLoad(e){let{lastUpdatedViewports:t}=this.state;e.tileDrawn=!1,this.props.onTileLoad(e),this._updateTileset(t),this.setNeedsUpdate()}_onTileUnload(e){delete this.state.layerMap[e.id],this.props.onTileUnload(e)}_updateTileset(e){if(!e)return;let{tileset3d:t}=this.state,{timeline:n}=this.context,r=Object.keys(e).length;!n||!r||!t||t.selectTiles(Object.values(e)).then(e=>{this.state.frameNumber!==e&&this.setState({frameNumber:e})})}_getSubLayer(e,t){if(!e.content)return null;switch(e.type){case u$.POINTCLOUD:return this._makePointCloudLayer(e,t);case u$.SCENEGRAPH:return this._make3DModelLayer(e);case u$.MESH:return this._makeSimpleMeshLayer(e,t);default:throw Error(`Tile3DLayer: Failed to render layer of type ${e.content.type}`)}}_makePointCloudLayer(e,t){let{attributes:n,pointCount:r,constantRGBA:i,cartographicOrigin:a,modelMatrix:o}=e.content,{positions:s,normals:c,colors:l}=n;if(!s)return null;let u=t&&t.props.data||{header:{vertexCount:r},attributes:{POSITION:s,NORMAL:c,COLOR_0:l}},{pointSize:d,getPointColor:f}=this.props;return new(this.getSubLayerClass(`pointcloud`,VN))({pointSize:d},this.getSubLayerProps({id:`pointcloud`}),{id:`${this.id}-pointcloud-${e.id}`,tile:e,data:u,coordinateSystem:gp.METER_OFFSETS,coordinateOrigin:a,modelMatrix:o,getColor:i||f,_offset:0})}_make3DModelLayer(e){let{gltf:t,instances:n,cartographicOrigin:r,modelMatrix:i}=e.content;return new(this.getSubLayerClass(`scenegraph`,rQ))({_lighting:`pbr`},this.getSubLayerProps({id:`scenegraph`}),{id:`${this.id}-scenegraph-${e.id}`,tile:e,data:n||b4,scenegraph:t,coordinateSystem:gp.METER_OFFSETS,coordinateOrigin:r,modelMatrix:i,getTransformMatrix:e=>e.modelMatrix,getPosition:[0,0,0],_offset:0,onFirstDraw:()=>{e.tileDrawn=!0}})}_makeSimpleMeshLayer(e,t){let{attributes:n,indices:r,modelMatrix:i,cartographicOrigin:a,coordinateSystem:o=gp.METER_OFFSETS,material:s,featureIds:c}=e.content,{_getMeshColor:l}=this.props,u=t&&t.props.mesh||new Jg({topology:`triangle-list`,attributes:C4(n),indices:r});return new(this.getSubLayerClass(`mesh`,dQ))(this.getSubLayerProps({id:`mesh`}),{id:`${this.id}-mesh-${e.id}`,tile:e,mesh:u,data:b4,getColor:l(e),pbrMaterial:s,modelMatrix:i,coordinateOrigin:a,coordinateSystem:o,featureIds:c,_offset:0})}renderLayers(){let{tileset3d:e,layerMap:t}=this.state;return e?e.tiles.map(e=>{let n=t[e.id]=t[e.id]||{tile:e},{layer:r}=n;return e.selected&&(r?n.needsUpdate&&=(r=this._getSubLayer(e,r),!1):r=this._getSubLayer(e)),n.layer=r,r}).filter(Boolean):null}};S4.defaultProps=x4,S4.layerName=`Tile3DLayer`;function C4(e){let t={};return t.positions={...e.positions,value:new Float32Array(e.positions.value)},e.normals&&(t.normals=e.normals),e.texCoords&&(t.texCoords=e.texCoords),e.colors&&(t.colors=e.colors),e.uvRegions&&(t.uvRegions=e.uvRegions),t}var w4={dataType:null,batchType:null,name:`Terrain`,id:`terrain`,module:`terrain`,version:`4.4.3`,worker:!0,extensions:[`png`,`pngraw`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`],mimeTypes:[`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/bmp`],options:{terrain:{tesselator:`auto`,bounds:void 0,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:void 0}}},T4=[1],E4={...CY.defaultProps,elevationData:GJ,texture:{...GJ,optional:!0},meshMaxError:{type:`number`,value:4},bounds:{type:`array`,value:null,optional:!0,compare:!0},color:{type:`color`,value:[255,255,255]},elevationDecoder:{type:`object`,value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:``,wireframe:!1,material:!0,loaders:[w4]};function D4(e){return Array.isArray(e)?e.join(`;`):e||``}var O4=class extends fx{updateState({props:e,oldProps:t}){let n=e.elevationData!==t.elevationData;if(n){let{elevationData:t}=e,n=t&&(Array.isArray(t)||k4(t));this.setState({isTiled:n})}let r=n||e.meshMaxError!==t.meshMaxError||e.elevationDecoder!==t.elevationDecoder||e.bounds!==t.bounds;if(!this.state.isTiled&&r){let t=this.loadTerrain(e);this.setState({terrain:t})}e.workerUrl&&fo.removed(`workerUrl`,`loadOptions.terrain.workerUrl`)()}loadTerrain({elevationData:e,bounds:t,elevationDecoder:n,meshMaxError:r,signal:i}){if(!e)return null;let a=this.getLoadOptions();a={...a,terrain:{skirtHeight:this.state.isTiled?r*2:0,...a?.terrain,bounds:t,meshMaxError:r,elevationDecoder:n}};let{fetch:o}=this.props;return o(e,{propName:`elevationData`,layer:this,loadOptions:a,signal:i})}getTiledTerrainData(e){let{elevationData:t,fetch:n,texture:r,elevationDecoder:i,meshMaxError:a}=this.props,{viewport:o}=this.context,s=JJ(t,e),c=r&&JJ(r,e),{signal:l}=e,u=[0,0],d=[0,0];if(o.isGeospatial){let t=e.bbox;u=o.projectFlat([t.west,t.south]),d=o.projectFlat([t.east,t.north])}else{let t=e.bbox;u=[t.left,t.bottom],d=[t.right,t.top]}let f=[u[0],u[1],d[0],d[1]],p=this.loadTerrain({elevationData:s,bounds:f,elevationDecoder:i,meshMaxError:a,signal:l}),m=c?n(c,{propName:`texture`,layer:this,loaders:[],signal:l}).catch(e=>null):Promise.resolve(null);return Promise.all([p,m])}renderSubLayers(e){let t=this.getSubLayerClass(`mesh`,YY),{color:n,wireframe:r,material:i}=this.props,{data:a}=e;if(!a)return null;let[o,s]=a;return new t(e,{data:T4,mesh:o,texture:s,_instanced:!1,coordinateSystem:gp.CARTESIAN,getPosition:e=>[0,0,0],getColor:n,wireframe:r,material:i})}onViewportLoad(e){if(!e)return;let{zRange:t}=this.state,n=e.map(e=>e.content).filter(Boolean).map(e=>e[0].header.boundingBox.map(e=>e[2]));if(n.length===0)return;let r=Math.min(...n.map(e=>e[0])),i=Math.max(...n.map(e=>e[1]));(!t||rt[1])&&this.setState({zRange:[r,i]})}renderLayers(){let{color:e,material:t,elevationData:n,texture:r,wireframe:i,meshMaxError:a,elevationDecoder:o,tileSize:s,maxZoom:c,minZoom:l,extent:u,maxRequests:d,onTileLoad:f,onTileUnload:p,onTileError:m,maxCacheSize:h,maxCacheByteSize:g,refinementStrategy:_,zoomOffset:v}=this.props;return this.state.isTiled?new CY(this.getSubLayerProps({id:`tiles`}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:D4(n),texture:D4(r),meshMaxError:a,elevationDecoder:o,projectionMode:this.context.viewport.projectionMode,zoomOffset:v}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:s,maxZoom:c,minZoom:l,extent:u,maxRequests:d,onTileLoad:f,onTileUnload:p,onTileError:m,maxCacheSize:h,maxCacheByteSize:g,refinementStrategy:_,zoomOffset:v}):n?new(this.getSubLayerClass(`mesh`,YY))(this.getSubLayerProps({id:`mesh`}),{data:T4,mesh:this.state.terrain,texture:r,_instanced:!1,getPosition:e=>[0,0,0],getColor:e,material:t,wireframe:i}):null}};O4.defaultProps=E4,O4.layerName=`TerrainLayer`;var k4=e=>e.includes(`{x}`)&&(e.includes(`{y}`)||e.includes(`{-y}`)),A4={clipBounds:[0,0,1,1],clipByInstance:void 0},j4=` +layout(std140) uniform clipUniforms { + vec4 bounds; +} clip; + +bool clip_isInBounds(vec2 position) { + return position.x >= clip.bounds[0] && position.y >= clip.bounds[1] && position.x < clip.bounds[2] && position.y < clip.bounds[3]; +} +`,M4={name:`clip`,vs:j4,uniformTypes:{bounds:`vec4`}},N4={"vs:#decl":` +out float clip_isVisible; +`,"vs:DECKGL_FILTER_GL_POSITION":` + clip_isVisible = float(clip_isInBounds(geometry.worldPosition.xy)); +`,"fs:#decl":` +in float clip_isVisible; +`,"fs:DECKGL_FILTER_COLOR":` + if (clip_isVisible < 0.5) discard; +`},P4={name:`clip`,fs:j4,uniformTypes:{bounds:`vec4`}},F4={"vs:#decl":` +out vec2 clip_commonPosition; +`,"vs:DECKGL_FILTER_GL_POSITION":` + clip_commonPosition = geometry.position.xy; +`,"fs:#decl":` +in vec2 clip_commonPosition; +`,"fs:DECKGL_FILTER_COLOR":` + if (!clip_isInBounds(clip_commonPosition)) discard; +`},I4=class extends px{getShaders(){let e=`instancePositions`in this.getAttributeManager().attributes;return this.props.clipByInstance!==void 0&&(e=!!this.props.clipByInstance),this.state.clipByInstance=e,e?{modules:[M4],inject:N4}:{modules:[P4],inject:F4}}draw(){let{clipBounds:e}=this.props,t={};if(this.state.clipByInstance)t.bounds=e;else{let n=this.projectPosition([e[0],e[1],0]),r=this.projectPosition([e[2],e[3],0]);t.bounds=[Math.min(n[0],r[0]),Math.min(n[1],r[1]),Math.max(n[0],r[0]),Math.max(n[1],r[1])]}this.setShaderModuleProps({clip:t})}};I4.defaultProps=A4,I4.extensionName=`ClipExtension`;var L4={name:`collision`,dependencies:[zp],vs:` +in float collisionPriorities; + +uniform sampler2D collision_texture; + +layout(std140) uniform collisionUniforms { + bool sort; + bool enabled; +} collision; + +vec2 collision_getCoords(vec4 position) { + vec4 collision_clipspace = project_common_position_to_clipspace(position); + return (1.0 + collision_clipspace.xy / collision_clipspace.w) / 2.0; +} + +float collision_match(vec2 tex, vec3 pickingColor) { + vec4 collision_pickingColor = texture(collision_texture, tex); + float delta = dot(abs(collision_pickingColor.rgb - pickingColor), vec3(1.0)); + float e = 0.001; + return step(delta, e); +} + +float collision_isVisible(vec2 texCoords, vec3 pickingColor) { + if (!collision.enabled) { + return 1.0; + } + + // Visibility test, sample area of 5x5 pixels in order to fade in/out. + // Due to the locality, the lookups will be cached + // This reduces the flicker present when objects are shown/hidden + const int N = 2; + float accumulator = 0.0; + vec2 step = vec2(1.0 / project.viewportSize); + + const float floatN = float(N); + vec2 delta = -floatN * step; + for(int i = -N; i <= N; i++) { + delta.x = -step.x * floatN; + for(int j = -N; j <= N; j++) { + accumulator += collision_match(texCoords + delta, pickingColor); + delta.x += step.x; + } + delta.y += step.y; + } + + float W = 2.0 * floatN + 1.0; + return pow(accumulator / (W * W), 2.2); +} +`,inject:{"vs:#decl":` + float collision_fade = 1.0; +`,"vs:DECKGL_FILTER_GL_POSITION":` + if (collision.sort) { + float collisionPriority = collisionPriorities; + position.z = -0.001 * collisionPriority * position.w; // Support range -1000 -> 1000 + } + + if (collision.enabled) { + vec4 collision_common_position = project_position(vec4(geometry.worldPosition, 1.0)); + vec2 collision_texCoords = collision_getCoords(collision_common_position); + collision_fade = collision_isVisible(collision_texCoords, geometry.pickingColor / 255.0); + if (collision_fade < 0.0001) { + // Position outside clip space bounds to discard + position = vec4(0.0, 0.0, 2.0, 1.0); + } + } + `,"vs:DECKGL_FILTER_COLOR":` + color.a *= collision_fade; + `},getUniforms:e=>{if(!e||!(`dummyCollisionMap`in e))return{};let{enabled:t,collisionFBO:n,drawToCollisionMap:r,dummyCollisionMap:i}=e;return{enabled:t&&!r,sort:!!r,collision_texture:!r&&n?n.colorAttachments[0]:i}},uniformTypes:{sort:`i32`,enabled:`i32`}},R4=class extends qm{renderCollisionMap(e,t){let n=[0,0,0,0],r=[1,1,e.width-2,e.height-2];this.render({...t,clearColor:n,scissorRect:r,target:e,pass:`collision`})}getLayerParameters(e,t,n){return{...e.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:`less-equal`}}getShaderModuleProps(){return{collision:{drawToCollisionMap:!0},picking:{isActive:1,isAttribute:!1},lighting:{enabled:!1}}}},z4=2,B4=class{constructor(){this.id=`collision-filter-effect`,this.props=null,this.useInPicking=!0,this.order=1,this.channels={},this.collisionFBOs={}}setup(e){this.context=e;let{device:t}=e;this.dummyCollisionMap=t.createTexture({width:1,height:1}),this.collisionFilterPass=new R4(t,{id:`default-collision-filter`})}preRender({effects:e,layers:t,layerFilter:n,viewports:r,onViewportActive:i,views:a,isPicking:o,preRenderStats:s={}}){let{device:c}=this.context;if(o)return;let l=t.filter(({props:{visible:e,collisionEnabled:t}})=>e&&t);if(l.length===0){this.channels={};return}let u=e?.filter(e=>e.useInPicking&&s[e.id]),d=s[`mask-effect`]?.didRender,f=this._groupByCollisionGroup(c,l),p=r[0],m=!this.lastViewport||!this.lastViewport.equals(p)||d;for(let e in f){let t=this.collisionFBOs[e],r=f[e],[o,s]=c.canvasContext.getPixelSize();t.resize({width:o/z4,height:s/z4}),this._render(r,{effects:u,layerFilter:n,onViewportActive:i,views:a,viewport:p,viewportChanged:m})}}_render(e,{effects:t,layerFilter:n,onViewportActive:r,views:i,viewport:a,viewportChanged:o}){let{collisionGroup:s}=e,c=this.channels[s];if(!c)return;let l=o||e===c||!B_(c.layers,e.layers,1)||e.layerBounds.some((e,t)=>!jc(e,c.layerBounds[t]))||e.allLayersLoaded!==c.allLayersLoaded||e.layers.some(e=>e.props.transitions);if(this.channels[s]=e,l){this.lastViewport=a;let o=this.collisionFBOs[s];this.collisionFilterPass.renderCollisionMap(o,{pass:`collision-filter`,isPicking:!0,layers:e.layers,effects:t,layerFilter:n,viewports:a?[a]:[],onViewportActive:r,views:i,shaderModuleProps:{collision:{enabled:!0,dummyCollisionMap:this.dummyCollisionMap},project:{devicePixelRatio:o.device.canvasContext.getDevicePixelRatio()/z4}}})}}_groupByCollisionGroup(e,t){let n={};for(let e of t){let t=e.props.collisionGroup,r=n[t];r||(r={collisionGroup:t,layers:[],layerBounds:[],allLayersLoaded:!0},n[t]=r),r.layers.push(e),r.layerBounds.push(e.getBounds()),e.isLoaded||(r.allLayersLoaded=!1)}for(let t of Object.keys(n))this.collisionFBOs[t]||this.createFBO(e,t),this.channels[t]||(this.channels[t]=n[t]);for(let e of Object.keys(this.collisionFBOs))n[e]||this.destroyFBO(e);return n}getShaderModuleProps(e){let{collisionGroup:t,collisionEnabled:n}=e.props,{collisionFBOs:r,dummyCollisionMap:i}=this,a=r[t];return{collision:{enabled:n&&!!a,collisionFBO:a,dummyCollisionMap:i}}}cleanup(){this.dummyCollisionMap&&=(this.dummyCollisionMap.delete(),void 0),this.channels={};for(let e of Object.keys(this.collisionFBOs))this.destroyFBO(e);this.collisionFBOs={},this.lastViewport=void 0}createFBO(e,t){let{width:n,height:r}=e.getDefaultCanvasContext().canvas,i=e.createTexture({format:`rgba8unorm`,width:n,height:r,sampler:{minFilter:`nearest`,magFilter:`nearest`,addressModeU:`clamp-to-edge`,addressModeV:`clamp-to-edge`}}),a=e.createTexture({format:`depth16unorm`,width:n,height:r});this.collisionFBOs[t]=e.createFramebuffer({id:`collision-${t}`,width:n,height:r,colorAttachments:[i],depthStencilAttachment:a})}destroyFBO(e){let t=this.collisionFBOs[e];t.colorAttachments[0]?.destroy(),t.depthStencilAttachment?.destroy(),t.destroy(),delete this.collisionFBOs[e]}},V4={getCollisionPriority:{type:`accessor`,value:0},collisionEnabled:!0,collisionGroup:{type:`string`,value:`default`},collisionTestProps:{}},H4=class extends px{getShaders(){return{modules:[L4]}}draw({shaderModuleProps:e}){e.collision?.drawToCollisionMap&&(this.props=this.clone(this.props.collisionTestProps).props)}initializeState(e,t){this.getAttributeManager()!==null&&(this.context.deck?._addDefaultEffect(new B4),this.getAttributeManager().add({collisionPriorities:{size:1,stepMode:`dynamic`,accessor:`getCollisionPriority`}}))}getNeedsPickingBuffer(){return this.props.collisionEnabled}};H4.defaultProps=V4,H4.extensionName=`CollisionFilterExtension`;function U4(e,t,n){switch(e.type){case`Point`:return K4(e,t,n);case`LineString`:return G4(e,t,n);case`Polygon`:return W4(e,t,n);default:throw Error(`Unsupported geometry type: ${e?.type}`)}}function W4(e,t=-1/0,n=1/0){let{positions:r}=e,i=e.polygonIndices.value.filter(e=>e>=t&&e<=n),a=e.primitivePolygonIndices.value.filter(e=>e>=t&&e<=n);if(!(i.length>2)){let e=[];for(let t=0;te>=t&&e<=n);if(!(i.length>2))return{type:`LineString`,coordinates:q4(r,i[0],i[1])};let a=[];for(let e=0;e1?{type:`MultiPoint`,coordinates:i}:{type:`Point`,coordinates:i[0]}}function q4(e,t,n){t||=0,n||=e.value.length/e.size;let r=[];for(let i=t;i{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}})),r3=r(((e,t)=>{t.exports=r;var n=n3();function r(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}r.Varint=0,r.Fixed64=1,r.Bytes=2,r.Fixed32=5;var i=65536*65536,a=1/i,o=12,s=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`);r.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n||=this.length;this.pos>3,a=this.pos;this.type=r&7,e(i,t,this),this.pos===a&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=w(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=E(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=w(this.buf,this.pos)+w(this.buf,this.pos+4)*i;return this.pos+=8,e},readSFixed64:function(){var e=w(this.buf,this.pos)+E(this.buf,this.pos+4)*i;return this.pos+=8,e},readFloat:function(){var e=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,n,r=t[this.pos++];return n=r&127,r<128||(r=t[this.pos++],n|=(r&127)<<7,r<128)||(r=t[this.pos++],n|=(r&127)<<14,r<128)||(r=t[this.pos++],n|=(r&127)<<21,r<128)?n:(r=t[this.pos],n|=(r&15)<<28,c(n,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=o&&s?O(this.buf,t,e):D(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==r.Bytes)return e.push(this.readVarint(t));var n=l(this);for(e||=[];this.pos127;);else if(t===r.Bytes)this.pos=this.readVarint()+this.pos;else if(t===r.Fixed32)this.pos+=4;else if(t===r.Fixed64)this.pos+=8;else throw Error(`Unimplemented type: `+t)},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0){d(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var t=this.pos;this.pos=k(this.buf,e,this.pos);var n=this.pos-t;n>=128&&m(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(e){this.realloc(4),n.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),n.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n=128&&m(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,n){this.writeTag(e,r.Bytes),this.writeRawMessage(t,n)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,h,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,g,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,y,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,_,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,v,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,b,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,x,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,S,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,C,t)},writeBytesField:function(e,t){this.writeTag(e,r.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,r.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,r.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,r.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,r.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,r.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,r.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,r.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,r.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,r.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};function c(e,t,n){var r=n.buf,i,a=r[n.pos++];if(i=(a&112)>>4,a<128||(a=r[n.pos++],i|=(a&127)<<3,a<128)||(a=r[n.pos++],i|=(a&127)<<10,a<128)||(a=r[n.pos++],i|=(a&127)<<17,a<128)||(a=r[n.pos++],i|=(a&127)<<24,a<128)||(a=r[n.pos++],i|=(a&1)<<31,a<128))return u(e,i,t);throw Error(`Expected varint not more than 10 bytes`)}function l(e){return e.type===r.Bytes?e.readVarint()+e.pos:e.pos+1}function u(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function d(e,t){var n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(n=~(-e%4294967296),r=~(-e/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw Error(`Given varint doesn't fit into 10 bytes`);t.realloc(10),f(n,r,t),p(r,t)}function f(e,t,n){n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos]=e&127}function p(e,t){var n=(e&7)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function m(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));n.realloc(r);for(var i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function h(e,t){for(var n=0;n>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function E(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function D(e,t,n){for(var r=``,i=t;i239?4:a>223?3:a>191?2:1;if(i+s>n)break;var c,l,u;s===1?a<128&&(o=a):s===2?(c=e[i+1],(c&192)==128&&(o=(a&31)<<6|c&63,o<=127&&(o=null))):s===3?(c=e[i+1],l=e[i+2],(c&192)==128&&(l&192)==128&&(o=(a&15)<<12|(c&63)<<6|l&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):s===4&&(c=e[i+1],l=e[i+2],u=e[i+3],(c&192)==128&&(l&192)==128&&(u&192)==128&&(o=(a&15)<<18|(c&63)<<12|(l&63)<<6|u&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,s=1):o>65535&&(o-=65536,r+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),r+=String.fromCharCode(o),i+=s}return r}function O(e,t,n){return s.decode(e.subarray(t,n))}function k(e,t,n){for(var r=0,i,a;r55295&&i<57344)if(a)if(i<56320){e[n++]=239,e[n++]=191,e[n++]=189,a=i;continue}else i=a-55296<<10|i-56320|65536,a=null;else{i>56319||r+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):a=i;continue}else a&&=(e[n++]=239,e[n++]=191,e[n++]=189,null);i<128?e[n++]=i:(i<2048?e[n++]=i>>6|192:(i<65536?e[n++]=i>>12|224:(e[n++]=i>>18|240,e[n++]=i>>12&63|128),e[n++]=i>>6&63|128),e[n++]=i&63|128)}return n}}));function i3(e){let t=0;for(let n=0,r=e.length-1,i,a;ns3(e,t,this.extent));default:return f3(this,n,a3)}}toBinaryFeature(e,t){let n=this.loadFlatGeometry();switch(e){case`wgs84`:return this._toBinaryCoordinates(n,e=>c3(e,t,this.extent));default:return this._toBinaryCoordinates(n,o3)}}bbox(){let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,n=1,r=0,i=0,a=0,o=1/0,s=-1/0,c=1/0,l=-1/0;for(;e.pos>3}if(r--,n===1||n===2)i+=e.readSVarint(),a+=e.readSVarint(),is&&(s=i),al&&(l=a);else if(n!==7)throw Error(`unknown command ${n}`)}return[o,c,s,l]}_toBinaryCoordinates(e,t){let n;switch(t(e.data,this.extent),this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=e.indices.length,n={type:`Point`,...e};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=e.indices.length,this._geometryInfo.linePositionsCount+=e.data.length/2,n={type:`LineString`,...e};break;case 3:n=u3(e),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=n.indices.length;for(let e of n.indices)this._geometryInfo.polygonRingsCount+=e.length;this._geometryInfo.polygonPositionsCount+=n.data.length/2;break;default:throw Error(`Invalid geometry type: ${this.type}`)}let r={type:`Feature`,geometry:n,properties:this.properties};return this.id!==null&&(r.id=this.id),r}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,n=1,r=0,i=0,a=0,o=[],s;for(;e.pos>3}switch(r--,n){case 1:case 2:i+=e.readSVarint(),a+=e.readSVarint(),n===1&&(s&&o.push(s),s=[]),s&&s.push([i,a]);break;case 7:s&&s.push(s[0].slice());break;default:throw Error(`unknown command ${n}`)}}return s&&o.push(s),o}loadFlatGeometry(){let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,n=1,r,i=0,a=0,o=0,s=0,c=[],l=[];for(;e.pos>3),i--,n===1||n===2)a+=e.readSVarint(),o+=e.readSVarint(),n===1&&c.push(s),l.push(a,o),s+=2;else if(n===7){if(s>0){let e=c[c.length-1];l.push(l[e],l[e+1]),s+=2}}else throw Error(`unknown command ${n}`);return{data:l,indices:c}}};function f3(e,t,n){let r=d3.types[e.type],i,a,o;switch(e.type){case 1:let r=[];for(i=0;ib3(e,t,n))}function S3(e,t,n){return x3(e,t,n)}function C3(e,t,n){return x3(e,t,n)}function w3(e,t,n){return e.map(e=>C3(e,t,n))}function T3(e,t,n){return e.map(e=>x3(e,t,n))}function E3(e,t,n){return e.map(e=>T3(e,t,n))}function D3(e,t,n){let r=[n.projectFlat([t.west,t.north]),n.projectFlat([t.east,t.south])];return{...e,coordinates:y3[e.type](e.coordinates,r,n)}}var O3=[`points`,`lines`,`polygons`];function k3(e,t,n,r){for(let i of O3){let a=e[i]&&A3(e[i],t,n,r);if(a>=0)return a}return-1}function A3(e,t,n,r){let i=e.featureIds.value;if(!i.length)return-1;let a=0,o=i[i.length-1]+1;if(r){let t=j3(e,r);if(t)a=t[0],o=t[1]+1;else return-1}let s=-1;if(t in e.numericProps){let r=e.numericProps[t].value.findIndex((e,t)=>e===n&&i[t]>=a&&i[t]=0?e.globalFeatureIds.value[r]:-1}else t?s=N3(e.properties,e=>e[t]===n,a,o):e.fields&&(s=N3(e.fields,e=>e.id===n,a,o));return s>=0?M3(e,s):-1}function j3(e,t){if(!e.__layers){let t={},{properties:n}=e;for(let e=0;en&&(e.minZoom=t.minzoom),Number.isFinite(t.maxzoom)&&(!Number.isFinite(r)||t.maxzoom{let t=L3(e,i)===c,r=s||R3(e)===n;return t&&r}):o&&r?k3(o,i,c,s?``:n):-1}_pickObjects(e){let{deck:t,viewport:n}=this.context,r=n.width,i=n.height,a=n.x,o=n.y,s=[this.id];return t.pickObjects({x:a,y:o,width:r,height:i,layerIds:s,maxObjects:e})}getRenderedFeatures(e=null){let t=this._pickObjects(e),n=new Set,r=[];for(let e of t){let t=L3(e.object,this.props.uniqueIdProperty);t===void 0?r.push(e.object):n.has(t)||(n.add(t),r.push(e.object))}return r}_setWGS84PropertyForTiles(){let e=`dataInWGS84`;this.state.tileset.selectedTiles.forEach(t=>{t.hasOwnProperty(e)||Object.defineProperty(t,e,{get:()=>{if(!t.content)return null;if(this.state.binary&&Array.isArray(t.content)&&!t.content.length)return[];let{bbox:e}=t;return t._contentWGS84===void 0&&oY(e)&&(t._contentWGS84=(this.state.binary?J4(t.content):t.content).map(t=>B3(t,e,this.context.viewport))),t._contentWGS84}})})}};I3.layerName=`MVTLayer`,I3.defaultProps=F3;function L3(e,t){if(e.properties&&t)return e.properties[t];if(`id`in e)return e.id}function R3(e){return e.properties?.layerName||null}function z3(e){return e!=null&&e!==``}function B3(e,t,n){let r={...e,geometry:{type:e.geometry.type}};return Object.defineProperty(r.geometry,"coordinates",{get:()=>D3(e.geometry,t,n).coordinates}),r}var V3=`0123456789bcdefghjkmnpqrstuvwxyz`,H3={};for(let e=0;e<32;e++)H3[V3.charAt(e)]=e;var U3=-90,W3=90,G3=-180,K3=180;function q3(e){let t=!0,n=W3,r=U3,i=K3,a=G3,o,s=0;for(let c=0,l=e.length;c=0;e--){let c=s>>e&1;t?(o=(i+a)/2,c===1?a=o:i=o):(o=(n+r)/2,c===1?r=o:n=o),t=!t}}return[r,a,n,i]}function J3(e){let[t,n,r,i]=q3(e);return[i,r,i,t,n,t,n,r,i,r]}var Y3={getGeohash:{type:`accessor`,value:e=>e.geohash}},X3=class extends cL{indexToBounds(){let{data:e,getGeohash:t}=this.props;return{data:e,_normalize:!1,positionFormat:`XY`,getPolygon:(e,n)=>J3(t(e,n))}}};X3.layerName=`GeohashLayer`,X3.defaultProps=Y3;var Z3=n({A5Layer:()=>UW,GeohashLayer:()=>X3,GreatCircleLayer:()=>wq,H3ClusterLayer:()=>NY,H3HexagonLayer:()=>jY,MVTLayer:()=>I3,QuadkeyLayer:()=>Kq,S2Layer:()=>Vq,TerrainLayer:()=>O4,Tile3DLayer:()=>S4,TileLayer:()=>CY,TripsLayer:()=>DY,_GeoCellLayer:()=>cL,_Tile2DHeader:()=>qq,_Tileset2D:()=>_Y,_WMSLayer:()=>Sq,_getURLFromTemplate:()=>JJ});function Q3({pointCount:e,getBinId:t}){let n=new Map;for(let r=0;re.length,t6=(e,t)=>{let n=0;for(let r of e)n+=t(r);return n},n6={COUNT:e6,SUM:t6,MEAN:(e,t)=>e.length===0?NaN:t6(e,t)/e.length,MIN:(e,t)=>{let n=1/0;for(let r of e){let e=t(r);e{let n=-1/0;for(let r of e){let e=t(r);e>n&&(n=e)}return n}};function r6({bins:e,getValue:t,operation:n,target:r}){(!r||r.lengtha&&(a=r[o])}return{value:r,domain:[i,a]}}function i6(e,t,n){let r={};for(let n of e.sources||[]){let e=t[n];if(e)r[n]=a6(e);else throw Error(`Cannot find attribute ${n}`)}let i={};return t=>{for(let e in r)i[e]=r[e](t);return e.getValue(i,t,n)}}function a6(e){let t=e.value,{offset:n=0,stride:r,size:i}=e.getAccessor(),a=t.BYTES_PER_ELEMENT,o=n/a,s=r?r/a:i;if(i===1)return e.isConstant?()=>t[0]:e=>{let n=o+s*e;return t[n]};let c;return e.isConstant?(c=Array.from(t),()=>c):(c=Array(i),e=>{let n=o+s*e;for(let e=0;e`,targetSize:`vec2`}},l6=[1,2,4,8],u6=3e38,d6={SUM:0,MEAN:0,MIN:0,MAX:0,COUNT:0},f6=1024,p6=class{constructor(e,t){this.binsFBO=null,this.device=e,this.model=h6(e,t)}get texture(){return this.binsFBO?this.binsFBO.colorAttachments[0].texture:null}destroy(){this.model.destroy(),this.binsFBO?.colorAttachments[0].texture.destroy(),this.binsFBO?.destroy()}getBinValues(e){if(!this.binsFBO)return null;let t=e%f6,n=Math.floor(e/f6),r=this.device.readPixelsToArrayWebGL(this.binsFBO,{sourceX:t,sourceY:n,sourceWidth:1,sourceHeight:1}).buffer;return new Float32Array(r)}setDimensions(e,t){let n=f6,r=Math.ceil(e/n);this.binsFBO?this.binsFBO.height= binSorter.binIdRange.y) { + binId = -1; + } else { + binId = (binId2.y - binSorter.binIdRange.z) * (binSorter.binIdRange.y - binSorter.binIdRange.x) + binId2.x; + } +} +`);let r=`\ +#version 300 es +#define SHADER_NAME gpu-aggregation-sort-bins-vertex + +${n} + +out vec3 v_Value; + +void main() { + int binIndex; + getBin(binIndex); + binIndex = binIndex - binSorter.binIdRange.x; + if (binIndex < 0) { + gl_Position = vec4(0.); + return; + } + int row = binIndex / binSorter.targetSize.x; + int col = binIndex - row * binSorter.targetSize.x; + vec2 position = (vec2(col, row) + 0.5) / vec2(binSorter.targetSize) * 2.0 - 1.0; + gl_Position = vec4(position, 0.0, 1.0); + gl_PointSize = 1.0; + +#if NUM_CHANNELS == 3 + getValue(v_Value); +#elif NUM_CHANNELS == 2 + getValue(v_Value.xy); +#else + getValue(v_Value.x); +#endif +} +`;return new Rg(e,{bufferLayout:t.bufferLayout,modules:[...t.modules||[],c6],defines:{...t.defines,NON_INSTANCED_MODEL:1,NUM_CHANNELS:t.channelCount},isInstanced:!1,vs:r,fs:`#version 300 es +#define SHADER_NAME gpu-aggregation-sort-bins-fragment + +precision highp float; + +in vec3 v_Value; +out vec4 fragColor; + +void main() { + fragColor.xyz = v_Value; + + #ifdef MODULE_GEOMETRY + geometry.uv = vec2(0.); + DECKGL_FILTER_COLOR(fragColor, geometry); + #endif + + fragColor.w = 1.0; +} +`,topology:`point-list`,disableWarnings:!0})}var g6={name:`aggregatorTransform`,vs:`layout(std140) uniform aggregatorTransformUniforms { + ivec4 binIdRange; + bvec3 isCount; + bvec3 isMean; + float naN; +} aggregatorTransform; +`,uniformTypes:{binIdRange:`vec4`,isCount:`vec3`,isMean:`vec3`,naN:`f32`}},_6=class{constructor(e,t){this.binBuffer=null,this.valueBuffer=null,this._domains=null,this.device=e,this.channelCount=t.channelCount,this.transform=v6(e,t),this.domainFBO=s6(e,2,1)}destroy(){this.transform.destroy(),this.binBuffer?.destroy(),this.valueBuffer?.destroy(),this.domainFBO.colorAttachments[0].texture.destroy(),this.domainFBO.destroy()}get domains(){if(!this._domains){let e=this.device.readPixelsToArrayWebGL(this.domainFBO).buffer,t=new Float32Array(e);this._domains=[[-t[4],t[0]],[-t[5],t[1]],[-t[6],t[2]]].slice(0,this.channelCount)}return this._domains}setDimensions(e,t){let{model:n,transformFeedback:r}=this.transform;n.setVertexCount(e);let i={binIdRange:[t[0][0],t[0][1],t[1]?.[0]||0,t[1]?.[1]||0]};n.shaderInputs.setProps({aggregatorTransform:i});let a=e*t.length*4;(!this.binBuffer||this.binBuffer.byteLength+(t[e]===`COUNT`)),isMean:[0,1,2].map(e=>+(t[e]===`MEAN`)),bins:e};n.model.shaderInputs.setProps({aggregatorTransform:i}),n.run({id:`gpu-aggregation-domain`,framebuffer:r,parameters:{viewport:[0,0,2,1]},clearColor:[-3e38,-3e38,-3e38,0],clearDepth:!1,clearStencil:!1}),this._domains=null}};function v6(e,t){return e.type===`webgl`&&e.getExtension(`GL_ARB_shader_bit_encoding`),new Gg(e,{vs:`#version 300 es +#define SHADER_NAME gpu-aggregation-domain-vertex + +uniform sampler2D bins; + +#if NUM_DIMS == 1 +out float binIds; +#else +out vec2 binIds; +#endif + +#if NUM_CHANNELS == 1 +flat out float values; +#elif NUM_CHANNELS == 2 +flat out vec2 values; +#else +flat out vec3 values; +#endif + +const float NAN = intBitsToFloat(-1); + +void main() { + int row = gl_VertexID / SAMPLER_WIDTH; + int col = gl_VertexID - row * SAMPLER_WIDTH; + vec4 weights = texelFetch(bins, ivec2(col, row), 0); + vec3 value3 = mix( + mix(weights.rgb, vec3(weights.a), aggregatorTransform.isCount), + weights.rgb / max(weights.a, 1.0), + aggregatorTransform.isMean + ); + if (weights.a == 0.0) { + value3 = vec3(NAN); + } + +#if NUM_DIMS == 1 + binIds = float(gl_VertexID + aggregatorTransform.binIdRange.x); +#else + int y = gl_VertexID / (aggregatorTransform.binIdRange.y - aggregatorTransform.binIdRange.x); + int x = gl_VertexID - y * (aggregatorTransform.binIdRange.y - aggregatorTransform.binIdRange.x); + binIds.y = float(y + aggregatorTransform.binIdRange.z); + binIds.x = float(x + aggregatorTransform.binIdRange.x); +#endif + +#if NUM_CHANNELS == 3 + values = value3; +#elif NUM_CHANNELS == 2 + values = value3.xy; +#else + values = value3.x; +#endif + + gl_Position = vec4(0., 0., 0., 1.); + // This model renders into a 2x1 texture to obtain min and max simultaneously. + // See comments in fragment shader + gl_PointSize = 2.0; +} +`,fs:`#version 300 es +#define SHADER_NAME gpu-aggregation-domain-fragment + +precision highp float; + +#if NUM_CHANNELS == 1 +flat in float values; +#elif NUM_CHANNELS == 2 +flat in vec2 values; +#else +flat in vec3 values; +#endif + +out vec4 fragColor; + +void main() { + vec3 value3; +#if NUM_CHANNELS == 3 + value3 = values; +#elif NUM_CHANNELS == 2 + value3.xy = values; +#else + value3.x = values; +#endif + if (isnan(value3.x)) discard; + // This shader renders into a 2x1 texture with blending=max + // The left pixel yields the max value of each channel + // The right pixel yields the min value of each channel + if (gl_FragCoord.x < 1.0) { + fragColor = vec4(value3, 1.0); + } else { + fragColor = vec4(-value3, 1.0); + } +} +`,topology:`point-list`,modules:[g6],parameters:{blend:!0,blendColorSrcFactor:`one`,blendColorDstFactor:`one`,blendColorOperation:`max`,blendAlphaSrcFactor:`one`,blendAlphaDstFactor:`one`,blendAlphaOperation:`max`},defines:{NUM_DIMS:t.dimensions,NUM_CHANNELS:t.channelCount,SAMPLER_WIDTH:f6},varyings:[`binIds`,`values`],disableWarnings:!0})}var y6=class{static isSupported(e){return e.features.has(`float32-renderable-webgl`)&&e.features.has(`texture-blend-float-webgl`)}constructor(e,t){this.binCount=0,this.binIds=null,this.results=[],this.device=e,this.dimensions=t.dimensions,this.channelCount=t.channelCount,this.props={...t,pointCount:0,binIdRange:[[0,0]],operations:[],attributes:{},binOptions:{}},this.needsUpdate=Array(this.channelCount).fill(!0),this.binSorter=new p6(e,t),this.aggregationTransform=new _6(e,t),this.setProps(t)}getBins(){let e=this.aggregationTransform.binBuffer;return e?(this.binIds?.buffer!==e&&(this.binIds={buffer:e,type:`float32`,size:this.dimensions}),this.binIds):null}getResult(e){let t=this.aggregationTransform.valueBuffer;return!t||e>=this.channelCount?null:(this.results[e]?.buffer!==t&&(this.results[e]={buffer:t,type:`float32`,size:1,stride:this.channelCount*4,offset:e*4}),this.results[e])}getResultDomain(e){return this.aggregationTransform.domains[e]}getBin(e){if(e<0||e>=this.binCount)return null;let{binIdRange:t}=this.props,n;if(this.dimensions===1)n=[e+t[0][0]];else{let[[r,i],[a]]=t,o=i-r;n=[e%o+r,Math.floor(e/o)+a]}let r=this.binSorter.getBinValues(e);if(!r)return null;let i=r[3],a=[];for(let e=0;et?e[n]:null);this.binSorter.update(t),this.aggregationTransform.update(this.binSorter.texture,e);for(let e=0;e`,gridSizeClipspace:`vec2`,colorDomain:`vec2`}},k6=class extends dx{getShaders(){return super.getShaders({vs:E6,fs:D6,modules:[jm,O6]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:2,type:`float32`,accessor:`getBin`},instanceWeights:{size:1,type:`float32`,accessor:`getWeight`}}),this.state.model=this._getModel()}updateState(e){super.updateState(e);let{props:t,oldProps:n,changeFlags:r}=e,i=this.state.model;if(n.colorRange!==t.colorRange){this.state.colorTexture?.destroy(),this.state.colorTexture=T6(this.context.device,t.colorRange,t.colorScaleType);let e={colorRange:this.state.colorTexture};i.shaderInputs.setProps({screenGrid:e})}else n.colorScaleType!==t.colorScaleType&&w6(this.state.colorTexture,t.colorScaleType);if(n.cellMarginPixels!==t.cellMarginPixels||n.cellSizePixels!==t.cellSizePixels||r.viewportChanged){let{width:e,height:t}=this.context.viewport,{cellSizePixels:n,cellMarginPixels:r}=this.props,a=Math.max(n-r,0),o={gridSizeClipspace:[n/e*2,n/t*2],cellSizeClipspace:[a/e*2,a/t*2]};i.shaderInputs.setProps({screenGrid:o})}}finalizeState(e){super.finalizeState(e),this.state.colorTexture?.destroy()}draw({uniforms:e}){let t=this.props.colorDomain(),n=this.state.model,r={colorDomain:t};n.shaderInputs.setProps({screenGrid:r}),n.draw(this.context.renderPass)}_getModel(){return new Rg(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new Jg({topology:`triangle-strip`,attributes:{positions:{value:new Float32Array([0,0,1,0,0,1,1,1]),size:2}}}),isInstanced:!0})}};k6.layerName=`ScreenGridCellLayer`;var A6={name:`binOptions`,vs:`layout(std140) uniform binOptionsUniforms { + float cellSizePixels; +} binOptions; +`,uniformTypes:{cellSizePixels:`f32`}},j6={cellSizePixels:{type:`number`,value:100,min:1},cellMarginPixels:{type:`number`,value:2,min:0},colorRange:x6,colorScaleType:`linear`,getPosition:{type:`accessor`,value:e=>e.position},getWeight:{type:`accessor`,value:1},gpuAggregation:!0,aggregation:`SUM`},M6=class extends b6{getAggregatorType(){return this.props.gpuAggregation&&y6.isSupported(this.context.device)?`gpu`:`cpu`}createAggregator(e){return e===`cpu`||!y6.isSupported(this.context.device)?new o6({dimensions:2,getBin:{sources:[`positions`],getValue:({positions:e},t,n)=>{let r=this.context.viewport,i=r.project(e),a=n.cellSizePixels;return i[0]<0||i[0]>=r.width||i[1]<0||i[1]>=r.height?null:[Math.floor(i[0]/a),Math.floor(i[1]/a)]}},getValue:[{sources:[`counts`],getValue:({counts:e})=>e}]}):new y6(this.context.device,{dimensions:2,channelCount:1,bufferLayout:this.getAttributeManager().getBufferLayouts({isInstanced:!1}),...super.getShaders({modules:[Bp,A6],vs:` + in vec3 positions; + in vec3 positions64Low; + in float counts; + + void getBin(out ivec2 binId) { + vec4 pos = project_position_to_clipspace(positions, positions64Low, vec3(0.0)); + vec2 screenCoords = vec2(pos.x / pos.w + 1.0, 1.0 - pos.y / pos.w) / 2.0 * project.viewportSize.xy / project.devicePixelRatio; + vec2 gridCoords = floor(screenCoords / binOptions.cellSizePixels); + binId = ivec2(gridCoords); + } + void getValue(out float weight) { + weight = counts; + } + `})})}initializeState(){super.initializeState(),this.getAttributeManager().add({positions:{size:3,accessor:`getPosition`,type:`float64`,fp64:this.use64bitPositions()},counts:{size:1,accessor:`getWeight`}})}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState(e){let t=super.updateState(e),{props:n,oldProps:r,changeFlags:i}=e,{cellSizePixels:a,aggregation:o}=n;if(t||i.dataChanged||i.updateTriggersChanged||i.viewportChanged||o!==r.aggregation||a!==r.cellSizePixels){let{width:e,height:t}=this.context.viewport,{aggregator:n}=this.state;n instanceof y6&&n.setProps({binIdRange:[[0,Math.ceil(e/a)],[0,Math.ceil(t/a)]]}),n.setProps({pointCount:this.getNumInstances(),operations:[o],binOptions:{cellSizePixels:a}})}return i.viewportChanged&&this.state.aggregator.setNeedsUpdate(),t}onAttributeChange(e){let{aggregator:t}=this.state;switch(e){case`positions`:t.setNeedsUpdate();break;case`counts`:t.setNeedsUpdate(0);break;default:}}renderLayers(){let{aggregator:e}=this.state,t=this.getSubLayerClass(`cells`,k6),n=e.getBins(),r=e.getResult(0);return new t(this.props,this.getSubLayerProps({id:`cell-layer`}),{data:{length:e.binCount,attributes:{getBin:n,getWeight:r}},dataComparator:(e,t)=>e.length===t.length,updateTriggers:{getBin:[n],getWeight:[r]},parameters:{depthWriteEnabled:!1,...this.props.parameters},colorDomain:()=>this.props.colorDomain||e.getResultDomain(0),extensions:[]})}getPickingInfo(e){let t=e.info,{index:n}=t;if(n>=0){let e=this.state.aggregator.getBin(n),r;e&&(r={col:e.id[0],row:e.id[1],value:e.value[0],count:e.count},e.pointIndices&&(r.pointIndices=e.pointIndices,r.points=Array.isArray(this.props.data)?e.pointIndices.map(e=>this.props.data[e]):[])),t.object=r}return t}};M6.layerName=`ScreenGridLayer`,M6.defaultProps=j6;var N6=class{constructor(e,t){this.props={scaleType:`linear`,lowerPercentile:0,upperPercentile:100},this.domain=null,this.cutoff=null,this.input=e,this.inputLength=t,this.attribute=e}getScalePercentile(){if(!this._percentile){let e=I6(this.input,this.inputLength);this._percentile=F6(e)}return this._percentile}getScaleOrdinal(){if(!this._ordinal){let e=I6(this.input,this.inputLength);this._ordinal=P6(e)}return this._ordinal}getCutoff({scaleType:e,lowerPercentile:t,upperPercentile:n}){if(e===`quantile`)return[t,n-1];if(t>0||n<100){let{domain:r}=this.getScalePercentile(),i=r[Math.floor(t)-1]??-1/0,a=r[Math.floor(n)-1]??1/0;if(e===`ordinal`){let{domain:e}=this.getScaleOrdinal();i=e.findIndex(e=>e>=i),a=e.findIndex(e=>e>a)-1,a===-2&&(a=e.length-1)}return[i,a]}return null}update(e){let t=this.props;if(e.scaleType!==t.scaleType)switch(e.scaleType){case`quantile`:{let{attribute:e}=this.getScalePercentile();this.attribute=e,this.domain=[0,99];break}case`ordinal`:{let{attribute:e,domain:t}=this.getScaleOrdinal();this.attribute=e,this.domain=[0,t.length-1];break}default:this.attribute=this.input,this.domain=null}return(e.scaleType!==t.scaleType||e.lowerPercentile!==t.lowerPercentile||e.upperPercentile!==t.upperPercentile)&&(this.cutoff=this.getCutoff(e)),this.props=e,this}};function P6(e){let t=new Set;for(let n of e)Number.isFinite(n)&&t.add(n);let n=Array.from(t).sort(),r=new Map;for(let e=0;eNumber.isFinite(e)?r.get(e):NaN),type:`float32`,size:1},domain:n}}function F6(e,t=100){let n=Array.from(e).filter(Number.isFinite).sort(L6),r=0,i=Math.max(1,t),a=Array(i-1);for(;++rNumber.isFinite(e)?z6(a,e):NaN),type:`float32`,size:1},domain:a}}function I6(e,t){let n=(e.stride??4)/4,r=(e.offset??0)/4,i=e.value;if(!i){let r=e.buffer?.readSyncWebGL(0,n*4*t);r&&(i=new Float32Array(r.buffer),e.value=i)}if(n===1)return i.subarray(0,t);let a=new Float32Array(t);for(let e=0;e=1)return e[n-1];let r=(n-1)*t,i=Math.floor(r),a=e[i];return a+(e[i+1]-a)*(r-i)}function z6(e,t){let n=0,r=e.length;for(;n>>1;e[i]>t?r=i:n=i+1}return n}function B6({dataBounds:e,getBinId:t,padding:n=0}){let r=[e[0],e[1],[e[0][0],e[1][1]],[e[1][0],e[0][1]]].map(e=>t(e)),i=Math.min(...r.map(e=>e[0]))-n,a=Math.min(...r.map(e=>e[1]))-n,o=Math.max(...r.map(e=>e[0]))+n+1,s=Math.max(...r.map(e=>e[1]))+n+1;return[[i,o],[a,s]]}var V6=Math.PI/3,H6=2*Math.sin(V6),U6=1.5,W6=Array.from({length:6},(e,t)=>{let n=t*V6;return[Math.sin(n),-Math.cos(n)]});function G6([e,t],n){let r=Math.round(t=t/n/U6),i=Math.round(e=e/n/H6-(r&1)/2),a=t-r;if(Math.abs(a)*3>1){let n=e-i,o=i+(ec*c+l*l&&(i=o+(r&1?1:-1)/2,r=s)}return[i,r]}var K6=` +const vec2 DIST = vec2(${H6}, ${U6}); + +ivec2 pointToHexbin(vec2 p, float radius) { + p /= radius * DIST; + float pj = round(p.y); + float pjm2 = mod(pj, 2.0); + p.x -= pjm2 * 0.5; + float pi = round(p.x); + vec2 d1 = p - vec2(pi, pj); + + if (abs(d1.y) * 3. > 1.) { + vec2 v2 = step(0.0, d1) - 0.5; + v2.y *= 2.0; + vec2 d2 = d1 - v2; + if (dot(d1, d1) > dot(d2, d2)) { + pi += v2.x + pjm2 - 0.5; + pj += v2.y; + } + } + return ivec2(pi, pj); +} +`;function q6([e,t],n){return[(e+(t&1)/2)*n*H6,t*n*U6]}var J6=`\ +#version 300 es +#define SHADER_NAME hexagon-cell-layer-vertex-shader +in vec3 positions; +in vec3 normals; +in vec2 instancePositions; +in float instanceElevationValues; +in float instanceColorValues; +in vec3 instancePickingColors; +uniform sampler2D colorRange; +out vec4 vColor; +${` +const vec2 DIST = vec2(${H6}, ${U6}); + +vec2 hexbinCentroid(vec2 binId, float radius) { + binId.x += fract(binId.y * 0.5); + return binId * DIST * radius; +} +`} +float interp(float value, vec2 domain, vec2 range) { +float r = min(max((value - domain.x) / (domain.y - domain.x), 0.), 1.); +return mix(range.x, range.y, r); +} +vec4 interp(float value, vec2 domain, sampler2D range) { +float r = (value - domain.x) / (domain.y - domain.x); +return texture(range, vec2(r, 0.5)); +} +void main(void) { +geometry.pickingColor = instancePickingColors; +if (isnan(instanceColorValues) || +instanceColorValues < hexagon.colorDomain.z || +instanceColorValues > hexagon.colorDomain.w || +instanceElevationValues < hexagon.elevationDomain.z || +instanceElevationValues > hexagon.elevationDomain.w +) { +gl_Position = vec4(0.); +return; +} +vec2 commonPosition = hexbinCentroid(instancePositions, column.radius) + (hexagon.originCommon - project.commonOrigin.xy); +commonPosition += positions.xy * column.radius * column.coverage; +geometry.position = vec4(commonPosition, 0.0, 1.0); +geometry.normal = project_normal(normals); +float elevation = 0.0; +if (column.extruded) { +elevation = interp(instanceElevationValues, hexagon.elevationDomain.xy, hexagon.elevationRange); +elevation = project_size(elevation); +geometry.position.z = (positions.z + 1.0) / 2.0 * elevation; +} +gl_Position = project_common_position_to_clipspace(geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +vColor = interp(instanceColorValues, hexagon.colorDomain.xy, colorRange); +vColor.a *= layer.opacity; +if (column.extruded) { +vColor.rgb = lighting_getLightColor(vColor.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal); +} +DECKGL_FILTER_COLOR(vColor, geometry); +} +`,Y6={name:`hexagon`,vs:`layout(std140) uniform hexagonUniforms { + vec4 colorDomain; + vec4 elevationDomain; + vec2 elevationRange; + vec2 originCommon; +} hexagon; +`,uniformTypes:{colorDomain:`vec4`,elevationDomain:`vec4`,elevationRange:`vec2`,originCommon:`vec2`}},X6=class extends JP{getShaders(){let e=super.getShaders();return e.modules.push(Y6),{...e,vs:J6}}initializeState(){super.initializeState();let e=this.getAttributeManager();e.remove([`instanceElevations`,`instanceFillColors`,`instanceLineColors`,`instanceStrokeWidths`]),e.addInstanced({instancePositions:{size:2,type:`float32`,accessor:`getBin`},instanceColorValues:{size:1,type:`float32`,accessor:`getColorValue`},instanceElevationValues:{size:1,type:`float32`,accessor:`getElevationValue`}})}updateState(e){super.updateState(e);let{props:t,oldProps:n}=e,r=this.state.fillModel;if(n.colorRange!==t.colorRange){this.state.colorTexture?.destroy(),this.state.colorTexture=T6(this.context.device,t.colorRange,t.colorScaleType);let e={colorRange:this.state.colorTexture};r.shaderInputs.setProps({hexagon:e})}else n.colorScaleType!==t.colorScaleType&&w6(this.state.colorTexture,t.colorScaleType)}finalizeState(e){super.finalizeState(e),this.state.colorTexture?.destroy()}draw({uniforms:e}){let{radius:t,hexOriginCommon:n,elevationRange:r,elevationScale:i,extruded:a,coverage:o,colorDomain:s,elevationDomain:c}=this.props,l=this.props.colorCutoff||[-1/0,1/0],u=this.props.elevationCutoff||[-1/0,1/0],d=this.state.fillModel;d.setVertexCount(this.state.fillVertexCount);let f={colorDomain:[Math.max(s[0],l[0]),Math.min(s[1],l[1]),Math.max(s[0]-1,l[0]),Math.min(s[1]+1,l[1])],elevationDomain:[Math.max(c[0],u[0]),Math.min(c[1],u[1]),Math.max(c[0]-1,u[0]),Math.min(c[1]+1,u[1])],elevationRange:[r[0]*i,r[1]*i],originCommon:n};d.shaderInputs.setProps({column:{extruded:a,coverage:o,radius:t},hexagon:f}),d.draw(this.context.renderPass)}};X6.layerName=`HexagonCellLayer`;var Z6={name:`binOptions`,vs:`layout(std140) uniform binOptionsUniforms { + vec2 hexOriginCommon; + float radiusCommon; +} binOptions; +`,uniformTypes:{hexOriginCommon:`vec2`,radiusCommon:`f32`}};function Q6(){}var $6={gpuAggregation:!0,colorDomain:null,colorRange:x6,getColorValue:{type:`accessor`,value:null},getColorWeight:{type:`accessor`,value:1},colorAggregation:`SUM`,lowerPercentile:{type:`number`,min:0,max:100,value:0},upperPercentile:{type:`number`,min:0,max:100,value:100},colorScaleType:`quantize`,onSetColorDomain:Q6,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:`accessor`,value:null},getElevationWeight:{type:`accessor`,value:1},elevationAggregation:`SUM`,elevationScale:{type:`number`,min:0,value:1},elevationLowerPercentile:{type:`number`,min:0,max:100,value:0},elevationUpperPercentile:{type:`number`,min:0,max:100,value:100},elevationScaleType:`linear`,onSetElevationDomain:Q6,radius:{type:`number`,min:1,value:1e3},coverage:{type:`number`,min:0,max:1,value:1},getPosition:{type:`accessor`,value:e=>e.position},hexagonAggregator:{type:`function`,optional:!0,value:null},extruded:!1,material:!0},e8=class extends b6{getAggregatorType(){let{gpuAggregation:e,hexagonAggregator:t,getColorValue:n,getElevationValue:r}=this.props;return e&&(t||n||r)?(fo.warn(`Features not supported by GPU aggregation, falling back to CPU`)(),`cpu`):e&&y6.isSupported(this.context.device)?`gpu`:`cpu`}createAggregator(e){if(e===`cpu`){let{hexagonAggregator:e,radius:t}=this.props;return new o6({dimensions:2,getBin:{sources:[`positions`],getValue:({positions:n},r,i)=>{if(e)return e(n,t);let a=this.state.aggregatorViewport.projectPosition(n),{radiusCommon:o,hexOriginCommon:s}=i;return G6([a[0]-s[0],a[1]-s[1]],o)}},getValue:[{sources:[`colorWeights`],getValue:({colorWeights:e})=>e},{sources:[`elevationWeights`],getValue:({elevationWeights:e})=>e}]})}return new y6(this.context.device,{dimensions:2,channelCount:2,bufferLayout:this.getAttributeManager().getBufferLayouts({isInstanced:!1}),...super.getShaders({modules:[Bp,Z6],vs:` + in vec3 positions; + in vec3 positions64Low; + in float colorWeights; + in float elevationWeights; + + ${K6} + + void getBin(out ivec2 binId) { + vec3 positionCommon = project_position(positions, positions64Low); + binId = pointToHexbin(positionCommon.xy, binOptions.radiusCommon); + } + void getValue(out vec2 value) { + value = vec2(colorWeights, elevationWeights); + } + `})})}initializeState(){super.initializeState(),this.getAttributeManager().add({positions:{size:3,accessor:`getPosition`,type:`float64`,fp64:this.use64bitPositions()},colorWeights:{size:1,accessor:`getColorWeight`},elevationWeights:{size:1,accessor:`getElevationWeight`}})}updateState(e){let t=super.updateState(e),{props:n,oldProps:r,changeFlags:i}=e,{aggregator:a}=this.state;if((i.dataChanged||!this.state.dataAsArray)&&(n.getColorValue||n.getElevationValue)&&(this.state.dataAsArray=Array.from(Ty(n.data).iterable)),t||i.dataChanged||n.radius!==r.radius||n.getColorValue!==r.getColorValue||n.getElevationValue!==r.getElevationValue||n.colorAggregation!==r.colorAggregation||n.elevationAggregation!==r.elevationAggregation){this._updateBinOptions();let{radiusCommon:e,hexOriginCommon:t,binIdRange:r,dataAsArray:i}=this.state;if(a.setProps({binIdRange:r,pointCount:this.getNumInstances(),operations:[n.colorAggregation,n.elevationAggregation],binOptions:{radiusCommon:e,hexOriginCommon:t},onUpdate:this._onAggregationUpdate.bind(this)}),i){let{getColorValue:e,getElevationValue:t}=this.props;a.setProps({customOperations:[e&&(t=>e(t.map(e=>i[e]),{indices:t,data:n.data})),t&&(e=>t(e.map(e=>i[e]),{indices:e,data:n.data}))]})}}return i.updateTriggersChanged&&i.updateTriggersChanged.getColorValue&&a.setNeedsUpdate(0),i.updateTriggersChanged&&i.updateTriggersChanged.getElevationValue&&a.setNeedsUpdate(1),t}_updateBinOptions(){let e=this.getBounds(),t=1,n=[0,0],r=[[0,1],[0,1]],i=this.context.viewport;if(e&&Number.isFinite(e[0][0])){let a=[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2],{radius:o}=this.props,{unitsPerMeter:s}=i.getDistanceScales(a);t=s[0]*o;let c=G6(i.projectFlat(a),t);a=i.unprojectFlat(q6(c,t));let l=i.constructor;i=i.isGeospatial?new l({longitude:a[0],latitude:a[1],zoom:12}):new vh({position:[a[0],a[1],0],zoom:12}),n=[Math.fround(i.center[0]),Math.fround(i.center[1])],r=B6({dataBounds:e,getBinId:e=>{let r=i.projectFlat(e);return r[0]-=n[0],r[1]-=n[1],G6(r,t)},padding:1})}this.setState({radiusCommon:t,hexOriginCommon:n,binIdRange:r,aggregatorViewport:i})}draw(e){e.shaderModuleProps.project&&(e.shaderModuleProps.project.viewport=this.state.aggregatorViewport),super.draw(e)}_onAggregationUpdate({channel:e}){let t=this.getCurrentLayer().props,{aggregator:n}=this.state;if(e===0){let e=n.getResult(0);this.setState({colors:new N6(e,n.binCount)}),t.onSetColorDomain(n.getResultDomain(0))}else if(e===1){let e=n.getResult(1);this.setState({elevations:new N6(e,n.binCount)}),t.onSetElevationDomain(n.getResultDomain(1))}}onAttributeChange(e){let{aggregator:t}=this.state;switch(e){case`positions`:t.setNeedsUpdate(),this._updateBinOptions();let{radiusCommon:e,hexOriginCommon:n,binIdRange:r}=this.state;t.setProps({binIdRange:r,binOptions:{radiusCommon:e,hexOriginCommon:n}});break;case`colorWeights`:t.setNeedsUpdate(0);break;case`elevationWeights`:t.setNeedsUpdate(1);break;default:}}renderLayers(){let{aggregator:e,radiusCommon:t,hexOriginCommon:n}=this.state,{elevationScale:r,colorRange:i,elevationRange:a,extruded:o,coverage:s,material:c,transitions:l,colorScaleType:u,lowerPercentile:d,upperPercentile:f,colorDomain:p,elevationScaleType:m,elevationLowerPercentile:h,elevationUpperPercentile:g,elevationDomain:_}=this.props,v=this.getSubLayerClass(`cells`,X6),y=e.getBins(),b=this.state.colors?.update({scaleType:u,lowerPercentile:d,upperPercentile:f}),x=this.state.elevations?.update({scaleType:m,lowerPercentile:h,upperPercentile:g});return!b||!x?null:new v(this.getSubLayerProps({id:`cells`}),{data:{length:e.binCount,attributes:{getBin:y,getColorValue:b.attribute,getElevationValue:x.attribute}},dataComparator:(e,t)=>e.length===t.length,updateTriggers:{getBin:[y],getColorValue:[b.attribute],getElevationValue:[x.attribute]},diskResolution:6,vertices:W6,radius:t,hexOriginCommon:n,elevationScale:r,colorRange:i,colorScaleType:u,elevationRange:a,extruded:o,coverage:s,material:c,colorDomain:b.domain||p||e.getResultDomain(0),elevationDomain:x.domain||_||e.getResultDomain(1),colorCutoff:b.cutoff,elevationCutoff:x.cutoff,transitions:l&&{getFillColor:l.getColorValue||l.getColorWeight,getElevation:l.getElevationValue||l.getElevationWeight},extensions:[]})}getPickingInfo(e){let t=e.info,{index:n}=t;if(n>=0){let e=this.state.aggregator.getBin(n),r;if(e){let t=q6(e.id,this.state.radiusCommon),n=this.context.viewport.unprojectFlat(t);r={col:e.id[0],row:e.id[1],position:n,colorValue:e.value[0],elevationValue:e.value[1],count:e.count},e.pointIndices&&(r.pointIndices=e.pointIndices,r.points=Array.isArray(this.props.data)?e.pointIndices.map(e=>this.props.data[e]):[])}t.object=r}return t}};e8.layerName=`HexagonLayer`,e8.defaultProps=$6;var t8=.5,n8=1/6,$={N:[0,t8],E:[t8,0],S:[0,-.5],W:[-.5,0],NE:[t8,t8],NW:[-.5,t8],SE:[t8,-.5],SW:[-.5,-.5]},r8=[$.W,$.SW,$.S],i8=[$.S,$.SE,$.E],a8=[$.E,$.NE,$.N],o8=[$.NW,$.W,$.N],s8=[[-.5,n8],[-.5,-.16666666666666666],[-.16666666666666666,-.5],[n8,-.5]],c8=[[-.16666666666666666,-.5],[n8,-.5],[t8,-.16666666666666666],[t8,n8]],l8=[[t8,-.16666666666666666],[t8,n8],[n8,t8],[-.16666666666666666,t8]],u8=[[-.5,n8],[-.5,-.16666666666666666],[n8,t8],[-.16666666666666666,t8]],d8=[$.W,$.SW,$.SE,$.E],f8=[$.S,$.SE,$.NE,$.N],p8=[$.NW,$.W,$.E,$.NE],m8=[$.NW,$.SW,$.S,$.N],h8=[[-.5,n8],[-.5,-.16666666666666666],[t8,-.16666666666666666],[t8,n8]],g8=[[-.16666666666666666,-.5],[n8,-.5],[n8,t8],[-.16666666666666666,t8]],_8=[$.NW,$.SW,$.SE,$.NE],v8=[$.NW,$.SW,$.SE,$.E,$.N],y8=[$.W,$.SW,$.SE,$.NE,$.N],b8=[$.NW,$.W,$.S,$.SE,$.NE],x8=[$.NW,$.SW,$.S,$.E,$.NE],S8=[$.NW,$.W,[t8,-.16666666666666666],[t8,n8],$.N],C8=[[-.16666666666666666,-.5],[n8,-.5],$.E,$.NE,$.N],w8=[[-.5,n8],[-.5,-.16666666666666666],$.S,$.SE,$.E],T8=[$.W,$.SW,$.S,[n8,t8],[-.16666666666666666,t8]],E8=[$.NW,$.W,[-.16666666666666666,-.5],[n8,-.5],$.N],D8=[[-.5,n8],[-.5,-.16666666666666666],$.E,$.NE,$.N],O8=[$.S,$.SE,$.E,[n8,t8],[-.16666666666666666,t8]],k8=[$.W,$.SW,$.S,[t8,-.16666666666666666],[t8,n8]],A8=[$.W,$.SW,$.SE,$.E,[n8,t8],[-.16666666666666666,t8]],j8=[[-.5,n8],[-.5,-.16666666666666666],$.S,$.SE,$.NE,$.N],M8=[$.NW,$.W,[-.16666666666666666,-.5],[n8,-.5],$.E,$.NE],N8=[$.NW,$.SW,$.S,[t8,-.16666666666666666],[t8,n8],$.N],P8=[$.W,$.SW,$.S,$.E,$.NE,$.N],F8=[$.NW,$.W,$.S,$.SE,$.E,$.N],I8=[[-.5,n8],[-.5,-.16666666666666666],[-.16666666666666666,-.5],[n8,-.5],$.E,$.NE,$.N],L8=[$.W,$.SW,$.S,[t8,-.16666666666666666],[t8,n8],[n8,t8],[-.16666666666666666,t8]],R8=[$.NW,$.W,[-.16666666666666666,-.5],[n8,-.5],[t8,-.16666666666666666],[t8,n8],$.N],z8=[[-.5,n8],[-.5,-.16666666666666666],$.S,$.SE,$.E,[n8,t8],[-.16666666666666666,t8]],B8=[[-.5,n8],[-.5,-.16666666666666666],[-.16666666666666666,-.5],[n8,-.5],[t8,-.16666666666666666],[t8,n8],[n8,t8],[-.16666666666666666,t8]],V8={0:[],1:[[$.W,$.S]],2:[[$.S,$.E]],3:[[$.W,$.E]],4:[[$.N,$.E]],5:{0:[[$.W,$.S],[$.N,$.E]],1:[[$.W,$.N],[$.S,$.E]]},6:[[$.N,$.S]],7:[[$.W,$.N]],8:[[$.W,$.N]],9:[[$.N,$.S]],10:{0:[[$.W,$.N],[$.S,$.E]],1:[[$.W,$.S],[$.N,$.E]]},11:[[$.N,$.E]],12:[[$.W,$.E]],13:[[$.S,$.E]],14:[[$.W,$.S]],15:[]};function H8(e){return parseInt(e,4)}var U8={[H8(`0000`)]:[],[H8(`2222`)]:[],[H8(`2221`)]:[r8],[H8(`2212`)]:[i8],[H8(`2122`)]:[a8],[H8(`1222`)]:[o8],[H8(`0001`)]:[r8],[H8(`0010`)]:[i8],[H8(`0100`)]:[a8],[H8(`1000`)]:[o8],[H8(`2220`)]:[s8],[H8(`2202`)]:[c8],[H8(`2022`)]:[l8],[H8(`0222`)]:[u8],[H8(`0002`)]:[s8],[H8(`0020`)]:[c8],[H8(`0200`)]:[l8],[H8(`2000`)]:[u8],[H8(`0011`)]:[d8],[H8(`0110`)]:[f8],[H8(`1100`)]:[p8],[H8(`1001`)]:[m8],[H8(`2211`)]:[d8],[H8(`2112`)]:[f8],[H8(`1122`)]:[p8],[H8(`1221`)]:[m8],[H8(`2200`)]:[h8],[H8(`2002`)]:[g8],[H8(`0022`)]:[h8],[H8(`0220`)]:[g8],[H8(`1111`)]:[_8],[H8(`1211`)]:[v8],[H8(`2111`)]:[y8],[H8(`1112`)]:[b8],[H8(`1121`)]:[x8],[H8(`1011`)]:[v8],[H8(`0111`)]:[y8],[H8(`1110`)]:[b8],[H8(`1101`)]:[x8],[H8(`1200`)]:[S8],[H8(`0120`)]:[C8],[H8(`0012`)]:[w8],[H8(`2001`)]:[T8],[H8(`1022`)]:[S8],[H8(`2102`)]:[C8],[H8(`2210`)]:[w8],[H8(`0221`)]:[T8],[H8(`1002`)]:[E8],[H8(`2100`)]:[D8],[H8(`0210`)]:[O8],[H8(`0021`)]:[k8],[H8(`1220`)]:[E8],[H8(`0122`)]:[D8],[H8(`2012`)]:[O8],[H8(`2201`)]:[k8],[H8(`0211`)]:[A8],[H8(`2110`)]:[j8],[H8(`1102`)]:[M8],[H8(`1021`)]:[N8],[H8(`2011`)]:[A8],[H8(`0112`)]:[j8],[H8(`1120`)]:[M8],[H8(`1201`)]:[N8],[H8(`2101`)]:[P8],[H8(`0121`)]:[P8],[H8(`1012`)]:[F8],[H8(`1210`)]:[F8],[H8(`0101`)]:{0:[r8,a8],1:[P8],2:[P8]},[H8(`1010`)]:{0:[o8,i8],1:[F8],2:[F8]},[H8(`2121`)]:{0:[P8],1:[P8],2:[r8,a8]},[H8(`1212`)]:{0:[F8],1:[F8],2:[o8,i8]},[H8(`2120`)]:{0:[I8],1:[I8],2:[s8,a8]},[H8(`2021`)]:{0:[L8],1:[L8],2:[r8,l8]},[H8(`1202`)]:{0:[R8],1:[R8],2:[o8,c8]},[H8(`0212`)]:{0:[z8],1:[z8],2:[i8,u8]},[H8(`0102`)]:{0:[s8,a8],1:[I8],2:[I8]},[H8(`0201`)]:{0:[r8,l8],1:[L8],2:[L8]},[H8(`1020`)]:{0:[o8,c8],1:[R8],2:[R8]},[H8(`2010`)]:{0:[i8,u8],1:[z8],2:[z8]},[H8(`2020`)]:{0:[u8,c8],1:[B8],2:[s8,l8]},[H8(`0202`)]:{0:[l8,s8],1:[B8],2:[u8,c8]}};function W8(e,t){return Number.isNaN(e)?0:Array.isArray(t)?e=t)}function G8(e){let{x:t,y:n,xRange:r,yRange:i,getValue:a,threshold:o}=e,s=t=r[1]-1,l=n=i[1]-1,d=s||c||l||u,f=0,p,m,h,g;if(s||u)h=0;else{let e=a(t,n+1);h=W8(e,o),f+=e}if(c||u)g=0;else{let e=a(t+1,n+1);g=W8(e,o),f+=e}if(c||l)m=0;else{let e=a(t+1,n);m=W8(e,o),f+=e}if(s||l)p=0;else{let e=a(t,n);p=W8(e,o),f+=e}let _=-1;Number.isFinite(o)&&(_=h<<3|g<<2|m<<1|p),Array.isArray(o)&&(_=h<<6|g<<4|m<<2|p);let v=0;return d||(v=W8(f/4,o)),{code:_,meanCode:v}}function K8(e){let{x:t,y:n,z:r,code:i,meanCode:a}=e,o=U8[i];Array.isArray(o)||(o=o[a]);let s=t+1,c=n+1,l=[];return o.forEach(e=>{let t=[];e.forEach(e=>{let n=s+e[0],i=c+e[1];t.push([n,i,r])}),l.push(t)}),l}function q8(e){let{x:t,y:n,z:r,code:i,meanCode:a}=e,o=V8[i];Array.isArray(o)||(o=o[a]);let s=t+1,c=n+1,l=[];return o.forEach(e=>{e.forEach(e=>{let t=s+e[0],n=c+e[1];l.push([t,n,r])})}),l}function J8({contours:e,getValue:t,xRange:n,yRange:r}){let i=[],a=[],o=0,s=0;for(let c=0;c0&&(i[o++]={vertices:e,contour:l})}}}return{lines:i,polygons:a}}function Y8(e){let{aggregator:t,binIdRange:n,channel:r}=e;if(t instanceof y6){let e=t.getResult(r)?.buffer;if(e)return X8(new Float32Array(e.readSyncWebGL().buffer),n)}if(t instanceof o6){let e=t.getResult(r)?.value,n=t.getBins()?.value;if(n&&e)return Z8(e,n,t.binCount)}return null}function X8(e,t){let[[n,r],[i,a]]=t,o=r-n,s=a-i;return(t,r)=>(t-=n,r-=i,t<0||t>=o||r<0||r>=s?NaN:e[r*o+t])}function Z8(e,t,n){let r={};for(let i=0;ir[e]?.[t]??NaN}var Q8={name:`binOptions`,vs:`layout(std140) uniform binOptionsUniforms { + vec2 cellOriginCommon; + vec2 cellSizeCommon; +} binOptions; +`,uniformTypes:{cellOriginCommon:`vec2`,cellSizeCommon:`vec2`}},$8=[255,255,255,255],e5=1,t5={cellSize:{type:`number`,min:1,value:1e3},gridOrigin:{type:`array`,compare:!0,value:[0,0]},getPosition:{type:`accessor`,value:e=>e.position},getWeight:{type:`accessor`,value:1},gpuAggregation:!0,aggregation:`SUM`,contours:{type:`object`,value:[{threshold:1}],optional:!0,compare:3},zOffset:.005},n5=class extends b6{getAggregatorType(){return this.props.gpuAggregation&&y6.isSupported(this.context.device)?`gpu`:`cpu`}createAggregator(e){return e===`cpu`?new o6({dimensions:2,getBin:{sources:[`positions`],getValue:({positions:e},t,n)=>{let r=this.state.aggregatorViewport.projectPosition(e),{cellSizeCommon:i,cellOriginCommon:a}=n;return[Math.floor((r[0]-a[0])/i[0]),Math.floor((r[1]-a[1])/i[1])]}},getValue:[{sources:[`counts`],getValue:({counts:e})=>e}],onUpdate:this._onAggregationUpdate.bind(this)}):new y6(this.context.device,{dimensions:2,channelCount:1,bufferLayout:this.getAttributeManager().getBufferLayouts({isInstanced:!1}),...super.getShaders({modules:[Bp,Q8],vs:` + in vec3 positions; + in vec3 positions64Low; + in float counts; + + void getBin(out ivec2 binId) { + vec3 positionCommon = project_position(positions, positions64Low); + vec2 gridCoords = floor(positionCommon.xy / binOptions.cellSizeCommon); + binId = ivec2(gridCoords); + } + void getValue(out float value) { + value = counts; + } + `}),onUpdate:this._onAggregationUpdate.bind(this)})}initializeState(){super.initializeState(),this.getAttributeManager().add({positions:{size:3,accessor:`getPosition`,type:`float64`,fp64:this.use64bitPositions()},counts:{size:1,accessor:`getWeight`}})}updateState(e){let t=super.updateState(e),{props:n,oldProps:r,changeFlags:i}=e,{aggregator:a}=this.state;if(t||i.dataChanged||n.cellSize!==r.cellSize||!B_(n.gridOrigin,r.gridOrigin,1)||n.aggregation!==r.aggregation){this._updateBinOptions();let{cellSizeCommon:e,cellOriginCommon:t,binIdRange:r}=this.state;a.setProps({binIdRange:r,pointCount:this.getNumInstances(),operations:[n.aggregation],binOptions:{cellSizeCommon:e,cellOriginCommon:t}})}return B_(r.contours,n.contours,2)||this.setState({contourData:null}),t}_updateBinOptions(){let e=this.getBounds(),t=[1,1],n=[0,0],r=[[0,1],[0,1]],i=this.context.viewport;if(e&&Number.isFinite(e[0][0])){let a=[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2],{cellSize:o,gridOrigin:s}=this.props,{unitsPerMeter:c}=i.getDistanceScales(a);t[0]=c[0]*o,t[1]=c[1]*o;let l=i.projectFlat(a);n=[Math.floor((l[0]-s[0])/t[0])*t[0]+s[0],Math.floor((l[1]-s[1])/t[1])*t[1]+s[1]],a=i.unprojectFlat(n);let u=i.constructor;i=i.isGeospatial?new u({longitude:a[0],latitude:a[1],zoom:12}):new vh({position:[a[0],a[1],0],zoom:12}),n=[Math.fround(i.center[0]),Math.fround(i.center[1])],r=B6({dataBounds:e,getBinId:e=>{let r=i.projectFlat(e);return[Math.floor((r[0]-n[0])/t[0]),Math.floor((r[1]-n[1])/t[1])]}})}this.setState({cellSizeCommon:t,cellOriginCommon:n,binIdRange:r,aggregatorViewport:i})}draw(e){e.shaderModuleProps.project&&(e.shaderModuleProps.project.viewport=this.state.aggregatorViewport),super.draw(e)}_onAggregationUpdate(){let{aggregator:e,binIdRange:t}=this.state;this.setState({aggregatedValueReader:Y8({aggregator:e,binIdRange:t,channel:0}),contourData:null})}_getContours(){let{aggregatedValueReader:e}=this.state;if(!e)return null;if(!this.state.contourData){let{binIdRange:t}=this.state,{contours:n}=this.props,r=J8({contours:n,getValue:e,xRange:t[0],yRange:t[1]});this.state.contourData=r}return this.state.contourData}onAttributeChange(e){let{aggregator:t}=this.state;switch(e){case`positions`:t.setNeedsUpdate(),this._updateBinOptions();let{cellSizeCommon:e,cellOriginCommon:n,binIdRange:r}=this.state;t.setProps({binIdRange:r,binOptions:{cellSizeCommon:e,cellOriginCommon:n}});break;case`counts`:t.setNeedsUpdate(0);break;default:}}renderLayers(){let e=this._getContours();if(!e)return null;let{lines:t,polygons:n}=e,{zOffset:r}=this.props,{cellOriginCommon:i,cellSizeCommon:a}=this.state,o=this.getSubLayerClass(`lines`,uF),s=this.getSubLayerClass(`bands`,zF),c=new wu().translate([i[0],i[1],0]).scale([a[0],a[1],r]);return[t&&t.length>0&&new o(this.getSubLayerProps({id:`lines`}),{data:t,coordinateSystem:gp.CARTESIAN,modelMatrix:c,getPath:e=>e.vertices,getColor:e=>e.contour.color??$8,getWidth:e=>e.contour.strokeWidth??e5,widthUnits:`pixels`}),n&&n.length>0&&new s(this.getSubLayerProps({id:`bands`}),{data:n,coordinateSystem:gp.CARTESIAN,modelMatrix:c,getPolygon:e=>e.vertices,getFillColor:e=>e.contour.color??$8})]}getPickingInfo(e){let t=e.info,{object:n}=t;return n&&(t.object={contour:n.contour}),t}};n5.layerName=`ContourLayer`,n5.defaultProps=t5;var r5=`#version 300 es +#define SHADER_NAME grid-cell-layer-vertex-shader +in vec3 positions; +in vec3 normals; +in vec2 instancePositions; +in float instanceElevationValues; +in float instanceColorValues; +in vec3 instancePickingColors; +uniform sampler2D colorRange; +out vec4 vColor; +float interp(float value, vec2 domain, vec2 range) { +float r = min(max((value - domain.x) / (domain.y - domain.x), 0.), 1.); +return mix(range.x, range.y, r); +} +vec4 interp(float value, vec2 domain, sampler2D range) { +float r = (value - domain.x) / (domain.y - domain.x); +return texture(range, vec2(r, 0.5)); +} +void main(void) { +geometry.pickingColor = instancePickingColors; +if (isnan(instanceColorValues) || +instanceColorValues < grid.colorDomain.z || +instanceColorValues > grid.colorDomain.w || +instanceElevationValues < grid.elevationDomain.z || +instanceElevationValues > grid.elevationDomain.w +) { +gl_Position = vec4(0.); +return; +} +vec2 commonPosition = (instancePositions + (positions.xy + 1.0) / 2.0 * column.coverage) * grid.sizeCommon + grid.originCommon - project.commonOrigin.xy; +geometry.position = vec4(commonPosition, 0.0, 1.0); +geometry.normal = project_normal(normals); +float elevation = 0.0; +if (column.extruded) { +elevation = interp(instanceElevationValues, grid.elevationDomain.xy, grid.elevationRange); +elevation = project_size(elevation); +geometry.position.z = (positions.z + 1.0) / 2.0 * elevation; +} +gl_Position = project_common_position_to_clipspace(geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +vColor = interp(instanceColorValues, grid.colorDomain.xy, colorRange); +vColor.a *= layer.opacity; +if (column.extruded) { +vColor.rgb = lighting_getLightColor(vColor.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal); +} +DECKGL_FILTER_COLOR(vColor, geometry); +} +`,i5={name:`grid`,vs:`layout(std140) uniform gridUniforms { + vec4 colorDomain; + vec4 elevationDomain; + vec2 elevationRange; + vec2 originCommon; + vec2 sizeCommon; +} grid; +`,uniformTypes:{colorDomain:`vec4`,elevationDomain:`vec4`,elevationRange:`vec2`,originCommon:`vec2`,sizeCommon:`vec2`}},a5=class extends JP{getShaders(){let e=super.getShaders();return e.modules.push(i5),{...e,vs:r5}}initializeState(){super.initializeState();let e=this.getAttributeManager();e.remove([`instanceElevations`,`instanceFillColors`,`instanceLineColors`,`instanceStrokeWidths`]),e.addInstanced({instancePositions:{size:2,type:`float32`,accessor:`getBin`},instanceColorValues:{size:1,type:`float32`,accessor:`getColorValue`},instanceElevationValues:{size:1,type:`float32`,accessor:`getElevationValue`}})}updateState(e){super.updateState(e);let{props:t,oldProps:n}=e,r=this.state.fillModel;if(n.colorRange!==t.colorRange){this.state.colorTexture?.destroy(),this.state.colorTexture=T6(this.context.device,t.colorRange,t.colorScaleType);let e={colorRange:this.state.colorTexture};r.shaderInputs.setProps({grid:e})}else n.colorScaleType!==t.colorScaleType&&w6(this.state.colorTexture,t.colorScaleType)}finalizeState(e){super.finalizeState(e),this.state.colorTexture?.destroy()}_updateGeometry(){let e=new r_;this.state.fillModel.setGeometry(e)}draw({uniforms:e}){let{cellOriginCommon:t,cellSizeCommon:n,elevationRange:r,elevationScale:i,extruded:a,coverage:o,colorDomain:s,elevationDomain:c}=this.props,l=this.props.colorCutoff||[-1/0,1/0],u=this.props.elevationCutoff||[-1/0,1/0],d=this.state.fillModel,f={colorDomain:[Math.max(s[0],l[0]),Math.min(s[1],l[1]),Math.max(s[0]-1,l[0]),Math.min(s[1]+1,l[1])],elevationDomain:[Math.max(c[0],u[0]),Math.min(c[1],u[1]),Math.max(c[0]-1,u[0]),Math.min(c[1]+1,u[1])],elevationRange:[r[0]*i,r[1]*i],originCommon:t,sizeCommon:n};d.shaderInputs.setProps({column:{extruded:a,coverage:o},grid:f}),d.draw(this.context.renderPass)}};a5.layerName=`GridCellLayer`;var o5={name:`binOptions`,vs:`layout(std140) uniform binOptionsUniforms { + vec2 cellOriginCommon; + vec2 cellSizeCommon; +} binOptions; +`,uniformTypes:{cellOriginCommon:`vec2`,cellSizeCommon:`vec2`}};function s5(){}var c5={gpuAggregation:!0,colorDomain:null,colorRange:x6,getColorValue:{type:`accessor`,value:null},getColorWeight:{type:`accessor`,value:1},colorAggregation:`SUM`,lowerPercentile:{type:`number`,min:0,max:100,value:0},upperPercentile:{type:`number`,min:0,max:100,value:100},colorScaleType:`quantize`,onSetColorDomain:s5,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:`accessor`,value:null},getElevationWeight:{type:`accessor`,value:1},elevationAggregation:`SUM`,elevationScale:{type:`number`,min:0,value:1},elevationLowerPercentile:{type:`number`,min:0,max:100,value:0},elevationUpperPercentile:{type:`number`,min:0,max:100,value:100},elevationScaleType:`linear`,onSetElevationDomain:s5,cellSize:{type:`number`,min:0,value:1e3},coverage:{type:`number`,min:0,max:1,value:1},getPosition:{type:`accessor`,value:e=>e.position},gridAggregator:{type:`function`,optional:!0,value:null},extruded:!1,material:!0},l5=class extends b6{getAggregatorType(){let{gpuAggregation:e,gridAggregator:t,getColorValue:n,getElevationValue:r}=this.props;return e&&(t||n||r)?(fo.warn(`Features not supported by GPU aggregation, falling back to CPU`)(),`cpu`):e&&y6.isSupported(this.context.device)?`gpu`:`cpu`}createAggregator(e){if(e===`cpu`){let{gridAggregator:e,cellSize:t}=this.props;return new o6({dimensions:2,getBin:{sources:[`positions`],getValue:({positions:n},r,i)=>{if(e)return e(n,t);let a=this.state.aggregatorViewport.projectPosition(n),{cellSizeCommon:o,cellOriginCommon:s}=i;return[Math.floor((a[0]-s[0])/o[0]),Math.floor((a[1]-s[1])/o[1])]}},getValue:[{sources:[`colorWeights`],getValue:({colorWeights:e})=>e},{sources:[`elevationWeights`],getValue:({elevationWeights:e})=>e}]})}return new y6(this.context.device,{dimensions:2,channelCount:2,bufferLayout:this.getAttributeManager().getBufferLayouts({isInstanced:!1}),...super.getShaders({modules:[Bp,o5],vs:` + in vec3 positions; + in vec3 positions64Low; + in float colorWeights; + in float elevationWeights; + + void getBin(out ivec2 binId) { + vec3 positionCommon = project_position(positions, positions64Low); + vec2 gridCoords = floor(positionCommon.xy / binOptions.cellSizeCommon); + binId = ivec2(gridCoords); + } + void getValue(out vec2 value) { + value = vec2(colorWeights, elevationWeights); + } + `})})}initializeState(){super.initializeState(),this.getAttributeManager().add({positions:{size:3,accessor:`getPosition`,type:`float64`,fp64:this.use64bitPositions()},colorWeights:{size:1,accessor:`getColorWeight`},elevationWeights:{size:1,accessor:`getElevationWeight`}})}updateState(e){let t=super.updateState(e),{props:n,oldProps:r,changeFlags:i}=e,{aggregator:a}=this.state;if((i.dataChanged||!this.state.dataAsArray)&&(n.getColorValue||n.getElevationValue)&&(this.state.dataAsArray=Array.from(Ty(n.data).iterable)),t||i.dataChanged||n.cellSize!==r.cellSize||n.getColorValue!==r.getColorValue||n.getElevationValue!==r.getElevationValue||n.colorAggregation!==r.colorAggregation||n.elevationAggregation!==r.elevationAggregation){this._updateBinOptions();let{cellSizeCommon:e,cellOriginCommon:t,binIdRange:r,dataAsArray:i}=this.state;if(a.setProps({binIdRange:r,pointCount:this.getNumInstances(),operations:[n.colorAggregation,n.elevationAggregation],binOptions:{cellSizeCommon:e,cellOriginCommon:t},onUpdate:this._onAggregationUpdate.bind(this)}),i){let{getColorValue:e,getElevationValue:t}=this.props;a.setProps({customOperations:[e&&(t=>e(t.map(e=>i[e]),{indices:t,data:n.data})),t&&(e=>t(e.map(e=>i[e]),{indices:e,data:n.data}))]})}}return i.updateTriggersChanged&&i.updateTriggersChanged.getColorValue&&a.setNeedsUpdate(0),i.updateTriggersChanged&&i.updateTriggersChanged.getElevationValue&&a.setNeedsUpdate(1),t}_updateBinOptions(){let e=this.getBounds(),t=[1,1],n=[0,0],r=[[0,1],[0,1]],i=this.context.viewport;if(e&&Number.isFinite(e[0][0])){let a=[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2],{cellSize:o}=this.props,{unitsPerMeter:s}=i.getDistanceScales(a);t[0]=s[0]*o,t[1]=s[1]*o;let c=i.projectFlat(a);n=[Math.floor(c[0]/t[0])*t[0],Math.floor(c[1]/t[1])*t[1]],a=i.unprojectFlat(n);let l=i.constructor;i=i.isGeospatial?new l({longitude:a[0],latitude:a[1],zoom:12}):new vh({position:[a[0],a[1],0],zoom:12}),n=[Math.fround(i.center[0]),Math.fround(i.center[1])],r=B6({dataBounds:e,getBinId:e=>{let r=i.projectFlat(e);return[Math.floor((r[0]-n[0])/t[0]),Math.floor((r[1]-n[1])/t[1])]}})}this.setState({cellSizeCommon:t,cellOriginCommon:n,binIdRange:r,aggregatorViewport:i})}draw(e){e.shaderModuleProps.project&&(e.shaderModuleProps.project.viewport=this.state.aggregatorViewport),super.draw(e)}_onAggregationUpdate({channel:e}){let t=this.getCurrentLayer().props,{aggregator:n}=this.state;if(e===0){let e=n.getResult(0);this.setState({colors:new N6(e,n.binCount)}),t.onSetColorDomain(n.getResultDomain(0))}else if(e===1){let e=n.getResult(1);this.setState({elevations:new N6(e,n.binCount)}),t.onSetElevationDomain(n.getResultDomain(1))}}onAttributeChange(e){let{aggregator:t}=this.state;switch(e){case`positions`:t.setNeedsUpdate(),this._updateBinOptions();let{cellSizeCommon:e,cellOriginCommon:n,binIdRange:r}=this.state;t.setProps({binIdRange:r,binOptions:{cellSizeCommon:e,cellOriginCommon:n}});break;case`colorWeights`:t.setNeedsUpdate(0);break;case`elevationWeights`:t.setNeedsUpdate(1);break;default:}}renderLayers(){let{aggregator:e,cellOriginCommon:t,cellSizeCommon:n}=this.state,{elevationScale:r,colorRange:i,elevationRange:a,extruded:o,coverage:s,material:c,transitions:l,colorScaleType:u,lowerPercentile:d,upperPercentile:f,colorDomain:p,elevationScaleType:m,elevationLowerPercentile:h,elevationUpperPercentile:g,elevationDomain:_}=this.props,v=this.getSubLayerClass(`cells`,a5),y=e.getBins(),b=this.state.colors?.update({scaleType:u,lowerPercentile:d,upperPercentile:f}),x=this.state.elevations?.update({scaleType:m,lowerPercentile:h,upperPercentile:g});return!b||!x?null:new v(this.getSubLayerProps({id:`cells`}),{data:{length:e.binCount,attributes:{getBin:y,getColorValue:b.attribute,getElevationValue:x.attribute}},dataComparator:(e,t)=>e.length===t.length,updateTriggers:{getBin:[y],getColorValue:[b.attribute],getElevationValue:[x.attribute]},cellOriginCommon:t,cellSizeCommon:n,elevationScale:r,colorRange:i,colorScaleType:u,elevationRange:a,extruded:o,coverage:s,material:c,colorDomain:b.domain||p||e.getResultDomain(0),elevationDomain:x.domain||_||e.getResultDomain(1),colorCutoff:b.cutoff,elevationCutoff:x.cutoff,transitions:l&&{getFillColor:l.getColorValue||l.getColorWeight,getElevation:l.getElevationValue||l.getElevationWeight},extensions:[]})}getPickingInfo(e){let t=e.info,{index:n}=t;if(n>=0){let e=this.state.aggregator.getBin(n),r;e&&(r={col:e.id[0],row:e.id[1],colorValue:e.value[0],elevationValue:e.value[1],count:e.count},e.pointIndices&&(r.pointIndices=e.pointIndices,r.points=Array.isArray(this.props.data)?e.pointIndices.map(e=>this.props.data[e]):[])),t.object=r}return t}};l5.layerName=`GridLayer`,l5.defaultProps=c5;function u5(e){let t=e.map(e=>e[0]),n=e.map(e=>e[1]),r=Math.min.apply(null,t),i=Math.max.apply(null,t);return[r,Math.min.apply(null,n),i,Math.max.apply(null,n)]}function d5(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}var f5=new Float32Array(12);function p5(e,t=2){let n=0;for(let r of e)for(let e=0;e 0.) { +maxValue = triangle.colorDomain[1]; +minValue = triangle.colorDomain[0]; +} +vIntensityMax = triangle.intensity / maxValue; +vIntensityMin = triangle.intensity / minValue; +} +`,_5=`#version 300 es +#define SHADER_NAME triangle-layer-fragment-shader +precision highp float; +uniform sampler2D weightsTexture; +uniform sampler2D colorTexture; +in vec2 vTexCoords; +in float vIntensityMin; +in float vIntensityMax; +out vec4 fragColor; +vec4 getLinearColor(float value) { +float factor = clamp(value * vIntensityMax, 0., 1.); +vec4 color = texture(colorTexture, vec2(factor, 0.5)); +color.a *= min(value * vIntensityMin, 1.0); +return color; +} +void main(void) { +vec4 weights = texture(weightsTexture, vTexCoords); +float weight = weights.r; +if (triangle.aggregationMode > 0.5) { +weight /= max(1.0, weights.a); +} +if (weight <= 0.) { +discard; +} +vec4 linearColor = getLinearColor(weight); +linearColor.a *= layer.opacity; +fragColor = linearColor; +} +`,v5=`layout(std140) uniform triangleUniforms { + float aggregationMode; + vec2 colorDomain; + float intensity; + float threshold; +} triangle; +`,y5={name:`triangle`,vs:v5,fs:v5,uniformTypes:{aggregationMode:`f32`,colorDomain:`vec2`,intensity:`f32`,threshold:`f32`}},b5=class extends dx{getShaders(){return super.getShaders({vs:g5,fs:_5,modules:[Bp,y5]})}initializeState({device:e}){this.setState({model:this._getModel(e)})}_getModel(e){let{vertexCount:t,data:n}=this.props;return new Rg(e,{...this.getShaders(),id:this.props.id,attributes:n.attributes,bufferLayout:[{name:`positions`,format:`float32x3`},{name:`texCoords`,format:`float32x2`}],topology:`triangle-strip`,vertexCount:t})}draw(){let{model:e}=this.state,{aggregationMode:t,colorDomain:n,intensity:r,threshold:i,colorTexture:a,maxTexture:o,weightsTexture:s}=this.props,c={aggregationMode:t,colorDomain:n,intensity:r,threshold:i,colorTexture:a,maxTexture:o,weightsTexture:s};e.shaderInputs.setProps({triangle:c}),e.draw(this.context.renderPass)}};b5.layerName=`TriangleLayer`;function x5(e,t){let n={};for(let r in e)t.includes(r)||(n[r]=e[r]);return n}var S5=class extends fx{initializeAggregationLayer(e){super.initializeState(this.context),this.setState({ignoreProps:x5(this.constructor._propTypes,e.data.props),dimensions:e})}updateState(e){super.updateState(e);let{changeFlags:t}=e;if(t.extensionsChanged){let e=this.getShaders({});e&&e.defines&&(e.defines.NON_INSTANCED_MODEL=1),this.updateShaders(e)}this._updateAttributes()}updateAttributes(e){this.setState({changedAttributes:e})}getAttributes(){return this.getAttributeManager().getAttributes()}getModuleSettings(){let{viewport:e,mousePosition:t,device:n}=this.context;return Object.assign(Object.create(this.props),{viewport:e,mousePosition:t,picking:{isActive:0},devicePixelRatio:n.canvasContext.cssToDeviceRatio()})}updateShaders(e){}isAggregationDirty(e,t={}){let{props:n,oldProps:r,changeFlags:i}=e,{compareAll:a=!1,dimension:o}=t,{ignoreProps:s}=this.state,{props:c,accessors:l=[]}=o,{updateTriggersChanged:u}=i;if(i.dataChanged)return!0;if(u){if(u.all)return!0;for(let e of l)if(u[e])return!0}if(a)return i.extensionsChanged?!0:Sb({oldProps:r,newProps:n,ignoreProps:s,propTypes:this.constructor._propTypes});for(let e of c)if(n[e]!==r[e])return!0;return!1}isAttributeChanged(e){let{changedAttributes:t}=this.state;return e?t&&t[e]!==void 0:!C5(t)}_getAttributeManager(){return new db(this.context.device,{id:this.props.id,stats:this.context.stats})}};S5.layerName=`AggregationLayer`;function C5(e){let t=!0;for(let n in e){t=!1;break}return t}var w5=`#version 300 es +in vec3 positions; +in vec3 positions64Low; +in float weights; +out vec4 weightsTexture; +void main() +{ +weightsTexture = vec4(weights * weight.weightsScale, 0., 0., 1.); +float radiusTexels = project_pixel_size(weight.radiusPixels) * weight.textureWidth / (weight.commonBounds.z - weight.commonBounds.x); +gl_PointSize = radiusTexels * 2.; +vec3 commonPosition = project_position(positions, positions64Low); +gl_Position.xy = (commonPosition.xy - weight.commonBounds.xy) / (weight.commonBounds.zw - weight.commonBounds.xy) ; +gl_Position.xy = (gl_Position.xy * 2.) - (1.); +gl_Position.w = 1.0; +} +`,T5=`#version 300 es +in vec4 weightsTexture; +out vec4 fragColor; +float gaussianKDE(float u){ +return pow(2.71828, -u*u/0.05555)/(1.77245385*0.166666); +} +void main() +{ +float dist = length(gl_PointCoord - vec2(0.5, 0.5)); +if (dist > 0.5) { +discard; +} +fragColor = weightsTexture * gaussianKDE(2. * dist); +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,E5=`#version 300 es +uniform sampler2D inTexture; +out vec4 outTexture; +void main() +{ +int yIndex = gl_VertexID / int(maxWeight.textureSize); +int xIndex = gl_VertexID - (yIndex * int(maxWeight.textureSize)); +vec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / maxWeight.textureSize; +outTexture = texture(inTexture, uv); +gl_Position = vec4(0.0, 0.0, 0.0, 1.0); +gl_PointSize = 1.0; +} +`,D5=`#version 300 es +in vec4 outTexture; +out vec4 fragColor; +void main() { +fragColor = outTexture; +fragColor.g = outTexture.r / max(1.0, outTexture.a); +} +`,O5={name:`weight`,vs:`layout(std140) uniform weightUniforms { + vec4 commonBounds; + float radiusPixels; + float textureWidth; + float weightsScale; +} weight; +`,uniformTypes:{commonBounds:`vec4`,radiusPixels:`f32`,textureWidth:`f32`,weightsScale:`f32`}},k5={name:`maxWeight`,vs:`layout(std140) uniform maxWeightUniforms { + float textureSize; +} maxWeight; +`,uniformTypes:{textureSize:`f32`}},A5=2,j5={format:`rgba8unorm`,dimension:`2d`,width:1,height:1,sampler:{minFilter:`linear`,magFilter:`linear`,addressModeU:`clamp-to-edge`,addressModeV:`clamp-to-edge`}},M5=[0,0],N5={SUM:0,MEAN:1},P5={getPosition:{type:`accessor`,value:e=>e.position},getWeight:{type:`accessor`,value:1},intensity:{type:`number`,min:0,value:1},radiusPixels:{type:`number`,min:1,max:100,value:50},colorRange:x6,threshold:{type:`number`,min:0,max:1,value:.05},colorDomain:{type:`array`,value:null,optional:!0},aggregation:`SUM`,weightsTextureSize:{type:`number`,min:128,max:2048,value:2048},debounceTimeout:{type:`number`,min:0,max:1e3,value:500}},F5=[`float32-renderable-webgl`,`texture-blend-float-webgl`],I5={data:{props:[`radiusPixels`]}},L5=class extends S5{getShaders(e){let t=[Bp];return e.modules&&(t=[...t,...e.modules]),super.getShaders({...e,modules:t})}initializeState(){super.initializeAggregationLayer(I5),this.setState({colorDomain:M5}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState(e){super.updateState(e),this._updateHeatmapState(e)}_updateHeatmapState(e){let{props:t,oldProps:n}=e,r=this._getChangeFlags(e);if((r.dataChanged||r.viewportChanged)&&(r.boundsChanged=this._updateBounds(r.dataChanged),this._updateTextureRenderingBounds()),r.dataChanged||r.boundsChanged){if(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0}),r.dataChanged){let e=this.getShaders({vs:w5,fs:T5});this._createWeightsTransform(e)}}else r.viewportZoomChanged&&this._debouncedUpdateWeightmap();t.colorRange!==n.colorRange&&this._updateColorTexture(e),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:e.context.viewport.zoom})}renderLayers(){let{weightsTexture:e,triPositionBuffer:t,triTexCoordBuffer:n,maxWeightsTexture:r,colorTexture:i,colorDomain:a}=this.state,{updateTriggers:o,intensity:s,threshold:c,aggregation:l}=this.props;return new(this.getSubLayerClass(`triangle`,b5))(this.getSubLayerProps({id:`triangle-layer`,updateTriggers:o}),{coordinateSystem:`default`,data:{attributes:{positions:t,texCoords:n}},vertexCount:4,maxTexture:r,colorTexture:i,aggregationMode:N5[l]||0,weightsTexture:e,intensity:s,threshold:c,colorDomain:a})}finalizeState(e){super.finalizeState(e);let{weightsTransform:t,weightsTexture:n,maxWeightTransform:r,maxWeightsTexture:i,triPositionBuffer:a,triTexCoordBuffer:o,colorTexture:s,updateTimer:c}=this.state;t?.destroy(),n?.destroy(),r?.destroy(),i?.destroy(),a?.destroy(),o?.destroy(),s?.destroy(),c&&clearTimeout(c)}_getAttributeManager(){return new db(this.context.device,{id:this.props.id,stats:this.context.stats})}_getChangeFlags(e){let t={},{dimensions:n}=this.state;t.dataChanged=this.isAttributeChanged()&&`attribute changed`||this.isAggregationDirty(e,{compareAll:!0,dimension:n.data})&&`aggregation is dirty`,t.viewportChanged=e.changeFlags.viewportChanged;let{zoom:r}=this.state;return(!e.context.viewport||e.context.viewport.zoom!==r)&&(t.viewportZoomChanged=!0),t}_createTextures(){let{textureSize:e,format:t}=this.state;this.setState({weightsTexture:this.context.device.createTexture({...j5,width:e,height:e,format:t}),maxWeightsTexture:this.context.device.createTexture({...j5,width:1,height:1,format:t})})}_setupAttributes(){this.getAttributeManager().add({positions:{size:3,type:`float64`,accessor:`getPosition`},weights:{size:1,accessor:`getWeight`}}),this.setState({positionAttributeName:`positions`})}_setupTextureParams(){let{device:e}=this.context,{weightsTextureSize:t}=this.props,n=Math.min(t,e.limits.maxTextureDimension2D),r=F5.every(t=>e.features.has(t)),i=r?`rgba32float`:`rgba8unorm`,a=r?1:1/255;this.setState({textureSize:n,format:i,weightsScale:a}),r||fo.warn(`HeatmapLayer: ${this.id} rendering to float texture not supported, falling back to low precision format`)()}_createWeightsTransform(e){let{weightsTransform:t}=this.state,{weightsTexture:n}=this.state,r=this.getAttributeManager();t?.destroy(),t=new qg(this.context.device,{id:`${this.id}-weights-transform`,...e,bufferLayout:r.getBufferLayouts(),vertexCount:1,targetTexture:n,parameters:{depthWriteEnabled:!1,blend:!0,blendColorOperation:`add`,blendColorSrcFactor:`one`,blendColorDstFactor:`one`,blendAlphaSrcFactor:`one`,blendAlphaDstFactor:`one`},topology:`point-list`,modules:[...e.modules,O5]}),this.setState({weightsTransform:t})}_setupResources(){this._createTextures();let{device:e}=this.context,{textureSize:t,weightsTexture:n,maxWeightsTexture:r}=this.state,i=this.getShaders({vs:w5,fs:T5});this._createWeightsTransform(i);let a=this.getShaders({vs:E5,fs:D5,modules:[k5]}),o=new qg(e,{id:`${this.id}-max-weights-transform`,targetTexture:r,...a,vertexCount:t*t,topology:`point-list`,parameters:{depthWriteEnabled:!1,blend:!0,blendColorOperation:`max`,blendAlphaOperation:`max`,blendColorSrcFactor:`one`,blendColorDstFactor:`one`,blendAlphaSrcFactor:`one`,blendAlphaDstFactor:`one`}}),s={inTexture:n,textureSize:t};o.model.shaderInputs.setProps({maxWeight:s}),this.setState({weightsTexture:n,maxWeightsTexture:r,maxWeightTransform:o,zoom:null,triPositionBuffer:e.createBuffer({byteLength:48}),triTexCoordBuffer:e.createBuffer({byteLength:48})})}updateShaders(e){this._createWeightsTransform({vs:w5,fs:T5,...e})}_updateMaxWeightValue(){let{maxWeightTransform:e}=this.state;e.run({parameters:{viewport:[0,0,1,1]},clearColor:[0,0,0,0]})}_updateBounds(e=!1){let{viewport:t}=this.context,n=[t.unproject([0,0]),t.unproject([t.width,0]),t.unproject([0,t.height]),t.unproject([t.width,t.height])].map(e=>e.map(Math.fround)),r=u5(n),i={visibleWorldBounds:r,viewportCorners:n},a=!1;if(e||!this.state.worldBounds||!d5(this.state.worldBounds,r)){let e=this._worldToCommonBounds(r),t=this._commonToWorldBounds(e);this.props.coordinateSystem===`lnglat`&&(t[1]=Math.max(t[1],-85.051129),t[3]=Math.min(t[3],85.051129),t[0]=Math.max(t[0],-360),t[2]=Math.min(t[2],360));let n=this._worldToCommonBounds(t);i.worldBounds=t,i.normalizedCommonBounds=n,a=!0}return this.setState(i),a}_updateTextureRenderingBounds(){let{triPositionBuffer:e,triTexCoordBuffer:t,normalizedCommonBounds:n,viewportCorners:r}=this.state,{viewport:i}=this.context;e.write(p5(r,3));let a=r.map(e=>h5(i.projectPosition(e),n));t.write(p5(a,2))}_updateColorTexture(e){let{colorRange:t}=e.props,{colorTexture:n}=this.state,r=S6(t,!1,Uint8Array);n?.destroy(),n=this.context.device.createTexture({...j5,data:r,width:t.length,height:1}),this.setState({colorTexture:n})}_updateWeightmap(){let{radiusPixels:e,colorDomain:t,aggregation:n}=this.props,{worldBounds:r,textureSize:i,weightsScale:a,weightsTexture:o}=this.state,s=this.state.weightsTransform;this.state.isWeightMapDirty=!1;let c=this._worldToCommonBounds(r,{useLayerCoordinateSystem:!0});if(t&&n===`SUM`){let{viewport:e}=this.context,n=e.distanceScales.metersPerUnit[2]*(c[2]-c[0])/i;this.state.colorDomain=[t[0]*n*a,t[1]*n*a]}else this.state.colorDomain=t||M5;let l=this.getAttributeManager().getAttributes(),u=this.getModuleSettings();this._setModelAttributes(s.model,l),s.model.setVertexCount(this.getNumInstances());let d={radiusPixels:e,commonBounds:c,textureWidth:i,weightsScale:a,weightsTexture:o},{viewport:f,devicePixelRatio:p,coordinateSystem:m,coordinateOrigin:h}=u,{modelMatrix:g}=this.props;s.model.shaderInputs.setProps({project:{viewport:f,devicePixelRatio:p,modelMatrix:g,coordinateSystem:m,coordinateOrigin:h},weight:d}),s.run({parameters:{viewport:[0,0,i,i]},clearColor:[0,0,0,0]}),this._updateMaxWeightValue()}_debouncedUpdateWeightmap(e=!1){let{updateTimer:t}=this.state,{debounceTimeout:n}=this.props;e?(t=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(t),t=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),n)),this.setState({updateTimer:t})}_worldToCommonBounds(e,t={}){let{useLayerCoordinateSystem:n=!1}=t,[r,i,a,o]=e,{viewport:s}=this.context,{textureSize:c}=this.state,{coordinateSystem:l}=this.props,u=n&&(l===`lnglat-offsets`||l===`meter-offsets`),d=u?s.projectPosition(this.props.coordinateOrigin):[0,0],f=c*A5/s.scale,p,m;return n&&!u?(p=this.projectPosition([r,i,0]),m=this.projectPosition([a,o,0])):(p=s.projectPosition([r,i,0]),m=s.projectPosition([a,o,0])),m5([p[0]-d[0],p[1]-d[1],m[0]-d[0],m[1]-d[1]],f,f)}_commonToWorldBounds(e){let[t,n,r,i]=e,{viewport:a}=this.context,o=a.unprojectPosition([t,n]),s=a.unprojectPosition([r,i]);return o.slice(0,2).concat(s.slice(0,2))}};L5.layerName=`HeatmapLayer`,L5.defaultProps=P5;var R5=n({CPUAggregator:()=>o6,ContourLayer:()=>n5,GridLayer:()=>l5,HeatmapLayer:()=>L5,HexagonLayer:()=>e8,ScreenGridLayer:()=>M6,WebGLAggregator:()=>y6,_AggregationLayer:()=>b6});Math.PI/180,180/Math.PI;var z5=[6148914691236517205n,3689348814741910323n,1085102592571150095n,71777214294589695n,281470681808895n,4294967295n],B5=[0n,1n,2n,4n,8n,16n];function V5(e){return BigInt(`0x${e}`)}function H5(e){return e.toString(16)}function U5(e){if(e.z<0||e.z>26)throw Error(`Wrong zoom`);let t=BigInt(e.z),n=BigInt(e.x)<<32n-t,r=BigInt(e.y)<<32n-t;for(let e=0;e<5;e++){let t=B5[5-e],i=z5[4-e];n=(n|n<>12n|4503599627370495n>>t*2n}function W5(e){let t=e>>59n&7n,n=e>>57n&3n,r=e>>52n&31n,i=(e&4503599627370495n)<<12n;if(t!==1n&&n!==0n)throw Error(`Wrong mode`);let a=i,o=i>>1n;for(let e=0;e<6;e++){let t=B5[e],n=z5[e];a=(a|a>>t)&n,o=(o|o>>t)&n}return a>>=32n-r,o>>=32n-r,{z:Number(r),x:Number(a),y:Number(o)}}function G5(e){return e>>52n&31n}function K5(e){let t=G5(e)-1n;return e&~(31n<<52n)|t<<52n|4503599627370495n>>t*2n}function q5(e,t){fo.assert(e,t)}function J5(e,t){let{properties:n,numericProps:r}=e;return new Proxy(n[t]||{},{get(e,n){return n in r?r[n].value[t]:e[n]},has(e,t){return t in r||t in e},ownKeys(e){return[...Object.keys(r),...Reflect.ownKeys(e)]},getOwnPropertyDescriptor(e,t){return{enumerable:!0,configurable:!0}}})}function Y5(e,t){return`https://unpkg.com/@deck.gl/carto@${t}/dist/${e}-worker.js`}var X5=new Uint16Array,Z5={positions:{value:new Float32Array,size:2},properties:[],numericProps:{},featureIds:{value:X5,size:1},globalFeatureIds:{value:X5,size:1}};function Q5(){return{shape:`binary-feature-collection`,points:{type:`Point`,...Z5},lines:{type:`LineString`,pathIndices:{value:X5,size:1},...Z5},polygons:{type:`Polygon`,polygonIndices:{value:X5,size:1},primitivePolygonIndices:{value:X5,size:1},...Z5}}}function $5(e,t,n,r,i,a=2){return{type:`Point`,positions:{value:new Float32Array(e),size:a},featureIds:{value:new Uint16Array(t),size:1},globalFeatureIds:{value:new Uint32Array(n),size:1},numericProps:r,properties:i}}function e7(e,t){let n={};return t&&Object.keys(t).forEach(t=>{n[t]={value:new Float32Array(e),size:1}}),n}function t7(e,t,n,r){Object.keys(e).forEach(i=>{t[i].value[r]=e[i].value[n]})}function n7(e,t,n,r=[],i,a,o=`quadbin`){if(!e.content)return!1;e.userData||={};let s=t.get(n)?.[0];if(s){if(r.every(e=>e.name in s))return!1;t.clear()}let c={};for(let t of e.content){let e=t.id,s=typeof i==`function`?i(t,{}):i;for(let t=0;t({q:e,i:H5(e)}))}getTileId({q:e,i:t}){return t||H5(e)}getTileMetadata({q:e}){return super.getTileMetadata(W5(e))}getTileZoom({q:e}){return Number(G5(e))}getParentIndex({q:e}){return{q:K5(e)}}},s7=85.051128;function c7({west:e,north:t,east:n,south:r},i,a=1){let o=[[t,n],[r,n],[r,e],[t,e]].map(e=>CW(e[0],e[1],i)).map(e=>Math.max(...AW(e).map(e=>MW(e,ZU.rads)))*180/Math.PI),s=Math.max(...o)*a,c=Math.min(180,s/Math.cos((t+r)/2*Math.PI/180));return{north:Math.min(t+s,s7),east:n+c,south:Math.max(r-s,-85.051128),west:e-c}}function l7({west:e,north:t,east:n,south:r},i){let a=Math.abs(n-e);if(a>180){let o=Math.ceil(a/180),s=[];for(let a=0;ae[0]),r=t.map(e=>e[1]);return c7({west:Math.min(...r),south:Math.min(...n),east:Math.max(...r),north:Math.max(...n)},SW(e),.12)}var d7=2;function f7(e,t){let n=Math.log2(t/512),r=2/3*(e.zoom-n),i=Math.log(1/Math.cos(Math.PI*e.latitude/180));return Math.max(0,Math.floor(r+i-d7))}var p7=class extends _Y{getTileIndices({viewport:e,minZoom:t,maxZoom:n}){if(e.latitude===void 0)return[];let[r,i,a,o]=e.getBounds(),{tileSize:s}=this.opts,c=f7(e,s),l;return typeof t==`number`&&Number.isFinite(t)&&cn?(c=n,l=DW(CW(e.latitude,e.longitude,n),1)):l=l7(c7({west:r,north:o,east:a,south:i},c),c),l.map(e=>({i:e})))}getTileId({i:e}){return e}getTileMetadata({i:e}){return{bbox:u7(e)}}getTileZoom({i:e}){return SW(e)}getParentIndex(e){let t=SW(e.i);return{i:EW(e.i,t-1)}}},m7=512;function h7(e){let{x:t,y:n,z:r}=W5(e),i=m7/(1<R7(e,t),parseSync:R7,worker:!0,options:{cartoSpatialTile:{scheme:`quadbin`,workerUrl:Y5(I7,F7)}}};function R7(e,t){if(!e)return null;let{cells:n}=N7(e,M7);return P7({cells:n,scheme:t?.cartoSpatialTile?.scheme})}function z7(e,t,n=0){if(!e)return t;if(!t)return e;if(n>10)return t;let r={...e};for(let i in t){let a=t[i];a===e||a===t||(typeof a==`object`&&a?r[i]=z7(e[i],a,n+1):r[i]=a)}return r}function bte(e,t){let n={};for(let{geoid:e,...r}of t.properties)e in n?fo.warn(`Duplicate geoid key in boundary mapping, using first occurance`)():n[e]=r;for(let r of[`points`,`lines`,`polygons`]){let i=e[r];if(i.positions.value.length===0)continue;i.properties=i.properties.map(({geoid:e})=>n[e]);let{positions:a,globalFeatureIds:o}=i,s=null;r===`lines`&&(s=i.pathIndices.value),r===`polygons`&&(s=i.polygonIndices.value);let c=a.value.length/a.size;for(let e in t.numericProps){let n=t.numericProps[e].value,r=n.constructor,a=new r(c);if(i.numericProps[e]={value:a,size:1},s)for(let e=0;et.optional&&e===null||typeof e==`object`&&Array.isArray(e.tiles)&&e.tiles.every(e=>typeof e==`string`),equal:(e,t)=>B_(e,t,2),async:!0};ei([L7]);function V7(e){if(e===p7)return`h3`;if(e===o7)return`quadbin`;throw Error(`Invalid tileset class`)}var H7={data:B7,clusterLevel:{type:`number`,value:5,min:1},getPosition:{type:`accessor`,value:({id:e})=>{if(typeof e==`string`){let[t,n]=wW(e);return[n,t]}return _7(e,.5).slice(2,4)}},getWeight:{type:`accessor`,value:1},refinementStrategy:`no-overlap`,tileSize:512},U7=class extends CY{initializeState(){super.initializeState(),this.state.aggregationCache=new WeakMap,this.state.scheme=V7(this.props.TilesetClass)}updateState(e){let{props:t}=e,n=V7(t.TilesetClass);this.state.scheme!==n&&(this.setState({scheme:n,tileset:null}),this.state.aggregationCache=new WeakMap),super.updateState(e)}renderLayers(){let e=this.state.tileset?.tiles.filter(e=>e.isLoaded&&e.content&&this.state.tileset.isTileVisible(e));if(!e?.length||!this.state.tileset)return null;e.sort((e,t)=>t.zoom-e.zoom);let{getPosition:t,getWeight:n}=this.props,{aggregationCache:r,scheme:i}=this.state,a=i===`h3`,o=r7(e[0]),s=[],c=!1,l=this._getAggregationLevels(e);for(let i of e){let e=r.get(i.content);e||(e=new Map,r.set(i.content,e));let u=n7(i,e,l,o,t,n,a?`h3`:`quadbin`);c||=u,s.push(...e.get(l))}s.sort((e,t)=>Number(t.count-e.count));let u=s?.map(e=>e.id);if(c||=!B_(u,this.state.clusterIds,1),this.setState({clusterIds:u}),c){let e=i7(s,o),t=a7(s);t.points.attributes={stats:e},this.setState({data:t})}let d={...this.props,id:`clusters`,data:this.state.data,dataComparator:(e,t)=>{let n=e?.points?.properties?.map(e=>e.id),r=t?.points?.properties?.map(e=>e.id);return B_(n,r,1)}};return new aL(this.getSubLayerProps(d))}getPickingInfo(e){let t=e.info;if(t.index!==-1){let{data:n}=e.sourceLayer.props;t.object=J4(n,{globalFeatureId:t.index})}return t}_updateAutoHighlight(e){for(let t of this.getSubLayers())t.updateAutoHighlight(e)}filterSubLayer(){return!0}_getAggregationLevels(e){let t=this.state.scheme===`h3`,n=e[0],r,i;t?(r=SW(n.id),i=f7(this.context.viewport,this.state.tileset.opts.tileSize)):(r=n.zoom,i=this.context.viewport.zoom);let a=Math.round(i-r);return Math.round(this.props.clusterLevel)-a}};U7.layerName=`ClusterGeoJsonLayer`,U7.defaultProps=H7;var W7=class extends fx{getLoadOptions(){let e=this.props.data,t=e&&`scheme`in e?e.scheme:`quadbin`;return z7(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${e.accessToken}`}},cartoSpatialTile:{scheme:t}})}renderLayers(){let e=this.props.data;if(!e)return null;let{tiles:t,maxresolution:n}=e,r=e&&`scheme`in e&&e.scheme===`h3`?p7:o7;return[new U7(this.props,{id:`cluster-geojson-layer-${this.props.id}`,data:t,TilesetClass:r,maxZoom:n,loadOptions:this.getLoadOptions()})]}};W7.layerName=`ClusterTileLayer`,W7.defaultProps=H7,ei([L7]);function xte(e){return e!=null&&e!==``}var Ste={tileSize:512},G7=class extends CY{_updateAutoHighlight(e){let{hoveredFeatureId:t}=this.state,n=e.object,r=null;if(n&&(r=n.id),t!==r){let{highlightColor:t}=this.props;typeof t==`function`&&(t=t(e)),this.setState({highlightColor:t,hoveredFeatureId:r})}}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){let{hoveredFeatureId:t}=this.state,n=e.content;return!xte(t)||!Array.isArray(n)||!this._featureInTile(e,t)?-1:n.findIndex(e=>e.id===t)}_featureInTile(e,t){let n=this.state.tileset,r=n.getTileZoom(e.index),i=e.index.q?`q`:`i`,a={[i]:t},o=n.getTileZoom(a);for(;!(o<=r);)a=n.getParentIndex(a),o=n.getTileZoom(a);return a[i]===e.index[i]}};G7.layerName=`SpatialIndexTileLayer`,G7.defaultProps=Ste;var Cte=e=>{let{data:t}=e,{index:n}=e.tile;return!t||!t.length?null:new jY(e,{getHexagon:e=>e.id,centerHexagon:n,highPrecision:!0})},wte={data:B7,tileSize:512},K7=class extends fx{initializeState(){jY._checkH3Lib()}getLoadOptions(){let e=this.props.data;return z7(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${e.accessToken}`}},cartoSpatialTile:{scheme:`h3`}})}renderLayers(){let e=this.props.data;if(!e)return null;let{tiles:t}=e,{minresolution:n,maxresolution:r}=e;return this.props.minZoom&&(n=Math.max(n,f7({zoom:this.props.minZoom,latitude:0},this.props.tileSize))),this.props.maxZoom&&(r=Math.min(r,f7({zoom:this.props.maxZoom,latitude:0},this.props.tileSize))),new(this.getSubLayerClass(`spatial-index-tile`,G7))(this.props,{id:`h3-tile-layer-${this.props.id}`,data:t,TilesetClass:p7,renderSubLayers:Cte,minZoom:n,maxZoom:r,loadOptions:this.getLoadOptions()})}};K7.layerName=`H3TileLayer`,K7.defaultProps=wte;var q7={name:`heatmap`,uniformPropTypes:{colorDomain:{value:[0,1]},delta:{value:[0,1]},intensity:{value:1,min:.1,max:10},opacity:{value:1,min:0,max:1},radiusPixels:{value:20,min:0,softMax:100}},uniformTypes:{colorDomain:`vec2`,delta:`vec2`,intensity:`f32`,opacity:`f32`,radiusPixels:`f32`},getUniforms:e=>{if(!e)return{};let{colorDomain:t=[0,1],colorTexture:n,delta:r=[1,0],intensity:i=1,opacity:a=1,radiusPixels:o=20}=e;return{colorDomain:t,colorTexture:n,delta:r,intensity:i,opacity:a,radiusPixels:o}},fs:`layout(std140) uniform heatmapUniforms { + vec2 colorDomain; + vec2 delta; + float intensity; + float opacity; + float radiusPixels; +} heatmap; + +uniform sampler2D colorTexture; + +vec3 colorGradient(float value) { + return texture(colorTexture, vec2(value, 0.5)).rgb; +} + +const vec3 SHIFT = vec3(1.0, 256.0, 256.0 * 256.0); +const float MAX_VAL = SHIFT.z * 255.0; +const float SCALE = MAX_VAL / 8.0; +vec4 pack(float value) { + return vec4(mod(vec3(value, floor(value / SHIFT.yz)), 256.0), 255.0) / 255.0; +} +float unpack(vec3 color) { + return 255.0 * dot(color, SHIFT); +} + +vec4 heatmap_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) { + bool firstPass = (heatmap.delta.y < 0.5); + float accumulator = 0.0; + + // Controls quality of heatmap, larger values increase quality at expense of performance + float SUPPORT = clamp(heatmap.radiusPixels / 2.0, 8.0, 32.0); + + // Gaussian normalization parameters + float sigma = SUPPORT / 3.0; + float a = -0.5 / (sigma * sigma); + float w0 = 0.3989422804014327 / sigma; // 1D normalization + for (float t = -SUPPORT; t <= SUPPORT; t++) { + vec2 percent = (t * heatmap.delta - 0.5) / SUPPORT; + vec2 delta = percent * heatmap.radiusPixels / texSize; + vec4 offsetColor = texture(source, texCoord + delta); + + // Unpack float + float value = unpack(offsetColor.rgb); + + // Gaussian + float weight = w0 * exp(a * t * t); + + accumulator += value * weight; + } + + if (firstPass) { + return pack(accumulator); + } + + // Undo scaling to obtain normalized density + float density = 10.0 * heatmap.intensity * accumulator / SCALE; + + // Domain also in normalized density units + vec2 domain = heatmap.colorDomain; + + // Apply domain + float f = (density - domain[0]) / (domain[1] - domain[0]); + + // sqrt/log scaling?? + // float f = (log(density) - log(domain[0] + 1.0)) / (log(domain[1] + 1.0) - log(domain[0] + 1.0)); + // f = sqrt(f); + + // Color map + vec4 color = vec4(0.0); + color.rgb = colorGradient(f); + + color.a = smoothstep(0.0, 0.1, f); + color.a = pow(color.a, 1.0 / 2.2); + color.a *= heatmap.opacity; + + // Use premultiplied alpha for compatibility with blending in ScreenPass + color.rgb *= color.a; + + return color; +} +`,passes:[{sampler:!0,uniforms:{delta:[1,0]}},{sampler:!0,uniforms:{delta:[0,1]}}]},Tte={format:`rgba8unorm`,width:1,height:1,sampler:{minFilter:`linear`,magFilter:`linear`,addressModeU:`clamp-to-edge`,addressModeV:`clamp-to-edge`}};function J7(e){for(;e.parent&&!e.applyPostProcess;)e=e.parent;return e}var Y7=class extends dx{initializeState(){this.id=`draw-callback-${J7(this).props.id}`}_drawLayer(){J7(this).applyPostProcess()}};Y7.layerName=`DrawCallbackLayer`;function X7(e){var t;return t=class extends e{draw(e){let{shaderModuleProps:t}=e,{picking:n}=t,r=J7(this),i=!n.isActive&&r.enableRTT;i&&r.enableRTT(e),super.draw(e),i&&r.disableRTT()}},t.layerName=`RTT-${e.layerName}`,t}function Z7(e,t){var n;return n=class extends e{initializeState(e){super.initializeState(e),this._createTextures(),this.internalState.postProcess=new h_(t,this.props),this.internalState.postProcess.setup(e)}updateState(e){super.updateState(e),this.internalState.postProcess.setProps(this.props)}renderLayers(){let e=super.renderLayers();return e?(e=Array.isArray(e)?e:[e],[...e,new Y7]):null}_createTextures(){let{device:e}=this.context;this.internalState.renderBuffers=[0,1].map(t=>e.createFramebuffer({id:`layer-fbo-${t}`,colorAttachments:[e.createTexture(Tte)],depthStencilAttachment:`depth16unorm`}))}_resizeBuffers(e){let{shaderModuleProps:t}=e,{viewport:n}=this.context,{devicePixelRatio:r}=t.project,i=r*n.width,a=r*n.height;this.internalState.renderBuffers.forEach(e=>e.resize({width:i,height:a}))}enableRTT(e){this._resizeBuffers(e),this.internalState.originalRenderPass=this.context.renderPass;let[t]=this.internalState.renderBuffers;this.internalState.internalRenderPass=this.context.device.beginRenderPass({framebuffer:t,parameters:{viewport:[0,0,t.width,t.height]},clearColor:!this.internalState.renderInProgress&&[0,0,0,0]}),this.internalState.renderInProgress=!0,this.context.renderPass=this.internalState.internalRenderPass}disableRTT(){this.internalState.internalRenderPass.end(),this.context.renderPass=this.internalState.originalRenderPass}applyPostProcess(){if(!this.internalState.renderInProgress)return;let[e,t]=this.internalState.renderBuffers,{framebuffer:n}=this.context.renderPass.props;this.internalState.postProcess.postRender({inputBuffer:e,swapBuffer:t,target:n}),this.internalState.renderInProgress=!1}_finalize(){this.internalState.renderBuffers.forEach(e=>{e.destroy()}),this.internalState.renderBuffers=null,this.internalState.postProcess.cleanup()}},n.layerName=`PostProcess${e.layerName}`,n}var Ete={name:`copy`,fs:`vec4 copy_filterColor_ext(vec4 color, vec2 texSize, vec2 texCoord) { + return color; +} +`,getUniforms:()=>({}),passes:[{filter:!0}]},Dte={getQuadbin:{type:`accessor`,value:e=>e.quadbin}},Q7=class extends cL{indexToBounds(){let{data:e,extruded:t,getQuadbin:n}=this.props,r=t?.99:1;return{data:e,_normalize:!1,positionFormat:`XY`,getPolygon:(e,t)=>_7(n(e,t),r),updateTriggers:{getPolygon:r}}}};Q7.layerName=`QuadbinLayer`,Q7.defaultProps=Dte;var Ote=e=>{let{data:t}=e;return!t||!t.length?null:new Q7(e,{getQuadbin:typeof t[0].id==`bigint`?e=>e.id:e=>V5(e.id)})},kte={data:B7,tileSize:512},$7=class extends fx{getLoadOptions(){let e=this.props.data;return z7(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${e.accessToken}`}},cartoSpatialTile:{scheme:`quadbin`}})}renderLayers(){let e=this.props.data;if(!e)return null;let{tiles:t,maxresolution:n}=e;return new(this.getSubLayerClass(`spatial-index-tile`,G7))(this.props,{id:`quadbin-tile-layer-${this.props.id}`,data:t,TilesetClass:o7,renderSubLayers:Ote,maxZoom:n,loadOptions:this.getLoadOptions()})}};$7.layerName=`QuadbinTileLayer`,$7.defaultProps=kte;var Ate=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]],jte={format:`rgba8unorm`,dimension:`2d`,width:1,height:1,sampler:{minFilter:`linear`,magFilter:`linear`,addressModeU:`clamp-to-edge`,addressModeV:`clamp-to-edge`}};function e9(e){return 4**Number(G5(e))}function t9(e){return PW(Number(SW(e)))}function Mte(e){let t=new Uint8Array(e.length*4),n=0;for(let r=0;re.content),v=_.filter(e=>e.isVisible),y=v.length?v:_;for(let e of y){let t=e.content[0],n=f?t9(t.id):e9(t.id);g=Math.max(e.userData.maxWeight*n,g),h=Math.max(e.zoom,h)}let b,x;return f?(b=2/3*this.context.viewport.zoom-h-2.25,x=2.2):(b=this.context.viewport.zoom-h,x=2),g*=x**+b,typeof s==`function`&&s(g),new(f?Fte:Pte)(d,this.getSubLayerProps({id:`heatmap`,data:e,getFillColor:0,getElevation:t,elevationScale:g,colorDomain:n,radiusPixels:i,intensity:r,_subLayerProps:m,refinementStrategy:`no-overlap`,colorTexture:this.state.colorTexture,extruded:!1,stroked:!1,updateTriggers:{getElevation:o.getWeight},onViewportLoad:e=>{this.setState({isLoaded:!0}),typeof c==`function`&&c(e)},onTileLoad:e=>{let n=-1/0;if(typeof t!=`function`)n=t;else if(e.content)for(let r of e.content)n=Math.max(t(r,{}),n);e.userData={maxWeight:n},this.state.tiles.add(e),typeof l==`function`&&l(e)},onTileUnload:e=>{this.state.tiles.delete(e),typeof u==`function`&&u(e)},transitions:{elevationScale:{type:`spring`,stiffness:.3,damping:.5}}}))}_updateColorTexture(e){let{colorRange:t}=e.props,{colorTexture:n}=this.state,r=Mte(t);n?.destroy(),n=this.context.device.createTexture({...jte,data:r,width:t.length,height:1}),this.setState({colorTexture:n})}};r9.layerName=`HeatmapTileLayer`,r9.defaultProps=Ite;var[i9,a9,o9,s9]=[0,1,2,3],c9=class extends LI{getShaders(){let e=super.getShaders(),t=e.vs;return t=t.replaceAll(`textBackground.padding.`,`_padding.`),t=t.replace(`void main(void) {`,`void main(void) { + vec4 _padding = textBackground.padding + instancePixelOffsets.xyxy * vec4(1.0, 1.0, -1.0, -1.0);`),{...e,vs:t}}};c9.layerName=`EnhancedTextBackgroundLayer`;var l9=class extends HI{filterSubLayer({layer:e,renderPass:t}){let n=e.id.includes(`primary-background`);return t===`collision`?n:!n}};l9.layerName=`EnhancedTextLayer`;var Lte={...HI.defaultProps,getRadius:{type:`accessor`,value:1},radiusScale:{type:`number`,min:0,value:1}},u9=class extends fx{calculatePixelOffset(e){let{getTextAnchor:t,getAlignmentBaseline:n,getRadius:r,getSecondaryText:i,radiusScale:a,secondarySizeScale:o,sizeScale:s}=this.props,c=t===`middle`?0:t===`start`?1:-1,l=n===`center`?0:n===`bottom`?1:-1,u=s/4,d=s*1.25,f=.6*(1-l)*s,p=e?f:0;t===`middle`&&n===`top`&&i&&(p-=f,p-=o,p+=s);let m=1.25;return typeof r==`function`?(e,t)=>{let n=(t?r(e,t):1)*a*m;return[c*(n+u),l*(n+d)+p]}:[c*(r*a*m+u),l*(r*a*m+d)+p]}calculateBackgroundPadding(){let{getTextAnchor:e,getAlignmentBaseline:t,sizeScale:n}=this.props,r=12*n,i=3*n,a=[0,0,0,0];return t===`top`?a[a9]=i:t===`bottom`?a[s9]=i:(a[a9]=.5*i,a[s9]=.5*i),e===`start`?a[i9]=r:e===`end`?a[o9]=r:(a[i9]=.5*r,a[o9]=.5*r),a}renderTextLayer(e,{updateTriggers:t={},...n}){let{data:r,characterSet:i,fontFamily:a,fontSettings:o,fontWeight:s,outlineColor:c,outlineWidth:l,sizeScale:u,radiusScale:d,getAlignmentBaseline:f,getColor:p,getPosition:m,getTextAnchor:h,updateTriggers:g}=this.props;if(u<2){let e=this.parent?.props?.textSizeScale?`textSizeScale`:`sizeScale`;fo.warn(`${e} has small value (${u}). Note getTextSize is not supported on PointLabelLayer`)()}return new l9(this.getSubLayerProps({id:e,data:r,characterSet:i,fontFamily:a,fontSettings:o,fontWeight:s,outlineColor:c,outlineWidth:l,sizeScale:u,getAlignmentBaseline:f,getColor:p,getPosition:m,getTextAnchor:h,updateTriggers:{...g,...t,getPixelOffset:[g.getRadius,g.getTextAnchor,g.getAlignmentBaseline,d,u]}}),{getSize:1,_subLayerProps:{background:{type:c9}}},n)}renderLayers(){let{getText:e,getSecondaryColor:t,getSecondaryText:n,secondaryOutlineColor:r,secondarySizeScale:i,updateTriggers:a}=this.props,o=this.calculatePixelOffset(!1),s=this.calculateBackgroundPadding();return[this.renderTextLayer(`${a.getText}-primary`,{backgroundPadding:s,getText:e,getPixelOffset:o,background:!0}),!!n&&this.renderTextLayer(`${a.getSecondaryText}-secondary`,{getText:n,getPixelOffset:this.calculatePixelOffset(!0),getAlignmentBaseline:`top`,...t&&{getColor:t},...i&&{sizeScale:i},...r&&{outlineColor:r}})]}};u9.layerName=`PointLabelLayer`,u9.defaultProps=Lte;var Rte=`#version 300 es +#define SHADER_NAME raster-layer-vertex-shader +in vec3 positions; +in vec3 normals; +in float instanceElevations; +in vec4 instanceFillColors; +in vec4 instanceLineColors; +in vec3 instancePickingColors; +out vec4 vColor; +#ifdef FLAT_SHADING +out vec4 position_commonspace; +#endif +void main(void) { +vec2 tileOrigin = column.offset.xy; +float scale = column.widthScale; +int yIndex = - (gl_InstanceID / BLOCK_WIDTH); +int xIndex = gl_InstanceID + (yIndex * BLOCK_WIDTH); +vec2 cellCenter = scale * vec2(float(xIndex) + 0.5, float(yIndex) - 0.5); +vec4 color = column.isStroke ? instanceLineColors : instanceFillColors; +float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0); +float cellWidth = column.coverage * scale; +geometry.position = vec4(tileOrigin, 0.0, 1.0); +if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) { +geometry.position.xyz -= project.commonOrigin; +} +geometry.position.xy += cellCenter; +float elevation = 0.0; +float strokeOffsetRatio = 1.0; +if (column.extruded) { +elevation = instanceElevations * (positions.z + 1.0) / 2.0 * column.elevationScale; +} else if (column.stroked) { +float halfOffset = project_pixel_size(column.widthScale) / cellWidth; +if (column.isStroke) { +strokeOffsetRatio -= sign(positions.z) * halfOffset; +} else { +strokeOffsetRatio -= halfOffset; +} +} +geometry.pickingColor = instancePickingColors; +vec2 base = positions.xy * scale * strokeOffsetRatio * column.coverage * shouldRender; +vec3 cell = vec3(base, project_size(elevation)); +DECKGL_FILTER_SIZE(cell, geometry); +geometry.position.xyz += cell; +gl_Position = project_common_position_to_clipspace(geometry.position); +geometry.normal = project_normal(normals); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +if (column.extruded && !column.isStroke) { +#ifdef FLAT_SHADING +position_commonspace = geometry.position; +vColor = vec4(color.rgb, color.a * layer.opacity); +#else +vec3 lightColor = lighting_getLightColor(color.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal); +vColor = vec4(lightColor, color.a * layer.opacity); +#endif +} else { +vColor = vec4(color.rgb, color.a * layer.opacity); +} +DECKGL_FILTER_COLOR(vColor, geometry); +} +`,zte={...JP.defaultProps,extruded:!1,diskResolution:4,vertices:[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]]},d9=class extends X7(JP){getShaders(){let e=super.getShaders(),t=this.props.data,n=t.data.blockSize??Math.sqrt(t.length);return{...e,defines:{...e.defines,BLOCK_WIDTH:n},vs:Rte}}initializeState(){this.getAttributeManager().addInstanced({instanceElevations:{size:1,transition:!0,accessor:`getElevation`},instanceFillColors:{size:this.props.colorFormat.length,type:`unorm8`,transition:!0,accessor:`getFillColor`,defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,type:`unorm8`,transition:!0,accessor:`getLineColor`,defaultValue:[255,255,255,255]}})}};d9.layerName=`RasterColumnLayer`;function Bte(e,t){return e.data===t.data&&e.length===t.length}var f9=class extends fx{renderLayers(){let{data:e,getElevation:t,getFillColor:n,getLineColor:r,getLineWidth:i,tileIndex:a,updateTriggers:o}=this.props;if(!e||!a||e.length===0)return null;let s=e.blockSize??0,[c,l,u]=h7(a),d=[c,l],f=u/s,p=this.getSubLayerClass(`column`,d9),{highlightedObjectIndex:m,highlightColor:h}=this.state;return new p(this.props,this.getSubLayerProps({id:`cell`,updateTriggers:o,getElevation:this.getSubLayerAccessor(t),getFillColor:this.getSubLayerAccessor(n),getLineColor:this.getSubLayerAccessor(r),getLineWidth:this.getSubLayerAccessor(i)}),{data:{data:e,length:s*s},dataComparator:Bte,offset:d,lineWidthScale:f,highlightedObjectIndex:m,highlightColor:h})}getSubLayerAccessor(e){return typeof e==`function`?(t,n)=>{let{data:r,index:i}=n,a=r.data;return e({properties:J5(a.cells,i)},n)}:super.getSubLayerAccessor(e)}getPickingInfo(e){let t=super.getPickingInfo(e);return t.index!==-1&&(t.object=this.getSubLayerAccessor(e=>e)(void 0,{data:this.props,index:t.index})),t}_updateAutoHighlight(e){let{highlightedObjectIndex:t}=this.state,n=-1;if(e.index!==-1&&(n=e.index),t!==n){let{highlightColor:t}=this.props;typeof t==`function`&&(t=t(e)),this.setState({highlightColor:t,highlightedObjectIndex:n})}}};f9.layerName=`RasterLayer`,f9.defaultProps=zte;var Vte={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:BigUint64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:BigInt64Array,float32:Float32Array,float64:Float64Array},Hte=class e{static read(t,n){return t.readFields(e._readField,{name:``,type:``,data:null},n)}static _readField(e,t,n){if(e===1)t.name=n.readString();else if(e===2)t.type=n.readString();else if(e===3){let e=Vte[t.type];if(!e)throw Error(`Invalid data type: ${t.type}`);t.data={};let{compression:r}=p9;v7(e,n,t.data,{compression:r})}}},p9=class e{static read(t,n){return t.readFields(e._readField,{blockSize:0,bands:[]},n)}static _readField(e,t,n){e===1?t.blockSize=n.readVarint():e===2&&t.bands.push(Hte.read(n,n.readVarint()+n.pos))}},m9=`9.3.6`,h9=`cartoRasterTile`,Ute={name:`CARTO Raster Tile`,version:m9,id:h9,module:`carto`,extensions:[`pbf`],mimeTypes:[`application/vnd.carto-raster-tile`],category:`geometry`,parse:async(e,t)=>g9(e,t),parseSync:g9,worker:!0,options:{cartoRasterTile:{metadata:null,workerUrl:Y5(h9,m9)}}};function g9(e,t){let n=t?.cartoRasterTile?.metadata;if(!e||!n)return null;p9.compression=n.compression;let{bands:r,blockSize:i}=N7(e,p9),a={};for(let e=0;e{let t=e.tile?.index?.q;return t?new f9(e,{tileIndex:t}):null},Gte={data:B7,refinementStrategy:`no-overlap`,tileSize:512},_9=class extends Z7(CY,Ete){filterSubLayer(e){let{tile:t}=e.layer.props;return!t||super.filterSubLayer(e)}};_9.layerName=`PostProcessTileLayer`;var v9=class extends fx{getLoadOptions(){let e=this.props.data;return z7(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${e.accessToken}`}}})}renderLayers(){let e=this.props.data;if(!e)return null;let{tiles:t,minzoom:n,maxzoom:r,raster_metadata:i}=e,a=this.getSubLayerClass(`tile`,_9),o=this.getLoadOptions();return new a(this.props,{id:`raster-tile-layer-${this.props.id}`,data:t,TilesetClass:o7,renderSubLayers:Wte,minZoom:n,maxZoom:r,loadOptions:{...o,cartoRasterTile:{...o?.cartoRasterTile,metadata:i}}})}};v9.layerName=`RasterTileLayer`,v9.defaultProps=Gte;var Kte=class e{static read(t,n){return t.readFields(e._readField,{properties:[],numericProps:{}},n)}static _readField(e,t,n){if(e===1)t.properties.push(b7.read(n,n.readVarint()+n.pos));else if(e===2){let e=T7.read(n,n.readVarint()+n.pos);t.numericProps[e.key]=e.value}}},y9=`9.3.6`,b9=`cartoPropertiesTile`,qte={name:`CARTO Properties Tile`,version:y9,id:b9,module:`carto`,extensions:[`pbf`],mimeTypes:[`application/vnd.carto-properties-tile`],category:`geometry`,worker:!0,parse:async(e,t)=>x9(e,t),parseSync:x9,options:{cartoPropertiesTile:{workerUrl:Y5(b9,y9)}}};function x9(e,t){return e?N7(e,Kte):null}var S9=`9.3.6`,C9=`cartoVectorTile`,Jte={name:`CARTO Vector Tile`,version:S9,id:C9,module:`carto`,extensions:[`pbf`],mimeTypes:[`application/vnd.carto-vector-tile`],category:`geometry`,parse:async(e,t)=>w9(e,t),parseSync:w9,worker:!0,options:{cartoVectorTile:{workerUrl:Y5(C9,S9)}}};function Yte(e,t,{startPosition:n,endPosition:r,indices:i}){let a=e.positions.size,o=n*a,s=r*a,c=(0,dF.default)(e.positions.value.subarray(o,s),i.slice(1).map(e=>e-n),a);for(let e=0,r=c.length;er.get(s).length)&&r.set(s,{index:i,length:c})}let i=[],a=[],o=[],s=[],c=e7(r.size,e.numericProps),l=0;for(let[t,{index:n}]of r){let t=sne(e,n);i.push(...t);let r=e.pathIndices.value[n],u=e.featureIds.value[r];o.push(l),a.push(e.properties[u]),s.push(e.globalFeatureIds.value[r]),t7(e.numericProps,c,r,l),l++}return $5(i,o,s,c,a)}function tne(e,t,n,r){let i=!!(r&&e.properties.length>0&&`_carto_bbox`in e.properties[0]),{west:a,south:o,east:s,north:c}=i?r:t,l=(s-a)*(c-o)*1e-4,u=[],d=[],f=[],p=[],m=e7(e.polygonIndices.value.length-1,e.numericProps),h=i&&r!==t,g=0,_=0,{extruded:v}=n;for(let a=0;a=l){let i=[(e+a)/2,(n+o)/2];E9(i,r)&&(y=h?$te(i,r,t):i)}}}else{if(nne(e,a)=s)break;if(i){_+=3;continue}let a=e.triangles.value[_+1],o=e.triangles.value[_+2],c=e.positions.value.subarray(t*e.positions.size,t*e.positions.size+e.positions.size),l=e.positions.value.subarray(a*e.positions.size,a*e.positions.size+e.positions.size),u=e.positions.value.subarray(o*e.positions.size,o*e.positions.size+e.positions.size);if(rne(y,c,l,u))i=!0;else{let e=D9(c,l,u);e>n&&(n=e,r=[(c[0]+l[0]+u[0])/3,(c[1]+l[1]+u[1])/3])}_+=3}let a=i?y:r;E9(a,t)&&(c=a)}if(c){u.push(...c);let t=e.featureIds.value[o];if(v){let r=n.getElevation(void 0,{data:e,index:t});u.push(r*n.elevationScale)}d.push(e.properties[t]),f.push(g),p.push(e.globalFeatureIds.value[o]),t7(e.numericProps,m,o,g),g++}}return e.numericProps&&Object.keys(m).forEach(e=>{m[e].value=m[e].value.slice(0,g)}),$5(u,f,p,m,d,v?3:2)}function nne(e,t){let{positions:{value:n,size:r},polygonIndices:{value:i},triangles:{value:a}}=e,o=i[t],s=i[t+1],c=0,l=0;for(;l=o);)l+=3;for(;l=s)break;let t=a[l+1],i=a[l+2],o=n.subarray(e*r,e*r+r),u=n.subarray(t*r,t*r+r),d=n.subarray(i*r,i*r+r);c+=D9(o,u,d),l+=3}return c}function E9([e,t],{west:n,east:r,south:i,north:a}){return e>=n&&e=i&&t({[t]:{...l,...e?._subLayerProps?.[t],extensions:[...c,...e?._subLayerProps?.[t]?.extensions||[]]}}),d={...e,data:{...e.data,tileBbox:t},autoHighlight:!1,_subLayerProps:{...e._subLayerProps,...r,...u(`polygons-fill`),...u(`polygons-stroke`),...u(`linestrings`)}};n.push(new aL(d))}if(n[0]&&e.autoLabels){let r=Q5();e.data.lines&&e.data.lines.positions.value.length>0&&(r.points=ene(e.data.lines,typeof e.autoLabels==`object`?e.autoLabels.uniqueIdProperty:void 0)),e.data.polygons&&e.data.polygons.positions.value.length>0&&(r.points=tne(e.data.polygons,this.state.mvt?cne:t,e,t)),n.push(n[0].clone({id:`${e.id}-labels`,data:r,pickable:!1,autoHighlight:!1}))}return n}renderLayers(){let e=super.renderLayers();if(!this.props.autoLabels)return e;let t=(e||[]).flat().filter(Boolean);return t.sort((e,t)=>{let n=e.id.includes(`labels`),r=t.id.includes(`labels`);return n&&!r?1:!n&&r?-1:0}),t.map(e=>e.id.includes(`labels`)?e.clone({highlightedObjectIndex:-1}):e)}_isWGS84(){return!this.state.mvt||super._isWGS84()}};O9.layerName=`VectorTileLayer`,O9.defaultProps=lne;var k9={schemeGroups:{sequential:[`BuGn`,`BuPu`,`GnBu`,`OrRd`,`PuBu`,`PuBuGn`,`PuRd`,`RdPu`,`YlGn`,`YlGnBu`,`YlOrBr`,`YlOrRd`],singlehue:[`Blues`,`Greens`,`Greys`,`Oranges`,`Purples`,`Reds`],diverging:[`BrBG`,`PiYG`,`PRGn`,`PuOr`,`RdBu`,`RdGy`,`RdYlBu`,`RdYlGn`,`Spectral`],qualitative:[`Accent`,`Dark2`,`Paired`,`Pastel1`,`Pastel2`,`Set1`,`Set2`,`Set3`]},YlGn:{3:[`#f7fcb9`,`#addd8e`,`#31a354`],4:[`#ffffcc`,`#c2e699`,`#78c679`,`#238443`],5:[`#ffffcc`,`#c2e699`,`#78c679`,`#31a354`,`#006837`],6:[`#ffffcc`,`#d9f0a3`,`#addd8e`,`#78c679`,`#31a354`,`#006837`],7:[`#ffffcc`,`#d9f0a3`,`#addd8e`,`#78c679`,`#41ab5d`,`#238443`,`#005a32`],8:[`#ffffe5`,`#f7fcb9`,`#d9f0a3`,`#addd8e`,`#78c679`,`#41ab5d`,`#238443`,`#005a32`],9:[`#ffffe5`,`#f7fcb9`,`#d9f0a3`,`#addd8e`,`#78c679`,`#41ab5d`,`#238443`,`#006837`,`#004529`]},YlGnBu:{3:[`#edf8b1`,`#7fcdbb`,`#2c7fb8`],4:[`#ffffcc`,`#a1dab4`,`#41b6c4`,`#225ea8`],5:[`#ffffcc`,`#a1dab4`,`#41b6c4`,`#2c7fb8`,`#253494`],6:[`#ffffcc`,`#c7e9b4`,`#7fcdbb`,`#41b6c4`,`#2c7fb8`,`#253494`],7:[`#ffffcc`,`#c7e9b4`,`#7fcdbb`,`#41b6c4`,`#1d91c0`,`#225ea8`,`#0c2c84`],8:[`#ffffd9`,`#edf8b1`,`#c7e9b4`,`#7fcdbb`,`#41b6c4`,`#1d91c0`,`#225ea8`,`#0c2c84`],9:[`#ffffd9`,`#edf8b1`,`#c7e9b4`,`#7fcdbb`,`#41b6c4`,`#1d91c0`,`#225ea8`,`#253494`,`#081d58`]},GnBu:{3:[`#e0f3db`,`#a8ddb5`,`#43a2ca`],4:[`#f0f9e8`,`#bae4bc`,`#7bccc4`,`#2b8cbe`],5:[`#f0f9e8`,`#bae4bc`,`#7bccc4`,`#43a2ca`,`#0868ac`],6:[`#f0f9e8`,`#ccebc5`,`#a8ddb5`,`#7bccc4`,`#43a2ca`,`#0868ac`],7:[`#f0f9e8`,`#ccebc5`,`#a8ddb5`,`#7bccc4`,`#4eb3d3`,`#2b8cbe`,`#08589e`],8:[`#f7fcf0`,`#e0f3db`,`#ccebc5`,`#a8ddb5`,`#7bccc4`,`#4eb3d3`,`#2b8cbe`,`#08589e`],9:[`#f7fcf0`,`#e0f3db`,`#ccebc5`,`#a8ddb5`,`#7bccc4`,`#4eb3d3`,`#2b8cbe`,`#0868ac`,`#084081`]},BuGn:{3:[`#e5f5f9`,`#99d8c9`,`#2ca25f`],4:[`#edf8fb`,`#b2e2e2`,`#66c2a4`,`#238b45`],5:[`#edf8fb`,`#b2e2e2`,`#66c2a4`,`#2ca25f`,`#006d2c`],6:[`#edf8fb`,`#ccece6`,`#99d8c9`,`#66c2a4`,`#2ca25f`,`#006d2c`],7:[`#edf8fb`,`#ccece6`,`#99d8c9`,`#66c2a4`,`#41ae76`,`#238b45`,`#005824`],8:[`#f7fcfd`,`#e5f5f9`,`#ccece6`,`#99d8c9`,`#66c2a4`,`#41ae76`,`#238b45`,`#005824`],9:[`#f7fcfd`,`#e5f5f9`,`#ccece6`,`#99d8c9`,`#66c2a4`,`#41ae76`,`#238b45`,`#006d2c`,`#00441b`]},PuBuGn:{3:[`#ece2f0`,`#a6bddb`,`#1c9099`],4:[`#f6eff7`,`#bdc9e1`,`#67a9cf`,`#02818a`],5:[`#f6eff7`,`#bdc9e1`,`#67a9cf`,`#1c9099`,`#016c59`],6:[`#f6eff7`,`#d0d1e6`,`#a6bddb`,`#67a9cf`,`#1c9099`,`#016c59`],7:[`#f6eff7`,`#d0d1e6`,`#a6bddb`,`#67a9cf`,`#3690c0`,`#02818a`,`#016450`],8:[`#fff7fb`,`#ece2f0`,`#d0d1e6`,`#a6bddb`,`#67a9cf`,`#3690c0`,`#02818a`,`#016450`],9:[`#fff7fb`,`#ece2f0`,`#d0d1e6`,`#a6bddb`,`#67a9cf`,`#3690c0`,`#02818a`,`#016c59`,`#014636`]},PuBu:{3:[`#ece7f2`,`#a6bddb`,`#2b8cbe`],4:[`#f1eef6`,`#bdc9e1`,`#74a9cf`,`#0570b0`],5:[`#f1eef6`,`#bdc9e1`,`#74a9cf`,`#2b8cbe`,`#045a8d`],6:[`#f1eef6`,`#d0d1e6`,`#a6bddb`,`#74a9cf`,`#2b8cbe`,`#045a8d`],7:[`#f1eef6`,`#d0d1e6`,`#a6bddb`,`#74a9cf`,`#3690c0`,`#0570b0`,`#034e7b`],8:[`#fff7fb`,`#ece7f2`,`#d0d1e6`,`#a6bddb`,`#74a9cf`,`#3690c0`,`#0570b0`,`#034e7b`],9:[`#fff7fb`,`#ece7f2`,`#d0d1e6`,`#a6bddb`,`#74a9cf`,`#3690c0`,`#0570b0`,`#045a8d`,`#023858`]},BuPu:{3:[`#e0ecf4`,`#9ebcda`,`#8856a7`],4:[`#edf8fb`,`#b3cde3`,`#8c96c6`,`#88419d`],5:[`#edf8fb`,`#b3cde3`,`#8c96c6`,`#8856a7`,`#810f7c`],6:[`#edf8fb`,`#bfd3e6`,`#9ebcda`,`#8c96c6`,`#8856a7`,`#810f7c`],7:[`#edf8fb`,`#bfd3e6`,`#9ebcda`,`#8c96c6`,`#8c6bb1`,`#88419d`,`#6e016b`],8:[`#f7fcfd`,`#e0ecf4`,`#bfd3e6`,`#9ebcda`,`#8c96c6`,`#8c6bb1`,`#88419d`,`#6e016b`],9:[`#f7fcfd`,`#e0ecf4`,`#bfd3e6`,`#9ebcda`,`#8c96c6`,`#8c6bb1`,`#88419d`,`#810f7c`,`#4d004b`]},RdPu:{3:[`#fde0dd`,`#fa9fb5`,`#c51b8a`],4:[`#feebe2`,`#fbb4b9`,`#f768a1`,`#ae017e`],5:[`#feebe2`,`#fbb4b9`,`#f768a1`,`#c51b8a`,`#7a0177`],6:[`#feebe2`,`#fcc5c0`,`#fa9fb5`,`#f768a1`,`#c51b8a`,`#7a0177`],7:[`#feebe2`,`#fcc5c0`,`#fa9fb5`,`#f768a1`,`#dd3497`,`#ae017e`,`#7a0177`],8:[`#fff7f3`,`#fde0dd`,`#fcc5c0`,`#fa9fb5`,`#f768a1`,`#dd3497`,`#ae017e`,`#7a0177`],9:[`#fff7f3`,`#fde0dd`,`#fcc5c0`,`#fa9fb5`,`#f768a1`,`#dd3497`,`#ae017e`,`#7a0177`,`#49006a`]},PuRd:{3:[`#e7e1ef`,`#c994c7`,`#dd1c77`],4:[`#f1eef6`,`#d7b5d8`,`#df65b0`,`#ce1256`],5:[`#f1eef6`,`#d7b5d8`,`#df65b0`,`#dd1c77`,`#980043`],6:[`#f1eef6`,`#d4b9da`,`#c994c7`,`#df65b0`,`#dd1c77`,`#980043`],7:[`#f1eef6`,`#d4b9da`,`#c994c7`,`#df65b0`,`#e7298a`,`#ce1256`,`#91003f`],8:[`#f7f4f9`,`#e7e1ef`,`#d4b9da`,`#c994c7`,`#df65b0`,`#e7298a`,`#ce1256`,`#91003f`],9:[`#f7f4f9`,`#e7e1ef`,`#d4b9da`,`#c994c7`,`#df65b0`,`#e7298a`,`#ce1256`,`#980043`,`#67001f`]},OrRd:{3:[`#fee8c8`,`#fdbb84`,`#e34a33`],4:[`#fef0d9`,`#fdcc8a`,`#fc8d59`,`#d7301f`],5:[`#fef0d9`,`#fdcc8a`,`#fc8d59`,`#e34a33`,`#b30000`],6:[`#fef0d9`,`#fdd49e`,`#fdbb84`,`#fc8d59`,`#e34a33`,`#b30000`],7:[`#fef0d9`,`#fdd49e`,`#fdbb84`,`#fc8d59`,`#ef6548`,`#d7301f`,`#990000`],8:[`#fff7ec`,`#fee8c8`,`#fdd49e`,`#fdbb84`,`#fc8d59`,`#ef6548`,`#d7301f`,`#990000`],9:[`#fff7ec`,`#fee8c8`,`#fdd49e`,`#fdbb84`,`#fc8d59`,`#ef6548`,`#d7301f`,`#b30000`,`#7f0000`]},YlOrRd:{3:[`#ffeda0`,`#feb24c`,`#f03b20`],4:[`#ffffb2`,`#fecc5c`,`#fd8d3c`,`#e31a1c`],5:[`#ffffb2`,`#fecc5c`,`#fd8d3c`,`#f03b20`,`#bd0026`],6:[`#ffffb2`,`#fed976`,`#feb24c`,`#fd8d3c`,`#f03b20`,`#bd0026`],7:[`#ffffb2`,`#fed976`,`#feb24c`,`#fd8d3c`,`#fc4e2a`,`#e31a1c`,`#b10026`],8:[`#ffffcc`,`#ffeda0`,`#fed976`,`#feb24c`,`#fd8d3c`,`#fc4e2a`,`#e31a1c`,`#b10026`],9:[`#ffffcc`,`#ffeda0`,`#fed976`,`#feb24c`,`#fd8d3c`,`#fc4e2a`,`#e31a1c`,`#bd0026`,`#800026`]},YlOrBr:{3:[`#fff7bc`,`#fec44f`,`#d95f0e`],4:[`#ffffd4`,`#fed98e`,`#fe9929`,`#cc4c02`],5:[`#ffffd4`,`#fed98e`,`#fe9929`,`#d95f0e`,`#993404`],6:[`#ffffd4`,`#fee391`,`#fec44f`,`#fe9929`,`#d95f0e`,`#993404`],7:[`#ffffd4`,`#fee391`,`#fec44f`,`#fe9929`,`#ec7014`,`#cc4c02`,`#8c2d04`],8:[`#ffffe5`,`#fff7bc`,`#fee391`,`#fec44f`,`#fe9929`,`#ec7014`,`#cc4c02`,`#8c2d04`],9:[`#ffffe5`,`#fff7bc`,`#fee391`,`#fec44f`,`#fe9929`,`#ec7014`,`#cc4c02`,`#993404`,`#662506`]},Purples:{3:[`#efedf5`,`#bcbddc`,`#756bb1`],4:[`#f2f0f7`,`#cbc9e2`,`#9e9ac8`,`#6a51a3`],5:[`#f2f0f7`,`#cbc9e2`,`#9e9ac8`,`#756bb1`,`#54278f`],6:[`#f2f0f7`,`#dadaeb`,`#bcbddc`,`#9e9ac8`,`#756bb1`,`#54278f`],7:[`#f2f0f7`,`#dadaeb`,`#bcbddc`,`#9e9ac8`,`#807dba`,`#6a51a3`,`#4a1486`],8:[`#fcfbfd`,`#efedf5`,`#dadaeb`,`#bcbddc`,`#9e9ac8`,`#807dba`,`#6a51a3`,`#4a1486`],9:[`#fcfbfd`,`#efedf5`,`#dadaeb`,`#bcbddc`,`#9e9ac8`,`#807dba`,`#6a51a3`,`#54278f`,`#3f007d`]},Blues:{3:[`#deebf7`,`#9ecae1`,`#3182bd`],4:[`#eff3ff`,`#bdd7e7`,`#6baed6`,`#2171b5`],5:[`#eff3ff`,`#bdd7e7`,`#6baed6`,`#3182bd`,`#08519c`],6:[`#eff3ff`,`#c6dbef`,`#9ecae1`,`#6baed6`,`#3182bd`,`#08519c`],7:[`#eff3ff`,`#c6dbef`,`#9ecae1`,`#6baed6`,`#4292c6`,`#2171b5`,`#084594`],8:[`#f7fbff`,`#deebf7`,`#c6dbef`,`#9ecae1`,`#6baed6`,`#4292c6`,`#2171b5`,`#084594`],9:[`#f7fbff`,`#deebf7`,`#c6dbef`,`#9ecae1`,`#6baed6`,`#4292c6`,`#2171b5`,`#08519c`,`#08306b`]},Greens:{3:[`#e5f5e0`,`#a1d99b`,`#31a354`],4:[`#edf8e9`,`#bae4b3`,`#74c476`,`#238b45`],5:[`#edf8e9`,`#bae4b3`,`#74c476`,`#31a354`,`#006d2c`],6:[`#edf8e9`,`#c7e9c0`,`#a1d99b`,`#74c476`,`#31a354`,`#006d2c`],7:[`#edf8e9`,`#c7e9c0`,`#a1d99b`,`#74c476`,`#41ab5d`,`#238b45`,`#005a32`],8:[`#f7fcf5`,`#e5f5e0`,`#c7e9c0`,`#a1d99b`,`#74c476`,`#41ab5d`,`#238b45`,`#005a32`],9:[`#f7fcf5`,`#e5f5e0`,`#c7e9c0`,`#a1d99b`,`#74c476`,`#41ab5d`,`#238b45`,`#006d2c`,`#00441b`]},Oranges:{3:[`#fee6ce`,`#fdae6b`,`#e6550d`],4:[`#feedde`,`#fdbe85`,`#fd8d3c`,`#d94701`],5:[`#feedde`,`#fdbe85`,`#fd8d3c`,`#e6550d`,`#a63603`],6:[`#feedde`,`#fdd0a2`,`#fdae6b`,`#fd8d3c`,`#e6550d`,`#a63603`],7:[`#feedde`,`#fdd0a2`,`#fdae6b`,`#fd8d3c`,`#f16913`,`#d94801`,`#8c2d04`],8:[`#fff5eb`,`#fee6ce`,`#fdd0a2`,`#fdae6b`,`#fd8d3c`,`#f16913`,`#d94801`,`#8c2d04`],9:[`#fff5eb`,`#fee6ce`,`#fdd0a2`,`#fdae6b`,`#fd8d3c`,`#f16913`,`#d94801`,`#a63603`,`#7f2704`]},Reds:{3:[`#fee0d2`,`#fc9272`,`#de2d26`],4:[`#fee5d9`,`#fcae91`,`#fb6a4a`,`#cb181d`],5:[`#fee5d9`,`#fcae91`,`#fb6a4a`,`#de2d26`,`#a50f15`],6:[`#fee5d9`,`#fcbba1`,`#fc9272`,`#fb6a4a`,`#de2d26`,`#a50f15`],7:[`#fee5d9`,`#fcbba1`,`#fc9272`,`#fb6a4a`,`#ef3b2c`,`#cb181d`,`#99000d`],8:[`#fff5f0`,`#fee0d2`,`#fcbba1`,`#fc9272`,`#fb6a4a`,`#ef3b2c`,`#cb181d`,`#99000d`],9:[`#fff5f0`,`#fee0d2`,`#fcbba1`,`#fc9272`,`#fb6a4a`,`#ef3b2c`,`#cb181d`,`#a50f15`,`#67000d`]},Greys:{3:[`#f0f0f0`,`#bdbdbd`,`#636363`],4:[`#f7f7f7`,`#cccccc`,`#969696`,`#525252`],5:[`#f7f7f7`,`#cccccc`,`#969696`,`#636363`,`#252525`],6:[`#f7f7f7`,`#d9d9d9`,`#bdbdbd`,`#969696`,`#636363`,`#252525`],7:[`#f7f7f7`,`#d9d9d9`,`#bdbdbd`,`#969696`,`#737373`,`#525252`,`#252525`],8:[`#ffffff`,`#f0f0f0`,`#d9d9d9`,`#bdbdbd`,`#969696`,`#737373`,`#525252`,`#252525`],9:[`#ffffff`,`#f0f0f0`,`#d9d9d9`,`#bdbdbd`,`#969696`,`#737373`,`#525252`,`#252525`,`#000000`]},PuOr:{3:[`#f1a340`,`#f7f7f7`,`#998ec3`],4:[`#e66101`,`#fdb863`,`#b2abd2`,`#5e3c99`],5:[`#e66101`,`#fdb863`,`#f7f7f7`,`#b2abd2`,`#5e3c99`],6:[`#b35806`,`#f1a340`,`#fee0b6`,`#d8daeb`,`#998ec3`,`#542788`],7:[`#b35806`,`#f1a340`,`#fee0b6`,`#f7f7f7`,`#d8daeb`,`#998ec3`,`#542788`],8:[`#b35806`,`#e08214`,`#fdb863`,`#fee0b6`,`#d8daeb`,`#b2abd2`,`#8073ac`,`#542788`],9:[`#b35806`,`#e08214`,`#fdb863`,`#fee0b6`,`#f7f7f7`,`#d8daeb`,`#b2abd2`,`#8073ac`,`#542788`],10:[`#7f3b08`,`#b35806`,`#e08214`,`#fdb863`,`#fee0b6`,`#d8daeb`,`#b2abd2`,`#8073ac`,`#542788`,`#2d004b`],11:[`#7f3b08`,`#b35806`,`#e08214`,`#fdb863`,`#fee0b6`,`#f7f7f7`,`#d8daeb`,`#b2abd2`,`#8073ac`,`#542788`,`#2d004b`]},BrBG:{3:[`#d8b365`,`#f5f5f5`,`#5ab4ac`],4:[`#a6611a`,`#dfc27d`,`#80cdc1`,`#018571`],5:[`#a6611a`,`#dfc27d`,`#f5f5f5`,`#80cdc1`,`#018571`],6:[`#8c510a`,`#d8b365`,`#f6e8c3`,`#c7eae5`,`#5ab4ac`,`#01665e`],7:[`#8c510a`,`#d8b365`,`#f6e8c3`,`#f5f5f5`,`#c7eae5`,`#5ab4ac`,`#01665e`],8:[`#8c510a`,`#bf812d`,`#dfc27d`,`#f6e8c3`,`#c7eae5`,`#80cdc1`,`#35978f`,`#01665e`],9:[`#8c510a`,`#bf812d`,`#dfc27d`,`#f6e8c3`,`#f5f5f5`,`#c7eae5`,`#80cdc1`,`#35978f`,`#01665e`],10:[`#543005`,`#8c510a`,`#bf812d`,`#dfc27d`,`#f6e8c3`,`#c7eae5`,`#80cdc1`,`#35978f`,`#01665e`,`#003c30`],11:[`#543005`,`#8c510a`,`#bf812d`,`#dfc27d`,`#f6e8c3`,`#f5f5f5`,`#c7eae5`,`#80cdc1`,`#35978f`,`#01665e`,`#003c30`]},PRGn:{3:[`#af8dc3`,`#f7f7f7`,`#7fbf7b`],4:[`#7b3294`,`#c2a5cf`,`#a6dba0`,`#008837`],5:[`#7b3294`,`#c2a5cf`,`#f7f7f7`,`#a6dba0`,`#008837`],6:[`#762a83`,`#af8dc3`,`#e7d4e8`,`#d9f0d3`,`#7fbf7b`,`#1b7837`],7:[`#762a83`,`#af8dc3`,`#e7d4e8`,`#f7f7f7`,`#d9f0d3`,`#7fbf7b`,`#1b7837`],8:[`#762a83`,`#9970ab`,`#c2a5cf`,`#e7d4e8`,`#d9f0d3`,`#a6dba0`,`#5aae61`,`#1b7837`],9:[`#762a83`,`#9970ab`,`#c2a5cf`,`#e7d4e8`,`#f7f7f7`,`#d9f0d3`,`#a6dba0`,`#5aae61`,`#1b7837`],10:[`#40004b`,`#762a83`,`#9970ab`,`#c2a5cf`,`#e7d4e8`,`#d9f0d3`,`#a6dba0`,`#5aae61`,`#1b7837`,`#00441b`],11:[`#40004b`,`#762a83`,`#9970ab`,`#c2a5cf`,`#e7d4e8`,`#f7f7f7`,`#d9f0d3`,`#a6dba0`,`#5aae61`,`#1b7837`,`#00441b`]},PiYG:{3:[`#e9a3c9`,`#f7f7f7`,`#a1d76a`],4:[`#d01c8b`,`#f1b6da`,`#b8e186`,`#4dac26`],5:[`#d01c8b`,`#f1b6da`,`#f7f7f7`,`#b8e186`,`#4dac26`],6:[`#c51b7d`,`#e9a3c9`,`#fde0ef`,`#e6f5d0`,`#a1d76a`,`#4d9221`],7:[`#c51b7d`,`#e9a3c9`,`#fde0ef`,`#f7f7f7`,`#e6f5d0`,`#a1d76a`,`#4d9221`],8:[`#c51b7d`,`#de77ae`,`#f1b6da`,`#fde0ef`,`#e6f5d0`,`#b8e186`,`#7fbc41`,`#4d9221`],9:[`#c51b7d`,`#de77ae`,`#f1b6da`,`#fde0ef`,`#f7f7f7`,`#e6f5d0`,`#b8e186`,`#7fbc41`,`#4d9221`],10:[`#8e0152`,`#c51b7d`,`#de77ae`,`#f1b6da`,`#fde0ef`,`#e6f5d0`,`#b8e186`,`#7fbc41`,`#4d9221`,`#276419`],11:[`#8e0152`,`#c51b7d`,`#de77ae`,`#f1b6da`,`#fde0ef`,`#f7f7f7`,`#e6f5d0`,`#b8e186`,`#7fbc41`,`#4d9221`,`#276419`]},RdBu:{3:[`#ef8a62`,`#f7f7f7`,`#67a9cf`],4:[`#ca0020`,`#f4a582`,`#92c5de`,`#0571b0`],5:[`#ca0020`,`#f4a582`,`#f7f7f7`,`#92c5de`,`#0571b0`],6:[`#b2182b`,`#ef8a62`,`#fddbc7`,`#d1e5f0`,`#67a9cf`,`#2166ac`],7:[`#b2182b`,`#ef8a62`,`#fddbc7`,`#f7f7f7`,`#d1e5f0`,`#67a9cf`,`#2166ac`],8:[`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#d1e5f0`,`#92c5de`,`#4393c3`,`#2166ac`],9:[`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#f7f7f7`,`#d1e5f0`,`#92c5de`,`#4393c3`,`#2166ac`],10:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#d1e5f0`,`#92c5de`,`#4393c3`,`#2166ac`,`#053061`],11:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#f7f7f7`,`#d1e5f0`,`#92c5de`,`#4393c3`,`#2166ac`,`#053061`]},RdGy:{3:[`#ef8a62`,`#ffffff`,`#999999`],4:[`#ca0020`,`#f4a582`,`#bababa`,`#404040`],5:[`#ca0020`,`#f4a582`,`#ffffff`,`#bababa`,`#404040`],6:[`#b2182b`,`#ef8a62`,`#fddbc7`,`#e0e0e0`,`#999999`,`#4d4d4d`],7:[`#b2182b`,`#ef8a62`,`#fddbc7`,`#ffffff`,`#e0e0e0`,`#999999`,`#4d4d4d`],8:[`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#e0e0e0`,`#bababa`,`#878787`,`#4d4d4d`],9:[`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#ffffff`,`#e0e0e0`,`#bababa`,`#878787`,`#4d4d4d`],10:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#e0e0e0`,`#bababa`,`#878787`,`#4d4d4d`,`#1a1a1a`],11:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#ffffff`,`#e0e0e0`,`#bababa`,`#878787`,`#4d4d4d`,`#1a1a1a`]},RdYlBu:{3:[`#fc8d59`,`#ffffbf`,`#91bfdb`],4:[`#d7191c`,`#fdae61`,`#abd9e9`,`#2c7bb6`],5:[`#d7191c`,`#fdae61`,`#ffffbf`,`#abd9e9`,`#2c7bb6`],6:[`#d73027`,`#fc8d59`,`#fee090`,`#e0f3f8`,`#91bfdb`,`#4575b4`],7:[`#d73027`,`#fc8d59`,`#fee090`,`#ffffbf`,`#e0f3f8`,`#91bfdb`,`#4575b4`],8:[`#d73027`,`#f46d43`,`#fdae61`,`#fee090`,`#e0f3f8`,`#abd9e9`,`#74add1`,`#4575b4`],9:[`#d73027`,`#f46d43`,`#fdae61`,`#fee090`,`#ffffbf`,`#e0f3f8`,`#abd9e9`,`#74add1`,`#4575b4`],10:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee090`,`#e0f3f8`,`#abd9e9`,`#74add1`,`#4575b4`,`#313695`],11:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee090`,`#ffffbf`,`#e0f3f8`,`#abd9e9`,`#74add1`,`#4575b4`,`#313695`]},Spectral:{3:[`#fc8d59`,`#ffffbf`,`#99d594`],4:[`#d7191c`,`#fdae61`,`#abdda4`,`#2b83ba`],5:[`#d7191c`,`#fdae61`,`#ffffbf`,`#abdda4`,`#2b83ba`],6:[`#d53e4f`,`#fc8d59`,`#fee08b`,`#e6f598`,`#99d594`,`#3288bd`],7:[`#d53e4f`,`#fc8d59`,`#fee08b`,`#ffffbf`,`#e6f598`,`#99d594`,`#3288bd`],8:[`#d53e4f`,`#f46d43`,`#fdae61`,`#fee08b`,`#e6f598`,`#abdda4`,`#66c2a5`,`#3288bd`],9:[`#d53e4f`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#e6f598`,`#abdda4`,`#66c2a5`,`#3288bd`],10:[`#9e0142`,`#d53e4f`,`#f46d43`,`#fdae61`,`#fee08b`,`#e6f598`,`#abdda4`,`#66c2a5`,`#3288bd`,`#5e4fa2`],11:[`#9e0142`,`#d53e4f`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#e6f598`,`#abdda4`,`#66c2a5`,`#3288bd`,`#5e4fa2`]},RdYlGn:{3:[`#fc8d59`,`#ffffbf`,`#91cf60`],4:[`#d7191c`,`#fdae61`,`#a6d96a`,`#1a9641`],5:[`#d7191c`,`#fdae61`,`#ffffbf`,`#a6d96a`,`#1a9641`],6:[`#d73027`,`#fc8d59`,`#fee08b`,`#d9ef8b`,`#91cf60`,`#1a9850`],7:[`#d73027`,`#fc8d59`,`#fee08b`,`#ffffbf`,`#d9ef8b`,`#91cf60`,`#1a9850`],8:[`#d73027`,`#f46d43`,`#fdae61`,`#fee08b`,`#d9ef8b`,`#a6d96a`,`#66bd63`,`#1a9850`],9:[`#d73027`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#d9ef8b`,`#a6d96a`,`#66bd63`,`#1a9850`],10:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee08b`,`#d9ef8b`,`#a6d96a`,`#66bd63`,`#1a9850`,`#006837`],11:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#d9ef8b`,`#a6d96a`,`#66bd63`,`#1a9850`,`#006837`]},Accent:{3:[`#7fc97f`,`#beaed4`,`#fdc086`],4:[`#7fc97f`,`#beaed4`,`#fdc086`,`#ffff99`],5:[`#7fc97f`,`#beaed4`,`#fdc086`,`#ffff99`,`#386cb0`],6:[`#7fc97f`,`#beaed4`,`#fdc086`,`#ffff99`,`#386cb0`,`#f0027f`],7:[`#7fc97f`,`#beaed4`,`#fdc086`,`#ffff99`,`#386cb0`,`#f0027f`,`#bf5b17`],8:[`#7fc97f`,`#beaed4`,`#fdc086`,`#ffff99`,`#386cb0`,`#f0027f`,`#bf5b17`,`#666666`]},Dark2:{3:[`#1b9e77`,`#d95f02`,`#7570b3`],4:[`#1b9e77`,`#d95f02`,`#7570b3`,`#e7298a`],5:[`#1b9e77`,`#d95f02`,`#7570b3`,`#e7298a`,`#66a61e`],6:[`#1b9e77`,`#d95f02`,`#7570b3`,`#e7298a`,`#66a61e`,`#e6ab02`],7:[`#1b9e77`,`#d95f02`,`#7570b3`,`#e7298a`,`#66a61e`,`#e6ab02`,`#a6761d`],8:[`#1b9e77`,`#d95f02`,`#7570b3`,`#e7298a`,`#66a61e`,`#e6ab02`,`#a6761d`,`#666666`]},Paired:{3:[`#a6cee3`,`#1f78b4`,`#b2df8a`],4:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`],5:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`],6:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`,`#e31a1c`],7:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`,`#e31a1c`,`#fdbf6f`],8:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`,`#e31a1c`,`#fdbf6f`,`#ff7f00`],9:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`,`#e31a1c`,`#fdbf6f`,`#ff7f00`,`#cab2d6`],10:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`,`#e31a1c`,`#fdbf6f`,`#ff7f00`,`#cab2d6`,`#6a3d9a`],11:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`,`#e31a1c`,`#fdbf6f`,`#ff7f00`,`#cab2d6`,`#6a3d9a`,`#ffff99`],12:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`,`#e31a1c`,`#fdbf6f`,`#ff7f00`,`#cab2d6`,`#6a3d9a`,`#ffff99`,`#b15928`]},Pastel1:{3:[`#fbb4ae`,`#b3cde3`,`#ccebc5`],4:[`#fbb4ae`,`#b3cde3`,`#ccebc5`,`#decbe4`],5:[`#fbb4ae`,`#b3cde3`,`#ccebc5`,`#decbe4`,`#fed9a6`],6:[`#fbb4ae`,`#b3cde3`,`#ccebc5`,`#decbe4`,`#fed9a6`,`#ffffcc`],7:[`#fbb4ae`,`#b3cde3`,`#ccebc5`,`#decbe4`,`#fed9a6`,`#ffffcc`,`#e5d8bd`],8:[`#fbb4ae`,`#b3cde3`,`#ccebc5`,`#decbe4`,`#fed9a6`,`#ffffcc`,`#e5d8bd`,`#fddaec`],9:[`#fbb4ae`,`#b3cde3`,`#ccebc5`,`#decbe4`,`#fed9a6`,`#ffffcc`,`#e5d8bd`,`#fddaec`,`#f2f2f2`]},Pastel2:{3:[`#b3e2cd`,`#fdcdac`,`#cbd5e8`],4:[`#b3e2cd`,`#fdcdac`,`#cbd5e8`,`#f4cae4`],5:[`#b3e2cd`,`#fdcdac`,`#cbd5e8`,`#f4cae4`,`#e6f5c9`],6:[`#b3e2cd`,`#fdcdac`,`#cbd5e8`,`#f4cae4`,`#e6f5c9`,`#fff2ae`],7:[`#b3e2cd`,`#fdcdac`,`#cbd5e8`,`#f4cae4`,`#e6f5c9`,`#fff2ae`,`#f1e2cc`],8:[`#b3e2cd`,`#fdcdac`,`#cbd5e8`,`#f4cae4`,`#e6f5c9`,`#fff2ae`,`#f1e2cc`,`#cccccc`]},Set1:{3:[`#e41a1c`,`#377eb8`,`#4daf4a`],4:[`#e41a1c`,`#377eb8`,`#4daf4a`,`#984ea3`],5:[`#e41a1c`,`#377eb8`,`#4daf4a`,`#984ea3`,`#ff7f00`],6:[`#e41a1c`,`#377eb8`,`#4daf4a`,`#984ea3`,`#ff7f00`,`#ffff33`],7:[`#e41a1c`,`#377eb8`,`#4daf4a`,`#984ea3`,`#ff7f00`,`#ffff33`,`#a65628`],8:[`#e41a1c`,`#377eb8`,`#4daf4a`,`#984ea3`,`#ff7f00`,`#ffff33`,`#a65628`,`#f781bf`],9:[`#e41a1c`,`#377eb8`,`#4daf4a`,`#984ea3`,`#ff7f00`,`#ffff33`,`#a65628`,`#f781bf`,`#999999`]},Set2:{3:[`#66c2a5`,`#fc8d62`,`#8da0cb`],4:[`#66c2a5`,`#fc8d62`,`#8da0cb`,`#e78ac3`],5:[`#66c2a5`,`#fc8d62`,`#8da0cb`,`#e78ac3`,`#a6d854`],6:[`#66c2a5`,`#fc8d62`,`#8da0cb`,`#e78ac3`,`#a6d854`,`#ffd92f`],7:[`#66c2a5`,`#fc8d62`,`#8da0cb`,`#e78ac3`,`#a6d854`,`#ffd92f`,`#e5c494`],8:[`#66c2a5`,`#fc8d62`,`#8da0cb`,`#e78ac3`,`#a6d854`,`#ffd92f`,`#e5c494`,`#b3b3b3`]},Set3:{3:[`#8dd3c7`,`#ffffb3`,`#bebada`],4:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`],5:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`],6:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`,`#fdb462`],7:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`,`#fdb462`,`#b3de69`],8:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`,`#fdb462`,`#b3de69`,`#fccde5`],9:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`,`#fdb462`,`#b3de69`,`#fccde5`,`#d9d9d9`],10:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`,`#fdb462`,`#b3de69`,`#fccde5`,`#d9d9d9`,`#bc80bd`],11:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`,`#fdb462`,`#b3de69`,`#fccde5`,`#d9d9d9`,`#bc80bd`,`#ccebc5`],12:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`,`#fdb462`,`#b3de69`,`#fccde5`,`#d9d9d9`,`#bc80bd`,`#ccebc5`,`#ffed6f`]}},une=n({Antique:()=>zne,ArmyRose:()=>Mne,BluGrn:()=>vne,BluYl:()=>Sne,Bold:()=>Bne,BrwnYl:()=>jne,Burg:()=>dne,BurgYl:()=>fne,DarkMint:()=>yne,Earth:()=>Rne,Emrld:()=>bne,Fall:()=>Nne,Geyser:()=>Pne,Magenta:()=>One,Mint:()=>_ne,OrYel:()=>mne,Pastel:()=>Vne,Peach:()=>hne,PinkYl:()=>gne,Prism:()=>Hne,Purp:()=>Tne,PurpOr:()=>Ene,RedOr:()=>pne,Safe:()=>Une,Sunset:()=>Dne,SunsetDark:()=>kne,Teal:()=>Cne,TealGrn:()=>wne,TealRose:()=>Ine,Temps:()=>Fne,Tropic:()=>Lne,Vivid:()=>Wne,ag_GrnYl:()=>xne,ag_Sunset:()=>Ane,cb_Accent:()=>rre,cb_Blues:()=>dre,cb_BrBG:()=>_re,cb_BuGn:()=>Gne,cb_BuPu:()=>Kne,cb_Dark2:()=>ire,cb_GnBu:()=>qne,cb_Greens:()=>fre,cb_Greys:()=>pre,cb_OrRd:()=>Jne,cb_Oranges:()=>mre,cb_PRGn:()=>yre,cb_Paired:()=>are,cb_Pastel1:()=>ore,cb_Pastel2:()=>sre,cb_PiYG:()=>vre,cb_PuBu:()=>Yne,cb_PuBuGn:()=>Xne,cb_PuOr:()=>bre,cb_PuRd:()=>Zne,cb_Purples:()=>hre,cb_RdBu:()=>xre,cb_RdGy:()=>Sre,cb_RdPu:()=>Qne,cb_RdYlBu:()=>Cre,cb_RdYlGn:()=>wre,cb_Reds:()=>gre,cb_Set1:()=>cre,cb_Set2:()=>lre,cb_Set3:()=>ure,cb_Spectral:()=>Tre,cb_YlGn:()=>$ne,cb_YlGnBu:()=>ere,cb_YlOrBr:()=>tre,cb_YlOrRd:()=>nre}),dne={2:[`#ffc6c4`,`#672044`],3:[`#ffc6c4`,`#cc607d`,`#672044`],4:[`#ffc6c4`,`#e38191`,`#ad466c`,`#672044`],5:[`#ffc6c4`,`#ee919b`,`#cc607d`,`#9e3963`,`#672044`],6:[`#ffc6c4`,`#f29ca3`,`#da7489`,`#b95073`,`#93345d`,`#672044`],7:[`#ffc6c4`,`#f4a3a8`,`#e38191`,`#cc607d`,`#ad466c`,`#8b3058`,`#672044`],tags:[`quantitative`]},fne={2:[`#fbe6c5`,`#70284a`],3:[`#fbe6c5`,`#dc7176`,`#70284a`],4:[`#fbe6c5`,`#ee8a82`,`#c8586c`,`#70284a`],5:[`#fbe6c5`,`#f2a28a`,`#dc7176`,`#b24b65`,`#70284a`],6:[`#fbe6c5`,`#f4b191`,`#e7807d`,`#d06270`,`#a44360`,`#70284a`],7:[`#fbe6c5`,`#f5ba98`,`#ee8a82`,`#dc7176`,`#c8586c`,`#9c3f5d`,`#70284a`],tags:[`quantitative`]},pne={2:[`#f6d2a9`,`#b13f64`],3:[`#f6d2a9`,`#ea8171`,`#b13f64`],4:[`#f6d2a9`,`#f19c7c`,`#dd686c`,`#b13f64`],5:[`#f6d2a9`,`#f3aa84`,`#ea8171`,`#d55d6a`,`#b13f64`],6:[`#f6d2a9`,`#f4b28a`,`#ef9177`,`#e3726d`,`#cf5669`,`#b13f64`],7:[`#f6d2a9`,`#f5b78e`,`#f19c7c`,`#ea8171`,`#dd686c`,`#ca5268`,`#b13f64`],tags:[`quantitative`]},mne={2:[`#ecda9a`,`#ee4d5a`],3:[`#ecda9a`,`#f7945d`,`#ee4d5a`],4:[`#ecda9a`,`#f3ad6a`,`#f97b57`,`#ee4d5a`],5:[`#ecda9a`,`#f1b973`,`#f7945d`,`#f86f56`,`#ee4d5a`],6:[`#ecda9a`,`#f0c079`,`#f5a363`,`#f98558`,`#f76856`,`#ee4d5a`],7:[`#ecda9a`,`#efc47e`,`#f3ad6a`,`#f7945d`,`#f97b57`,`#f66356`,`#ee4d5a`],tags:[`quantitative`]},hne={2:[`#fde0c5`,`#eb4a40`],3:[`#fde0c5`,`#f59e72`,`#eb4a40`],4:[`#fde0c5`,`#f8b58b`,`#f2855d`,`#eb4a40`],5:[`#fde0c5`,`#f9c098`,`#f59e72`,`#f17854`,`#eb4a40`],6:[`#fde0c5`,`#fac7a1`,`#f7ac80`,`#f38f65`,`#f0704f`,`#eb4a40`],7:[`#fde0c5`,`#facba6`,`#f8b58b`,`#f59e72`,`#f2855d`,`#ef6a4c`,`#eb4a40`],tags:[`quantitative`]},gne={2:[`#fef6b5`,`#e15383`],3:[`#fef6b5`,`#ffa679`,`#e15383`],4:[`#fef6b5`,`#ffc285`,`#fa8a76`,`#e15383`],5:[`#fef6b5`,`#ffd08e`,`#ffa679`,`#f67b77`,`#e15383`],6:[`#fef6b5`,`#ffd795`,`#ffb77f`,`#fd9576`,`#f37378`,`#e15383`],7:[`#fef6b5`,`#ffdd9a`,`#ffc285`,`#ffa679`,`#fa8a76`,`#f16d7a`,`#e15383`],tags:[`quantitative`]},_ne={2:[`#e4f1e1`,`#0d585f`],3:[`#e4f1e1`,`#63a6a0`,`#0d585f`],4:[`#e4f1e1`,`#89c0b6`,`#448c8a`,`#0d585f`],5:[`#E4F1E1`,`#9CCDC1`,`#63A6A0`,`#337F7F`,`#0D585F`],6:[`#e4f1e1`,`#abd4c7`,`#7ab5ad`,`#509693`,`#2c7778`,`#0d585f`],7:[`#e4f1e1`,`#b4d9cc`,`#89c0b6`,`#63a6a0`,`#448c8a`,`#287274`,`#0d585f`],tags:[`quantitative`]},vne={2:[`#c4e6c3`,`#1d4f60`],3:[`#c4e6c3`,`#4da284`,`#1d4f60`],4:[`#c4e6c3`,`#6dbc90`,`#36877a`,`#1d4f60`],5:[`#c4e6c3`,`#80c799`,`#4da284`,`#2d7974`,`#1d4f60`],6:[`#c4e6c3`,`#8dce9f`,`#5fb28b`,`#3e927e`,`#297071`,`#1d4f60`],7:[`#c4e6c3`,`#96d2a4`,`#6dbc90`,`#4da284`,`#36877a`,`#266b6e`,`#1d4f60`],tags:[`quantitative`]},yne={2:[`#d2fbd4`,`#123f5a`],3:[`#d2fbd4`,`#559c9e`,`#123f5a`],4:[`#d2fbd4`,`#7bbcb0`,`#3a7c89`,`#123f5a`],5:[`#d2fbd4`,`#8eccb9`,`#559c9e`,`#2b6c7f`,`#123f5a`],6:[`#d2fbd4`,`#9cd5be`,`#6cafa9`,`#458892`,`#266377`,`#123f5a`],7:[`#d2fbd4`,`#a5dbc2`,`#7bbcb0`,`#559c9e`,`#3a7c89`,`#235d72`,`#123f5a`],tags:[`quantitative`]},bne={2:[`#d3f2a3`,`#074050`],3:[`#d3f2a3`,`#4c9b82`,`#074050`],4:[`#d3f2a3`,`#6cc08b`,`#217a79`,`#074050`],5:[`#d3f2a3`,`#82d091`,`#4c9b82`,`#19696f`,`#074050`],6:[`#d3f2a3`,`#8fda94`,`#60b187`,`#35877d`,`#145f69`,`#074050`],7:[`#d3f2a3`,`#97e196`,`#6cc08b`,`#4c9b82`,`#217a79`,`#105965`,`#074050`],tags:[`quantitative`]},xne={2:[`#245668`,`#EDEF5D`],3:[`#245668`,`#39AB7E`,`#EDEF5D`],4:[`#245668`,`#0D8F81`,`#6EC574`,`#EDEF5D`],5:[`#245668`,`#04817E`,`#39AB7E`,`#8BD16D`,`#EDEF5D`],6:[`#245668`,`#09787C`,`#1D9A81`,`#58BB79`,`#9DD869`,`#EDEF5D`],7:[`#245668`,`#0F7279`,`#0D8F81`,`#39AB7E`,`#6EC574`,`#A9DC67`,`#EDEF5D`],tags:[`aggregation`]},Sne={2:[`#f7feae`,`#045275`],3:[`#f7feae`,`#46aea0`,`#045275`],4:[`#f7feae`,`#7ccba2`,`#089099`,`#045275`],5:[`#f7feae`,`#9bd8a4`,`#46aea0`,`#058092`,`#045275`],6:[`#f7feae`,`#ace1a4`,`#68bfa1`,`#2a9c9c`,`#02778e`,`#045275`],7:[`#f7feae`,`#b7e6a5`,`#7ccba2`,`#46aea0`,`#089099`,`#00718b`,`#045275`],tags:[`quantitative`]},Cne={2:[`#d1eeea`,`#2a5674`],3:[`#d1eeea`,`#68abb8`,`#2a5674`],4:[`#d1eeea`,`#85c4c9`,`#4f90a6`,`#2a5674`],5:[`#d1eeea`,`#96d0d1`,`#68abb8`,`#45829b`,`#2a5674`],6:[`#d1eeea`,`#a1d7d6`,`#79bbc3`,`#599bae`,`#3f7994`,`#2a5674`],7:[`#d1eeea`,`#a8dbd9`,`#85c4c9`,`#68abb8`,`#4f90a6`,`#3b738f`,`#2a5674`],tags:[`quantitative`]},wne={2:[`#b0f2bc`,`#257d98`],3:[`#b0f2bc`,`#4cc8a3`,`#257d98`],4:[`#b0f2bc`,`#67dba5`,`#38b2a3`,`#257d98`],5:[`#b0f2bc`,`#77e2a8`,`#4cc8a3`,`#31a6a2`,`#257d98`],6:[`#b0f2bc`,`#82e6aa`,`#5bd4a4`,`#3fbba3`,`#2e9ea1`,`#257d98`],7:[`#b0f2bc`,`#89e8ac`,`#67dba5`,`#4cc8a3`,`#38b2a3`,`#2c98a0`,`#257d98`],tags:[`quantitative`]},Tne={2:[`#f3e0f7`,`#63589f`],3:[`#f3e0f7`,`#b998dd`,`#63589f`],4:[`#f3e0f7`,`#d1afe8`,`#9f82ce`,`#63589f`],5:[`#f3e0f7`,`#dbbaed`,`#b998dd`,`#9178c4`,`#63589f`],6:[`#f3e0f7`,`#e0c2ef`,`#c8a5e4`,`#aa8bd4`,`#8871be`,`#63589f`],7:[`#f3e0f7`,`#e4c7f1`,`#d1afe8`,`#b998dd`,`#9f82ce`,`#826dba`,`#63589f`],tags:[`quantitative`]},Ene={2:[`#f9ddda`,`#573b88`],3:[`#f9ddda`,`#ce78b3`,`#573b88`],4:[`#f9ddda`,`#e597b9`,`#ad5fad`,`#573b88`],5:[`#f9ddda`,`#eda8bd`,`#ce78b3`,`#9955a8`,`#573b88`],6:[`#f9ddda`,`#f0b2c1`,`#dd8ab6`,`#bb69b0`,`#8c4fa4`,`#573b88`],7:[`#f9ddda`,`#f2b9c4`,`#e597b9`,`#ce78b3`,`#ad5fad`,`#834ba0`,`#573b88`],tags:[`quantitative`]},Dne={2:[`#f3e79b`,`#5c53a5`],3:[`#f3e79b`,`#eb7f86`,`#5c53a5`],4:[`#f3e79b`,`#f8a07e`,`#ce6693`,`#5c53a5`],5:[`#f3e79b`,`#fab27f`,`#eb7f86`,`#b95e9a`,`#5c53a5`],6:[`#f3e79b`,`#fabc82`,`#f59280`,`#dc6f8e`,`#ab5b9e`,`#5c53a5`],7:[`#f3e79b`,`#fac484`,`#f8a07e`,`#eb7f86`,`#ce6693`,`#a059a0`,`#5c53a5`],tags:[`quantitative`]},One={2:[`#f3cbd3`,`#6c2167`],3:[`#f3cbd3`,`#ca699d`,`#6c2167`],4:[`#f3cbd3`,`#dd88ac`,`#b14d8e`,`#6c2167`],5:[`#f3cbd3`,`#e498b4`,`#ca699d`,`#a24186`,`#6c2167`],6:[`#f3cbd3`,`#e7a2b9`,`#d67ba5`,`#bc5894`,`#983a81`,`#6c2167`],7:[`#f3cbd3`,`#eaa9bd`,`#dd88ac`,`#ca699d`,`#b14d8e`,`#91357d`,`#6c2167`],tags:[`quantitative`]},kne={2:[`#fcde9c`,`#7c1d6f`],3:[`#fcde9c`,`#e34f6f`,`#7c1d6f`],4:[`#fcde9c`,`#f0746e`,`#dc3977`,`#7c1d6f`],5:[`#fcde9c`,`#f58670`,`#e34f6f`,`#d72d7c`,`#7c1d6f`],6:[`#fcde9c`,`#f89872`,`#ec666d`,`#df4273`,`#c5287b`,`#7c1d6f`],7:[`#fcde9c`,`#faa476`,`#f0746e`,`#e34f6f`,`#dc3977`,`#b9257a`,`#7c1d6f`],tags:[`quantitative`]},Ane={2:[`#4b2991`,`#edd9a3`],3:[`#4b2991`,`#ea4f88`,`#edd9a3`],4:[`#4b2991`,`#c0369d`,`#fa7876`,`#edd9a3`],5:[`#4b2991`,`#a52fa2`,`#ea4f88`,`#fa9074`,`#edd9a3`],6:[`#4b2991`,`#932da3`,`#d43f96`,`#f7667c`,`#f89f77`,`#edd9a3`],7:[`#4b2991`,`#872ca2`,`#c0369d`,`#ea4f88`,`#fa7876`,`#f6a97a`,`#edd9a3`],tags:[`aggregation`]},jne={2:[`#ede5cf`,`#541f3f`],3:[`#ede5cf`,`#c1766f`,`#541f3f`],4:[`#ede5cf`,`#d39c83`,`#a65461`,`#541f3f`],5:[`#ede5cf`,`#daaf91`,`#c1766f`,`#95455a`,`#541f3f`],6:[`#ede5cf`,`#ddba9b`,`#cd8c7a`,`#b26166`,`#8a3c56`,`#541f3f`],7:[`#ede5cf`,`#e0c2a2`,`#d39c83`,`#c1766f`,`#a65461`,`#813753`,`#541f3f`],tags:[`quantitative`]},Mne={2:[`#929b4f`,`#db8195`],3:[`#a3ad62`,`#fdfbe4`,`#df91a3`],4:[`#929b4f`,`#d9dbaf`,`#f3d1ca`,`#db8195`],5:[`#879043`,`#c1c68c`,`#fdfbe4`,`#ebb4b8`,`#d8758b`],6:[`#7f883b`,`#b0b874`,`#e3e4be`,`#f6ddd1`,`#e4a0ac`,`#d66d85`],7:[`#798234`,`#a3ad62`,`#d0d3a2`,`#fdfbe4`,`#f0c6c3`,`#df91a3`,`#d46780`],tags:[`diverging`]},Nne={2:[`#3d5941`,`#ca562c`],3:[`#3d5941`,`#f6edbd`,`#ca562c`],4:[`#3d5941`,`#b5b991`,`#edbb8a`,`#ca562c`],5:[`#3d5941`,`#96a07c`,`#f6edbd`,`#e6a272`,`#ca562c`],6:[`#3d5941`,`#839170`,`#cecea2`,`#f1cf9e`,`#e19464`,`#ca562c`],7:[`#3d5941`,`#778868`,`#b5b991`,`#f6edbd`,`#edbb8a`,`#de8a5a`,`#ca562c`],tags:[`diverging`]},Pne={2:[`#008080`,`#ca562c`],3:[`#008080`,`#f6edbd`,`#ca562c`],4:[`#008080`,`#b4c8a8`,`#edbb8a`,`#ca562c`],5:[`#008080`,`#92b69e`,`#f6edbd`,`#e6a272`,`#ca562c`],6:[`#008080`,`#7eab98`,`#ced7b1`,`#f1cf9e`,`#e19464`,`#ca562c`],7:[`#008080`,`#70a494`,`#b4c8a8`,`#f6edbd`,`#edbb8a`,`#de8a5a`,`#ca562c`],tags:[`diverging`]},Fne={2:[`#009392`,`#cf597e`],3:[`#009392`,`#e9e29c`,`#cf597e`],4:[`#009392`,`#9ccb86`,`#eeb479`,`#cf597e`],5:[`#009392`,`#71be83`,`#e9e29c`,`#ed9c72`,`#cf597e`],6:[`#009392`,`#52b684`,`#bcd48c`,`#edc783`,`#eb8d71`,`#cf597e`],7:[`#009392`,`#39b185`,`#9ccb86`,`#e9e29c`,`#eeb479`,`#e88471`,`#cf597e`],tags:[`diverging`]},Ine={2:[`#009392`,`#d0587e`],3:[`#009392`,`#f1eac8`,`#d0587e`],4:[`#009392`,`#91b8aa`,`#f1eac8`,`#dfa0a0`,`#d0587e`],5:[`#009392`,`#91b8aa`,`#f1eac8`,`#dfa0a0`,`#d0587e`],6:[`#009392`,`#72aaa1`,`#b1c7b3`,`#e5b9ad`,`#d98994`,`#d0587e`],7:[`#009392`,`#72aaa1`,`#b1c7b3`,`#f1eac8`,`#e5b9ad`,`#d98994`,`#d0587e`],tags:[`diverging`]},Lne={2:[`#009B9E`,`#C75DAB`],3:[`#009B9E`,`#F1F1F1`,`#C75DAB`],4:[`#009B9E`,`#A7D3D4`,`#E4C1D9`,`#C75DAB`],5:[`#009B9E`,`#7CC5C6`,`#F1F1F1`,`#DDA9CD`,`#C75DAB`],6:[`#009B9E`,`#5DBCBE`,`#C6DFDF`,`#E9D4E2`,`#D99BC6`,`#C75DAB`],7:[`#009B9E`,`#42B7B9`,`#A7D3D4`,`#F1F1F1`,`#E4C1D9`,`#D691C1`,`#C75DAB`],tags:[`diverging`]},Rne={2:[`#A16928`,`#2887a1`],3:[`#A16928`,`#edeac2`,`#2887a1`],4:[`#A16928`,`#d6bd8d`,`#b5c8b8`,`#2887a1`],5:[`#A16928`,`#caa873`,`#edeac2`,`#98b7b2`,`#2887a1`],6:[`#A16928`,`#c29b64`,`#e0cfa2`,`#cbd5bc`,`#85adaf`,`#2887a1`],7:[`#A16928`,`#bd925a`,`#d6bd8d`,`#edeac2`,`#b5c8b8`,`#79a7ac`,`#2887a1`],tags:[`diverging`]},zne={2:[`#855C75`,`#D9AF6B`,`#7C7C7C`],3:[`#855C75`,`#D9AF6B`,`#AF6458`,`#7C7C7C`],4:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#7C7C7C`],5:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#7C7C7C`],6:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#625377`,`#7C7C7C`],7:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#625377`,`#68855C`,`#7C7C7C`],8:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#625377`,`#68855C`,`#9C9C5E`,`#7C7C7C`],9:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#625377`,`#68855C`,`#9C9C5E`,`#A06177`,`#7C7C7C`],10:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#625377`,`#68855C`,`#9C9C5E`,`#A06177`,`#8C785D`,`#7C7C7C`],11:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#625377`,`#68855C`,`#9C9C5E`,`#A06177`,`#8C785D`,`#467378`,`#7C7C7C`],tags:[`qualitative`]},Bne={2:[`#7F3C8D`,`#11A579`,`#A5AA99`],3:[`#7F3C8D`,`#11A579`,`#3969AC`,`#A5AA99`],4:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#A5AA99`],5:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#A5AA99`],6:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#80BA5A`,`#A5AA99`],7:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#80BA5A`,`#E68310`,`#A5AA99`],8:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#80BA5A`,`#E68310`,`#008695`,`#A5AA99`],9:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#80BA5A`,`#E68310`,`#008695`,`#CF1C90`,`#A5AA99`],10:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#80BA5A`,`#E68310`,`#008695`,`#CF1C90`,`#f97b72`,`#A5AA99`],11:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#80BA5A`,`#E68310`,`#008695`,`#CF1C90`,`#f97b72`,`#4b4b8f`,`#A5AA99`],tags:[`qualitative`]},Vne={2:[`#66C5CC`,`#F6CF71`,`#B3B3B3`],3:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#B3B3B3`],4:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#B3B3B3`],5:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#B3B3B3`],6:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#9EB9F3`,`#B3B3B3`],7:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#9EB9F3`,`#FE88B1`,`#B3B3B3`],8:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#9EB9F3`,`#FE88B1`,`#C9DB74`,`#B3B3B3`],9:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#9EB9F3`,`#FE88B1`,`#C9DB74`,`#8BE0A4`,`#B3B3B3`],10:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#9EB9F3`,`#FE88B1`,`#C9DB74`,`#8BE0A4`,`#B497E7`,`#B3B3B3`],11:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#9EB9F3`,`#FE88B1`,`#C9DB74`,`#8BE0A4`,`#B497E7`,`#D3B484`,`#B3B3B3`],tags:[`qualitative`]},Hne={2:[`#5F4690`,`#1D6996`,`#666666`],3:[`#5F4690`,`#1D6996`,`#38A6A5`,`#666666`],4:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#666666`],5:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#666666`],6:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#EDAD08`,`#666666`],7:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#EDAD08`,`#E17C05`,`#666666`],8:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#EDAD08`,`#E17C05`,`#CC503E`,`#666666`],9:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#EDAD08`,`#E17C05`,`#CC503E`,`#94346E`,`#666666`],10:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#EDAD08`,`#E17C05`,`#CC503E`,`#94346E`,`#6F4070`,`#666666`],11:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#EDAD08`,`#E17C05`,`#CC503E`,`#94346E`,`#6F4070`,`#994E95`,`#666666`],tags:[`qualitative`]},Une={2:[`#88CCEE`,`#CC6677`,`#888888`],3:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#888888`],4:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#888888`],5:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#888888`],6:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#AA4499`,`#888888`],7:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#AA4499`,`#44AA99`,`#888888`],8:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#AA4499`,`#44AA99`,`#999933`,`#888888`],9:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#AA4499`,`#44AA99`,`#999933`,`#882255`,`#888888`],10:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#AA4499`,`#44AA99`,`#999933`,`#882255`,`#661100`,`#888888`],11:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#AA4499`,`#44AA99`,`#999933`,`#882255`,`#661100`,`#6699CC`,`#888888`],tags:[`qualitative`,`colorblind`]},Wne={2:[`#E58606`,`#5D69B1`,`#A5AA99`],3:[`#E58606`,`#5D69B1`,`#52BCA3`,`#A5AA99`],4:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#A5AA99`],5:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#A5AA99`],6:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#24796C`,`#A5AA99`],7:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#24796C`,`#DAA51B`,`#A5AA99`],8:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#24796C`,`#DAA51B`,`#2F8AC4`,`#A5AA99`],9:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#24796C`,`#DAA51B`,`#2F8AC4`,`#764E9F`,`#A5AA99`],10:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#24796C`,`#DAA51B`,`#2F8AC4`,`#764E9F`,`#ED645A`,`#A5AA99`],11:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#24796C`,`#DAA51B`,`#2F8AC4`,`#764E9F`,`#ED645A`,`#CC3A8E`,`#A5AA99`],tags:[`qualitative`]},Gne={...k9.BuGn,tags:[`quantitative`]},Kne={...k9.BuPu,tags:[`quantitative`]},qne={...k9.GnBu,tags:[`quantitative`]},Jne={...k9.OrRd,tags:[`quantitative`]},Yne={...k9.PuBu,tags:[`quantitative`]},Xne={...k9.PuBuGn,tags:[`quantitative`]},Zne={...k9.PuRd,tags:[`quantitative`]},Qne={...k9.RdPu,tags:[`quantitative`]},$ne={...k9.YlGn,tags:[`quantitative`]},ere={...k9.YlGnBu,tags:[`quantitative`]},tre={...k9.YlOrBr,tags:[`quantitative`]},nre={...k9.YlOrRd,tags:[`quantitative`]},rre={...k9.Accent,tags:[`qualitative`]},ire={...k9.Dark2,tags:[`qualitative`]},are={...k9.Paired,tags:[`qualitative`]},ore={...k9.Pastel1,tags:[`qualitative`]},sre={...k9.Pastel2,tags:[`qualitative`]},cre={...k9.Set1,tags:[`qualitative`]},lre={...k9.Set2,tags:[`qualitative`]},ure={...k9.Set3,tags:[`qualitative`]},dre={...k9.Blues,tags:[`quantitative`]},fre={...k9.Greens,tags:[`quantitative`]},pre={...k9.Greys,tags:[`quantitative`]},mre={...k9.Oranges,tags:[`quantitative`]},hre={...k9.Purples,tags:[`quantitative`]},gre={...k9.Reds,tags:[`quantitative`]},_re={...k9.BrBG,tags:[`diverging`]},vre={...k9.PiYG,tags:[`diverging`]},yre={...k9.PRGn,tags:[`diverging`]},bre={...k9.PuOr,tags:[`diverging`]},xre={...k9.RdBu,tags:[`diverging`]},Sre={...k9.RdGy,tags:[`diverging`]},Cre={...k9.RdYlBu,tags:[`diverging`]},wre={...k9.RdYlGn,tags:[`diverging`]},Tre={...k9.Spectral,tags:[`diverging`]},A9=`PurpOr`,j9=[204,204,204],Ere=[119,119,119];function M9(e,t){let n=une[e],r=t;q5(n,`Palette "${e}" not found. Expected a CARTOColors string`);let i=Object.keys(n).filter(e=>e!==`tags`).map(Number),a=Math.max(...i),o=Math.min(...i);!Number.isInteger(t)||t>a?r=a:tDre(e))}function Dre(e){let t=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(e);return t?[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),255]:(t=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(e),t?[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),parseInt(t[4]+t[4],16)]:(t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e),t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),255]:(t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e),q5(t,`Hexadecimal color "${e}" was not parsed correctly`),[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),parseInt(t[4],16)])))}var Ore=Object.freeze([`function`,`string`]);function N9(e,t,n){return q5(typeof t==`object`,`Expected "data" to be an object`),q5(Ore.includes(typeof e),`Expected "attr" to be a function or string`),typeof e==`function`?e(t,n):t?.properties?.[e]}function kre({attr:e,domain:t,colors:n=A9,nullColor:r=j9}){q5(Array.isArray(t),`Expected "domain" to be an array of numbers`);let i=typeof n==`string`?M9(n,t.length+1):n,a=pe().domain(t).range(i);return(t,n)=>{let i=N9(e,t,n);return typeof i==`number`&&Number.isFinite(i)?a(i):r}}function Are({attr:e,domain:t,colors:n=A9,nullColor:r=j9,othersColor:i=Ere}){q5(Array.isArray(t),`Expected "domain" to be an array of numbers or strings`);let a={},o=typeof n==`string`?M9(n,t.length):n;for(let[e,n]of t.entries())a[n]=o[e];return(t,n)=>{let o=N9(e,t,n);return typeof o==`number`&&Number.isFinite(o)||typeof o==`string`?a[o]||i:r}}function jre({attr:e,domain:t,colors:n=A9,nullColor:r=j9}){q5(Array.isArray(t),`Expected "domain" to be an array of numbers`);let i=typeof n==`string`?M9(n,t.length):n,a=fe().domain(t).range(i);return(t,n)=>{let i=N9(e,t,n);return typeof i==`number`&&Number.isFinite(i)?a(i):r}}var Mre={ClusterTileLayer:W7,H3TileLayer:K7,HeatmapTileLayer:r9,PointLabelLayer:u9,QuadbinTileLayer:$7,RasterTileLayer:v9,VectorTileLayer:O9},Nre=`@@type`,Pre=`@@function`;function Fre(e,t){let n=Lre(t),r=e;for(let e of n)r=Ire(r)?r[e]:void 0;return r}function Ire(e){return typeof e==`object`&&!!e}var P9={};function Lre(e){if(typeof e==`string`){let t=P9[e];return t||(t=e.split(`.`),P9[e]=t),t}return Array.isArray(e)?e:[e]}var Rre=t(r(((e,t)=>{(function(n){var r=`Compound`,i=`MemberExpression`,a=`Literal`,o=function(e,t){var n=Error(e+` at character `+t);throw n.index=t,n.description=e,n},s=!0,c={"-":s,"!":s,"~":s,"+":s},l={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},u=function(e){var t=0,n;for(var r in e)(n=r.length)>t&&e.hasOwnProperty(r)&&(t=n);return t},d=u(c),f=u(l),p={true:!0,false:!1,null:null},m=`this`,h=function(e){return l[e]||0},g=function(e,t,n){return{type:e===`||`||e===`&&`?`LogicalExpression`:`BinaryExpression`,operator:e,left:t,right:n}},_=function(e){return e>=48&&e<=57},v=function(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=128&&!l[String.fromCharCode(e)]},y=function(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e>=128&&!l[String.fromCharCode(e)]},b=function(e){for(var t=0,n=e.charAt,s=e.charCodeAt,u=function(t){return n.call(e,t)},b=function(t){return s.call(e,t)},x=e.length,S=function(){for(var e=b(t);e===32||e===9||e===10||e===13;)e=b(++t)},C=function(){var e=T(),n,r;if(S(),b(t)===63){if(t++,n=C(),n||o(`Expected expression`,t),S(),b(t)===58)return t++,r=C(),r||o(`Expected expression`,t),{type:`ConditionalExpression`,test:e,consequent:n,alternate:r};o(`Expected :`,t)}else return e},w=function(){S();for(var n=e.substr(t,f),r=n.length;r>0;){if(l.hasOwnProperty(n)&&(!v(b(t))||t+n.length2&&r<=i[i.length-2].prec;)c=i.pop(),n=i.pop().value,s=i.pop(),e=g(n,s,c),i.push(e);e=E(),e||o(`Expected expression after `+u,t),i.push(a,e)}for(l=i.length-1,e=i[l];l>1;)e=g(i[l-1].value,i[l-2],e),l-=2;return e},E=function(){var n,r,i;if(S(),n=b(t),_(n)||n===46)return D();if(n===39||n===34)return O();if(n===91)return N();for(r=e.substr(t,d),i=r.length;i>0;){if(c.hasOwnProperty(r)&&(!v(b(t))||t+r.length=i.length&&o(`Unexpected token `+String.fromCharCode(e),t);break}else if(n===44){if(t++,c++,c!==i.length){if(e===41)o(`Unexpected token ,`,t);else if(e===93)for(var l=i.length;le||t,"&&":(e,t)=>e&&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"&":(e,t)=>e&t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"<":(e,t)=>e":(e,t)=>e>t,"<=":(e,t)=>e<=t,">=":(e,t)=>e>=t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"%":(e,t)=>e%t},zre={"-":e=>-e,"+":e=>+e,"~":e=>~e,"!":e=>!e};function I9(e,t){return e.map(function(e){return R9(e,t)})}function L9(e,t){let n=R9(e.object,t),r;if(r=e.computed?R9(e.property,t):e.property.name,/^__proto__|prototype|constructor$/.test(r))throw Error(`Access to member "${r}" disallowed.`);return[n,n[r]]}function R9(e,t){let n=e;switch(n.type){case`ArrayExpression`:return I9(n.elements,t);case`BinaryExpression`:return F9[n.operator](R9(n.left,t),R9(n.right,t));case`CallExpression`:let e,r,i;return n.callee.type===`MemberExpression`?(i=L9(n.callee,t),e=i[0],r=i[1]):r=R9(n.callee,t),typeof r==`function`?r.apply(e,I9(n.arguments,t)):void 0;case`ConditionalExpression`:return R9(n.test,t)?R9(n.consequent,t):R9(n.alternate,t);case`Identifier`:return t[n.name];case`Literal`:return n.value;case`LogicalExpression`:return n.operator===`||`?R9(n.left,t)||R9(n.right,t):n.operator===`&&`?R9(n.left,t)&&R9(n.right,t):F9[n.operator](R9(n.left,t),R9(n.right,t));case`MemberExpression`:return L9(n,t)[1];case`ThisExpression`:return t;case`UnaryExpression`:return zre[n.operator](R9(n.argument,t));default:return}}var z9={"-":e=>e};function B9(e,t){if(e in z9)return z9[e];let n,r=(0,Rre.default)(e);return r.type===`Identifier`?n=t=>Fre(t,e):(V9(r,e=>{if(e.type===`CallExpression`)throw Error(`Function calls not allowed in JSON expressions`)}),n=e=>R9(r,e)),z9[e]=n,n}function V9(e,t){if(Array.isArray(e))e.forEach(e=>V9(e,t));else if(e&&typeof e==`object`){e.type&&t(e);for(let n in e)V9(e[n],t)}}var Bre=e=>e&&typeof e==`object`,H9=class e{constructor(t){this.config={...e.defaultProps},this.convertFunction=B9,this.preProcessClassProps=(e,t)=>t,this.postProcessConvertedJson=e=>e,this.merge(t)}merge(e){for(let t in e)if(t in this.config){let n=e[t];this.config[t]=Bre(this.config[t])?Object.assign(this.config[t],n):n}else t===`convertFunction`&&e.convertFunction?this.convertFunction=e.convertFunction:t===`preProcessClassProps`&&e.preProcessClassProps?this.preProcessClassProps=e.preProcessClassProps:t===`postProcessConvertedJson`&&e.postProcessConvertedJson&&(this.postProcessConvertedJson=e.postProcessConvertedJson)}getProps(){return{...this.config,convertFunction:this.convertFunction,preProcessClassProps:this.preProcessClassProps,postProcessConvertedJson:this.postProcessConvertedJson}}};H9.defaultProps={log:console,typeKey:Nre,functionKey:Pre,classes:{},reactComponents:{},enumerations:{},constants:{},functions:{},React:void 0};function Vre(e){return typeof e==`string`&&e.startsWith(`@@=`)}function Hre(e){return e.replace(`@@=`,``)}function U9(e,t){let n={};for(let r in e){let i=e[r];Vre(i)&&(i=B9(Hre(i),t)),n[r]=i}return n}function Ure(e,t,n){let r=n.config.classes[e],i=n.config.reactComponents[e];if(!r&&!i){let{log:r}=n.config;if(r){let n=JSON.stringify(t,null,0).slice(0,40);r.warn(`JSON converter: No registered class of type ${e}(${n}...) `)}return null}return r?Wre(r,t,n):Gre(i,t,n)}function Wre(e,t,n){return n.preProcessClassProps&&(t=n.preProcessClassProps(e,t)),t=U9(t,n),new e(t)}function Gre(e,t,n){let{React:r}=n.config,{children:i=[]}=t;return delete t.children,n.preProcessClassProps&&(t=n.preProcessClassProps(e,t)),t=U9(t,n),r.createElement(e,t,i)}function Kre(e,t,n){let r=n.config.functions[e];if(!r){let{log:r}=n.config;if(r){let n=JSON.stringify(t,null,0).slice(0,40);r.warn(`JSON converter: No registered function ${e}(${n}...) `)}return null}return r(t)}function qre(e){return typeof e==`string`?JSON.parse(e):e}function W9(e){return!!e&&typeof e==`object`}var Jre=class{constructor(e){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(e)}finalize(){}setProps(e){`configuration`in e&&(this.configuration=e.configuration instanceof H9?e.configuration:new H9(e.configuration)),`onJSONChange`in e&&(this.onJSONChange=e.onJSONChange)}mergeConfiguration(e){this.configuration.merge(e instanceof H9?e.getProps():e)}convert(e){if(!e||e===this.json)return this.convertedJson;this.json=e;let t=qre(e);if(!W9(t))throw Error(`JSONConverter: expected an object`);let n=Yre(t,this.configuration);return n=this.configuration.postProcessConvertedJson(n),this.convertedJson=n,n}convertJson(e){return this.convert(e)}};function Yre(e,t){return t=new H9(t.getProps()),G9(e,``,t)}function G9(e,t,n){return Array.isArray(e)?e.map((e,t)=>G9(e,String(t),n)):W9(e)?Xre(e,n)?Zre(e,n):`@@function`in e?Qre(e,n):K9(e,n):typeof e==`string`?$re(e,t,n):e}function Xre(e,t){let{typeKey:n}=t.config;return W9(e)&&!!e[n]}function Zre(e,t){let{typeKey:n}=t.config,r=e[n],i={...e};return delete i[n],i=K9(i,t),Ure(r,i,t)}function Qre(e,t){let{functionKey:n}=t.config,r=e[n],i={...e};return delete i[n],i=K9(i,t),Kre(r,i,t)}function K9(e,t){if(!W9(e))throw Error(`convertPlainObject: expected an object`);let n={};for(let[r,i]of Object.entries(e))n[r]=G9(i,r,t);return n}function $re(e,t,n){if(e.startsWith(`@@=`)&&n.convertFunction)return e=e.replace(`@@=`,``),n.convertFunction(e,n);if(e.startsWith(`@@#`)){if(e=e.replace(`@@#`,``),n.config.constants[e])return n.config.constants[e];let[t,r]=e.split(`.`);return n.config.enumerations[t][r]}return e}var q9=new Jre({configuration:{classes:{...oL,...R5,...Z3,...iQ,...Mre},functions:{colorBins:kre,colorCategories:Are,colorContinuous:jre}}}),eie={[X3.layerName]:[`getFillColor`],[NY.layerName]:[`getFillColor`],[jY.layerName]:[`getFillColor`],[I3.layerName]:[`getFillColor`],[Kq.layerName]:[`getFillColor`],[Vq.layerName]:[`getFillColor`],[DY.layerName]:[`getColor`],[mN.layerName]:[`getTargetColor`,`getSourceColor`],[JP.layerName]:[`getFillColor`],[aL.layerName]:[`getFillColor`],[FN.layerName]:[`getColor`],[LN.layerName]:[`getColor`],[uF.layerName]:[`getColor`],[VN.layerName]:[`getColor`],[UF.layerName]:[`getFillColor`],[WN.layerName]:[`getFillColor`,`getColor`,`getLineColor`],[zF.layerName]:[`getFillColor`],[HI.layerName]:[`getColor`],[rQ.layerName]:[`getColor`],[YY.layerName]:[`getColor`]},tie=({object:e,objectInfo:t,originalFillFunction:n})=>{let r=typeof n==`function`?n(e,t):n;if(Array.isArray(r))return[r[0]||0,r[1]||0,r[2]||0,r[3]||255];if(typeof r==`string`&&r.startsWith(`@@=`)){let t=q9.convert({originalColor:r}).originalColor(e);return[t[0]||0,t[1]||0,t[2]||0,t[3]||255]}return null},J9=({isSelected:e,object:t,objectInfo:n,opacity:r,originalFillFunction:i})=>{let a=tie({object:t,objectInfo:n,originalFillFunction:i});if(!a)return null;let o=e?Math.max(typeof a[3]==`number`?a[3]:r,r):Math.min(typeof a[3]==`number`?a[3]:r,r);return[a[0]||0,a[1]||0,a[2]||0,o]},nie=({isSelected:e,object:t,objectInfo:n,originalFillFunction:r,selectedColor:i,selectedOpacity:a=255,unselectedColor:o,unselectedOpacity:s=102})=>e?J9({opacity:a,isSelected:!0,object:t,objectInfo:n,originalFillFunction:r})||i:J9({opacity:s,isSelected:!1,object:t,objectInfo:n,originalFillFunction:r})||o,rie={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},iie=e=>String(e).replace(/[&<>"']/g,e=>rie[e]),Y9={selection:{indices:{},objects:{}}},X9=(e,t,n=!1)=>{let r=t.match(/{(.*?)}/g);return r&&r.forEach(r=>{let i=r.substring(1,r.length-1),a;if(Object.hasOwn(e.object,i))a=e.object[i];else if(Object.hasOwn(e.object,`properties`)&&Object.hasOwn(e.object.properties,i))a=e.object.properties[i];else return;let o=n?iie(a):String(a);t=t.replace(r,()=>o)}),t};function aie(e,t){return t.id?e.getElementState(t.id,`selection`)??Y9:Y9}function oie(e,t){if(!t.id)return Y9;let n=e.getStringValue(t);return(n?Vp.default.parse(n):null)??Y9}function sie(e,t,n,r){e.id&&t.setStringValue(e,JSON.stringify(n.value),{fromUi:n.fromUi},r)}var Z9=e=>{let t=new Map,n=!1;if(!e)return{layerData:t,hasUnknownLayerId:n};for(let r of e)if(r&&!Array.isArray(r)){if(d(r.id)){n=!0;continue}let e=`${r.id}`;t.set(e,Array.isArray(r.data)?r.data:void 0)}return{layerData:t,hasUnknownLayerId:n}},cie=(e,t,n)=>{let r=[],i=[],a=!1;return e.forEach((e,o)=>{if(e{let{layerData:n,hasUnknownLayerId:r}=t,i={},a={},o=!1;for(let[t,s]of Object.entries(e.indices)){let c=n.get(t);if(c===void 0){if(!n.has(t)){if(r&&n.size===0){i[t]=s,a[t]=e.objects[t]||[];continue}o=!0;continue}i[t]=s,a[t]=e.objects[t]||[];continue}let l=cie(s,e.objects[t]||[],c);l.changed&&(o=!0),l.validIndices.length>0&&(i[t]=l.validIndices,a[t]=l.validObjects)}return{indices:i,objects:a,changed:o}},uie=e=>{let{height:t,width:n,expanded:r}=k(le),{element:i,fragmentId:a,isLightTheme:o,theme:s,widgetMgr:c,widthConfig:l}=e,{selectionMode:u,tooltip:f}=i,m=r??!1,g=_(l),[v,y]=Re({element:i,getDefaultState:aie,getStateFromWidgetMgr:oie,updateWidgetMgrState:sie,widgetMgr:c,fragmentId:a}),[b,S]=(0,X.useState)(null),{height:C,width:w}=sN({element:{},isFullScreen:m,shouldUseContainerWidth:g,container:{height:t,width:n},heightFallback:b?.initialViewState?.height||s.sizes.defaultMapHeight}),T=(0,X.useRef)(null),E=u[0],D=E!==void 0,O=D&&Object.keys(v.selection.indices).length>0,A=(0,X.useMemo)(()=>Object.freeze(Vp.default.parse(i.json)),[m,o,i.json]);x(()=>{if(!D||!A.layers)return;let e=Z9(A.layers),t=lie(v.selection,e);t.changed&&y({fromUi:!1,value:{selection:{indices:t.indices,objects:t.objects}}})},[A,D]);let j=(0,X.useMemo)(()=>{let e={...A};if(e.mapStyle||=o?`https://basemaps.cartocdn.com/gl/positron-gl-style/style.json`:`https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json`,(e?.mapProvider==`carto`||e?.mapStyle&&e.mapStyle?.indexOf(`cartocdn`)>=0)&&!e.cartoKey&&(e.cartoKey=`x7g2plm9yq8vfrc`),e.layers){let{layerData:t}=Z9(e.layers),n=Object.entries(v.selection.indices).some(([e,n])=>{let r=t.get(e);return r===void 0?t.has(e)&&n?.length>0:n?.some(e=>eObject.hasOwn(e,`pickable`));e.layers=e.layers.map(e=>{if(!e||Array.isArray(e)||!D)return e;r||(e.pickable=!0);let t=d(e.id)?void 0:`${e.id}`,i=t===void 0?[]:v?.selection?.indices?.[t]||[],a=eie[e[`@@type`]];if(!a)return e;let o={...e};return a.forEach(t=>{o.updateTriggers={[t]:[...o.updateTriggers?.[t]||[],i,n]};let r=!n,a=e[t];if(r||!a)return;let c=h(s.colors.primary),l=[c[0],c[1],c[2],255],u=h(s.colors.gray20),d=[u[0],u[1],u[2],102];o[t]=(e,t)=>nie({isSelected:i.includes(t.index),object:e,objectInfo:t,originalFillFunction:a,selectedColor:l,unselectedColor:d,selectedOpacity:255,unselectedOpacity:102})}),o})}return delete e?.views,q9.convert(e)},[v.selection.indices,o,D,A,s.colors.gray20,s.colors.primary]);return(0,X.useEffect)(()=>{if(!p(j.initialViewState,T.current)){let e=Object.keys(j.initialViewState).reduce((e,t)=>j.initialViewState[t]===T.current?.[t]?e:{...e,[t]:j.initialViewState[t]},{});S(t=>({...t,...e})),T.current=j.initialViewState}},[j.initialViewState]),{createTooltip:(0,X.useCallback)(e=>{if(!e?.object||!f)return null;let t=Vp.default.parse(f);return t.html?t.html=X9(e,t.html,!0):t.text=X9(e,t.text),t},[f]),data:v,deck:j,hasActiveSelection:O,height:C,isSelectionModeActivated:D,onViewStateChange:(0,X.useCallback)(({viewState:e})=>{S(e)},[S]),selectionMode:E,setSelection:y,viewState:b,width:w}};ei([Ux,PE]);var Q9=Y9.selection,die=[],$9=e=>{let{disabled:t,disableFullscreenMode:n,element:r,fragmentId:i,heightConfig:s,widgetMgr:c,widthConfig:l}=e,{mapboxToken:d}=(0,X.useContext)(v),f=y(),{expanded:p,expand:h,collapse:_}=k(le),b=!!s?.useStretch,{createTooltip:x,data:S,deck:C,hasActiveSelection:w,isSelectionModeActivated:E,onViewStateChange:A,selectionMode:j,setSelection:M,viewState:N}=uie({element:r,fragmentId:i,isLightTheme:g(f),theme:f,widgetMgr:c,widthConfig:l}),P=r.mapboxToken||d,ee=C.mapProvider==`mapbox`||C?.mapStyle&&C.mapStyle?.indexOf(`mapbox`)>=0,[F,I]=(0,X.useState)(!1);(0,X.useEffect)(()=>{I(!0)},[]);let te=(0,X.useCallback)(e=>{if(j===void 0)return;let{index:t,object:n}=e,r=`${e.layer?.id||null}`,i=S,a=t===-1,o=(()=>{if(a)return Q9;switch(j){case u.SelectionMode.SINGLE_OBJECT:return i.selection.indices[r]?.[0]===t?Q9:{indices:{[`${r}`]:[t]},objects:{[`${r}`]:[n]}};case u.SelectionMode.MULTI_OBJECT:{let e=new Map((i?.selection?.indices?.[r]||[]).map((e,t)=>[e,i.selection?.objects?.[r]?.[t]]));if(e.has(t)?e.delete(t):e.set(t,n),e.size===0){let{[r]:e,...t}=i.selection.indices,{[r]:n,...a}=i.selection.objects;return{indices:t,objects:a}}return{indices:{...i.selection.indices,[`${r}`]:Array.from(e.keys())},objects:{...i.selection.objects,[`${r}`]:Array.from(e.values())}}}default:throw m(j),Error(`Invalid selection mode`)}})();JSON.stringify(o)!==JSON.stringify(i.selection)&&M({fromUi:!0,value:{selection:o}})},[j,S,M]),ne=(0,X.useCallback)(()=>{M({value:{selection:Q9},fromUi:!0})},[M]);return a(iN,{className:`stDeckGlJsonChart`,"data-testid":`stDeckGlJsonChart`,isStretchHeight:b,children:[ee?o(rN,{}):null,o(O,{isFullScreen:p,disableFullscreenMode:n,onExpand:h,onCollapse:_,target:iN,locked:w&&!t?!0:void 0,children:w&&!t&&o(D,{label:`Clear selection`,onClick:ne,icon:T})}),N&&o(aN,{children:a(Sx,{viewState:N,onViewStateChange:A,layers:F?C.layers:die,getTooltip:x,ContextProvider:zO.Provider,controller:!0,onClick:E&&!t?te:void 0,children:[o(tk,{mapStyle:C.mapStyle&&(typeof C.mapStyle==`string`?C.mapStyle:C.mapStyle[0]),mapboxApiAccessToken:P}),o(oN,{children:o(LM,{"data-testid":`stDeckGlJsonChartZoomButton`,showCompass:!1})})]})})]})},fie=ue($9),pie=(0,X.memo)(fie);export{$9 as DeckGlJsonChart,pie as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/Delete.esm.CDosXh7J.js b/venv/Lib/site-packages/streamlit/static/static/js/Delete.esm.CDosXh7J.js new file mode 100644 index 0000000000000000000000000000000000000000..2202e9595b81ed522cecd2fc61b676633094dd34 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/Delete.esm.CDosXh7J.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{y as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as r}from"./index.esm.DCRlH4DP.js";var i=e(t()),a=i.forwardRef(function(e,t){return i.createElement(r,n({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),i.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),i.createElement(`path`,{d:`M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z`}))});a.displayName=`Delete`;export{a as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/DownloadButton.BwGuQT8W.js b/venv/Lib/site-packages/streamlit/static/static/js/DownloadButton.BwGuQT8W.js new file mode 100644 index 0000000000000000000000000000000000000000..5fa5e0852652b5ace47412aee0f82552eadecb5a --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/DownloadButton.BwGuQT8W.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as n,i as r}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{i}from"./UriUtil.olyUCSHN.js";import{n as a,t as o}from"./styled-components.B5oT30oI.js";import{t as s}from"./BaseButton.DzUQ5vsa.js";import{t as c}from"./useTimeout.CUauXJkz.js";import{t as l}from"./BaseButtonTooltip.DyFZqtoX.js";import{i as u,t as d}from"./DynamicButtonLabel.UT8nPWDL.js";import{n as f,r as p}from"./styled-components.Dvviq2B_.js";import{t as m}from"./createDownloadLinkElement.CV8DGZx1.js";import{t as h}from"./iconPosition.CHJpUZea.js";var g=e(t(),1);function _(e){let{disabled:t,element:_,widgetMgr:v,endpoints:y,fragmentId:b}=e,{help:x,label:S,icon:C,ignoreRerun:w,type:T,url:E,deferredFileId:D}=_,O=_.shortcut?_.shortcut:void 0,[k,A]=(0,g.useState)(!1),[j,M]=(0,g.useState)(null),{enforceDownloadInNewTab:N=!1}=(0,g.useContext)(i),{backendOperationClient:P}=(0,g.useContext)(p),F=o.SECONDARY;T===`primary`?F=o.PRIMARY:T===`tertiary`&&(F=o.TERTIARY);let I=(0,g.useMemo)(()=>y.buildDownloadUrl(E),[y,E]);(0,g.useEffect)(()=>{D?.length||y.checkSourceUrlResponse(I,`Download Button`)},[I,y,D]);let L=(0,g.useCallback)(async()=>{if(!P||!D){M(`Deferred download not properly configured`);return}A(!0),M(null);try{let e=await P.requestDeferredFile(D),t=y.buildDownloadUrl(e.url);y.checkSourceUrlResponse(t,`Download Button`),m({filename:``,url:t,enforceDownloadInNewTab:N}).click()}catch(e){let t=e instanceof Error?e.message:`Download failed`;M(t)}finally{A(!1)}},[P,D,y,N]),R=(0,g.useCallback)(()=>{t||(w||v.setTriggerValue(_,{fromUi:!0},b),D?.length?L():m({filename:``,url:I,enforceDownloadInNewTab:N}).click())},[t,w,v,_,b,D,L,I,N]);u({shortcut:O,disabled:t,onActivate:R});let{clear:z,restart:B}=c(()=>{M(null)},5e3,{autoStart:!1});return(0,g.useEffect)(()=>{j?B():z()},[z,j,B]),n(`div`,{className:`stDownloadButton`,"data-testid":`stDownloadButton`,children:[r(l,{help:x,containerWidth:!0,children:r(s,{kind:F,size:a.SMALL,disabled:t||k,onClick:R,containerWidth:!0,children:r(d,{icon:k?`spinner`:C,iconPosition:h(_.iconPosition),label:S,shortcut:O})})}),j&&r(f,{"data-testid":`stDownloadButtonError`,children:j})]})}var v=(0,g.memo)(_);export{v as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/DynamicButtonLabel.UT8nPWDL.js b/venv/Lib/site-packages/streamlit/static/static/js/DynamicButtonLabel.UT8nPWDL.js new file mode 100644 index 0000000000000000000000000000000000000000..457fbe0662a5479cf87b61e6e9d8d29330f114bb --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/DynamicButtonLabel.UT8nPWDL.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as n,i as r}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{Bt as i}from"./utils.94RcZhG4.js";import{r as a}from"./StreamlitMarkdown.DJLoxxnS.js";import{t as o}from"./DynamicIcon.44zobID_.js";import{c as s,o as c,s as l}from"./styled-components.B5oT30oI.js";var u=e(t(),1),d=typeof navigator<`u`&&navigator.userAgent.toLowerCase().indexOf(`firefox`)>0;function f(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent(`on${t}`,n)}function p(e,t,n,r){e&&(e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent&&e.detachEvent(`on${t}`,n))}function m(e,t){let n=t.slice(0,t.length-1),r=[];for(let t=0;t=0;)t[n-1]+=`,`,t.splice(n,1),n=t.lastIndexOf(``);return t}function g(e,t){let n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0;for(let e=0;ev[e.toLowerCase()]||y[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),k=e=>Object.keys(v).find(t=>v[t]===e),A=e=>Object.keys(y).find(t=>y[t]===e),j=e=>{E=e||`all`},M=()=>E||`all`,ee=()=>C.slice(0),N=()=>C.map(e=>k(e)||A(e)||String.fromCharCode(e)),P=()=>{let e=[];return Object.keys(S).forEach(t=>{S[t].forEach(({key:t,scope:n,mods:r,shortcut:i})=>{e.push({scope:n,shortcut:i,mods:r,keys:t.split(`+`).map(e=>O(e))})})}),e},F=e=>{let t=e.target||e.srcElement,{tagName:n}=t,r=!0,i=n===`INPUT`&&![`checkbox`,`radio`,`range`,`button`,`file`,`reset`,`submit`,`color`].includes(t.type);return(t.isContentEditable||(i||n===`TEXTAREA`||n===`SELECT`)&&!t.readOnly)&&(r=!1),r},I=e=>(typeof e==`string`&&(e=O(e)),C.indexOf(e)!==-1),L=(e,t)=>{let n,r;e||=M();for(let t in S)if(Object.prototype.hasOwnProperty.call(S,t))for(n=S[t],r=0;rW(e)):r++;M()===e&&j(t||`all`)};function R(e){let t=_(e);e.key&&e.key.toLowerCase()===`capslock`&&(t=O(e.key));let n=C.indexOf(t);if(n>=0&&C.splice(n,1),e.key&&e.key.toLowerCase()===`meta`&&C.splice(0,C.length),(t===93||t===224)&&(t=91),t in x){x[t]=!1;for(let e in y)y[e]===t&&(U[e]=!1)}}var z=(e,...t)=>{if(e===void 0)Object.keys(S).forEach(e=>{Array.isArray(S[e])&&S[e].forEach(e=>B(e)),delete S[e]}),W(null);else if(Array.isArray(e))e.forEach(e=>{e.key&&B(e)});else if(typeof e==`object`)e.key&&B(e);else if(typeof e==`string`){let[n,r]=t;typeof n==`function`&&(r=n,n=``),B({key:e,scope:n,method:r,splitKey:`+`})}},B=({key:e,scope:t,method:n,splitKey:r=`+`})=>{h(e).forEach(e=>{let i=e.split(r),a=i.length,o=i[a-1],s=o===`*`?`*`:O(o);if(!S[s])return;t||=M();let c=a>1?m(y,i):[],l=[];S[s]=S[s].filter(e=>{let r=(!n||e.method===n)&&e.scope===t&&g(e.mods,c);return r&&l.push(e.element),!r}),l.forEach(e=>W(e))})};function V(e,t,n,r){if(t.element!==r)return;let i;if(t.scope===n||t.scope===`all`){i=t.mods.length>0;for(let e in x)Object.prototype.hasOwnProperty.call(x,e)&&(!x[e]&&t.mods.indexOf(+e)>-1||x[e]&&t.mods.indexOf(+e)===-1)&&(i=!1);(t.mods.length===0&&!x[16]&&!x[18]&&!x[17]&&!x[91]||i||t.shortcut===`*`)&&(t.keys=[],t.keys=t.keys.concat(C),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&=!0))}}function H(e,t){let n=S[`*`],r=_(e);if(e.key&&e.key.toLowerCase()===`capslock`||!(U.filter||F).call(this,e))return;if((r===93||r===224)&&(r=91),C.indexOf(r)===-1&&r!==229&&C.push(r),[`metaKey`,`ctrlKey`,`altKey`,`shiftKey`].forEach(t=>{let n=b[t];e[t]&&C.indexOf(n)===-1?C.push(n):!e[t]&&C.indexOf(n)>-1?C.splice(C.indexOf(n),1):t===`metaKey`&&e[t]&&(C=C.filter(e=>e in b||e===r))}),r in x){x[r]=!0;for(let t in y)Object.prototype.hasOwnProperty.call(y,t)&&(U[t]=e[b[y[t]]]);if(!n)return}for(let t in x)Object.prototype.hasOwnProperty.call(x,t)&&(x[t]=e[b[t]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState(`AltGraph`)&&(C.indexOf(17)===-1&&C.push(17),C.indexOf(18)===-1&&C.push(18),x[17]=!0,x[18]=!0);let i=M();if(n)for(let r=0;r1&&(a=m(y,e));let t=e[e.length-1];t=t===`*`?`*`:O(t),t in S||(S[t]=[]),S[t].push({keyup:l,keydown:u,scope:o,mods:a,shortcut:i[c],method:r,key:i[c],splitKey:d,element:s})}if(s!==void 0&&typeof window<`u`){if(!D.has(s)){let e=(e=window.event)=>H(e,s),t=(e=window.event)=>{H(e,s),R(e)};D.set(s,{keydownListener:e,keyupListenr:t,capture:p}),f(s,`keydown`,e,p),f(s,`keyup`,t,p)}if(!w){let e=()=>{C=[]};w={listener:e,capture:p},f(window,`focus`,e,p)}if(!T&&typeof document<`u`){let t=()=>{C=[];for(let e in x)x[e]=!1;for(let t in y)e[t]=!1},n=t,r=t;document.addEventListener(`fullscreenchange`,n),document.addEventListener(`webkitfullscreenchange`,r),T={fullscreen:n,webkit:r}}}};function te(e,t=`all`){Object.keys(S).forEach(n=>{S[n].filter(n=>n.scope===t&&n.shortcut===e).forEach(e=>{e&&e.method&&e.method({},e)})})}function W(e){let t=Object.values(S).flat();if(t.findIndex(({element:t})=>t===e)<0&&e){let{keydownListener:t,keyupListenr:n,capture:r}=D.get(e)||{};t&&n&&(p(e,`keyup`,n,r),p(e,`keydown`,t,r),D.delete(e))}if(t.length<=0||D.size<=0){if(Array.from(D.keys()).forEach(e=>{let{keydownListener:t,keyupListenr:n,capture:r}=D.get(e)||{};t&&n&&(p(e,`keyup`,n,r),p(e,`keydown`,t,r),D.delete(e))}),D.clear(),Object.keys(S).forEach(e=>delete S[e]),w){let{listener:e,capture:t}=w;p(window,`focus`,e,t),w=null}T&&typeof document<`u`&&(document.removeEventListener(`fullscreenchange`,T.fullscreen),document.removeEventListener(`webkitfullscreenchange`,T.webkit),T=null)}}var G={getPressedKeyString:N,setScope:j,getScope:M,deleteScope:L,getPressedKeyCodes:ee,getAllKeyCodes:P,isPressed:I,filter:F,trigger:te,unbind:z,keyMap:v,modifier:y,modifierMap:b};for(let e in G){let t=e;Object.prototype.hasOwnProperty.call(G,t)&&(U[t]=G[t])}if(typeof window<`u`){let e=window.hotkeys;U.noConflict=t=>(t&&window.hotkeys===U&&(window.hotkeys=e),U),window.hotkeys=U}typeof module<`u`&&module.exports&&(module.exports=U,module.exports.default=U);var K=new Set([`INPUT`,`TEXTAREA`,`SELECT`]),q=new Set([`ctrl`,`cmd`,`alt`,`shift`,`mod`]),J=new Set([`ctrl`,`cmd`,`alt`,`mod`]),Y=[`ctrl`,`cmd`,`alt`,`shift`,`mod`],X={ctrl:`Ctrl`,cmd:`⌘`,alt:`Alt`,shift:`Shift`,mod:`Mod`},Z={enter:`Enter`,space:`Space`,tab:`Tab`,escape:`Esc`,backspace:`Backspace`,delete:`Delete`,home:`Home`,end:`End`,pageup:`PageUp`,pagedown:`PageDown`,left:`←`,right:`→`,up:`↑`,down:`↓`},ne=new Set([`left`,`right`,`up`,`down`,`home`,`end`,`pageup`,`pagedown`,`backspace`,`delete`]),re=!1;function Q(e){let t=e.composedPath?.();if(t?.length){for(let e of t){let t=e;if(t?.tagName&&(K.has(t.tagName)||t.isContentEditable||t.getAttribute(`contenteditable`)===`true`))return t}return null}let n=e.target||e.srcElement;return n?.tagName&&(K.has(n.tagName)||n.isContentEditable||n.getAttribute(`contenteditable`)===`true`)?n:null}function ie(e){return e?!!Q(e):!1}function ae(){re||=(U.filter=e=>{if(!Q(e)||e.key===`Escape`||e.ctrlKey||e.metaKey||e.altKey)return!0;if(e.shiftKey){let t=e.key??``;if(t.length>1&&!/^[a-z0-9]$/i.test(t))return!0}return!1},!0)}function $(e){if(!e)return;let t=e.split(`+`).map(e=>e.trim().toLowerCase()).filter(Boolean);if(t.length===0)return;let n;for(let e=t.length-1;e>=0;--e){let r=t[e];if(!q.has(r)){n=r;break}}let r=t.some(e=>J.has(e));return{tokens:t,baseKey:n,hasSystemModifier:r}}function oe(e,t){if(!Q(t)||e.hasSystemModifier)return!1;let n=e.baseKey;return!!(!n||n.length===1&&/^[a-z0-9]$/i.test(n)||n===`space`||n===`tab`||n===`enter`||ne.has(n))}function se(e){return e.map(e=>e===`cmd`?`command`:e).join(`+`)}function ce(e){if(!e)return[];let{tokens:t}=e,n=i()?`cmd`:`ctrl`,r=t.map(e=>e===`cmd`||e===`ctrl`||e===`mod`?n:e);return[se(Array.from(new Set(r)))]}function le(e,t){return e===`cmd`||e===`ctrl`||e===`mod`?t?X.cmd:X.ctrl:e===`alt`&&t?`⌥`:X[e]}function ue(e){return Z[e]?Z[e]:(e.length===1||e.startsWith(`f`)&&/^\d+$/.test(e.slice(1)),e.toUpperCase())}function de(e,t){let n=$(e);if(!n)return;let r=t?.isMac??!1,i=[];if(Y.forEach(e=>{if(n.tokens.includes(e)){let t=le(e,r);t&&i.push(t)}}),n.baseKey&&i.push(ue(n.baseKey)),i.length!==0)return i.join(` + `)}function fe({shortcut:e,disabled:t=!1,onActivate:n}){let r=(0,u.useMemo)(()=>$(e),[e]),i=(0,u.useMemo)(()=>ce(r),[r]);(0,u.useEffect)(()=>{if(!r||i.length===0||t)return;let e=(e,i)=>{t||oe(r,e)||(e.preventDefault(),n())};return i.forEach(t=>{U(t,e)}),()=>{i.forEach(t=>{U.unbind(t,e)})}},[r,i,t,n])}var pe=({icon:e,label:t,iconSize:d,iconPosition:f=`left`,shortcut:p})=>{let m=(0,u.useMemo)(()=>de(p,{isMac:i()}),[p]);return r(c,{children:n(l,{"data-has-shortcut":!!m,children:[e&&f===`left`&&r(o,{size:d??`base`,iconValue:e}),t&&r(a,{source:t,allowHTML:!1,isLabel:!0,disableLinks:!0}),e&&f===`right`&&r(o,{size:d??`base`,iconValue:e}),m&&r(s,{"aria-label":`Shortcut ${m}`,children:m})]})})};export{U as a,fe as i,ae as n,ie as r,pe as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/DynamicIcon.44zobID_.js b/venv/Lib/site-packages/streamlit/static/static/js/DynamicIcon.44zobID_.js new file mode 100644 index 0000000000000000000000000000000000000000..97eb2ae75d12ca58d8769f35d9d625a14fe59e01 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/DynamicIcon.44zobID_.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{i as n,t as r}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{s as i}from"./utils.94RcZhG4.js";import{a,i as o,r as s,t as c}from"./Icon.RiOK8SDN.js";var l=e(t(),1),u=r(`span`,{target:`ed4y4ls0`})(({size:e,margin:t,padding:n,theme:r,color:a})=>({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,color:a,fontSize:r.iconSizes[e],width:r.iconSizes[e],height:r.iconSizes[e],margin:i(t,r),padding:i(n,r),userSelect:`none`,fontFamily:r.genericFonts.iconFont,fontWeight:r.fontWeights.normal,fontStyle:`normal`,lineHeight:r.lineHeights.none,letterSpacing:`normal`,textTransform:`none`,whiteSpace:`nowrap`,wordWrap:`normal`,direction:`ltr`,fontFeatureSettings:`liga`,MozFontFeatureSettings:`liga`,WebkitFontFeatureSettings:`liga`,WebkitFontSmoothing:`antialiased`})),d=({size:e,margin:t,padding:n,color:r})=>({size:e||`md`,margin:t||``,padding:n||``,color:r||`inherit`}),f=({iconName:e,...t})=>n(u,{...d(t),"data-testid":t.testid||`stIconMaterial`,translate:`no`,children:e});function p(e){let t=e.match(/^:(.+)\/(.+):$/);return t===null?{pack:`emoji`,icon:e}:{pack:t[1],icon:t[2]}}function m(e){if(!e)return!1;let t=p(e);return t.pack===`material`&&t.icon!==``}function h(e){let t=e.match(/^(:material\/\w+:)\s*(.*)$/);return t?{icon:t[1],text:t[2]}:{icon:null,text:e}}var g=new Set([`:material/menu:`,`:material/more_vert:`,`:material/more_horiz:`]);function _(e,t){return!e&&!!(t&&g.has(t.trim()))}function v(){return`data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfMTg2MF84NDMpIj48cGF0aCBkPSJNOS45OTk5NCAxNC4zOTE2TDEzLjQ1ODMgMTYuNDgzM0MxNC4wOTE2IDE2Ljg2NjYgMTQuODY2NiAxNi4zIDE0LjY5OTkgMTUuNTgzM0wxMy43ODMzIDExLjY1TDE2Ljg0MTYgOC45OTk5N0MxNy4zOTk5IDguNTE2NjMgMTcuMDk5OSA3LjU5OTk3IDE2LjM2NjYgNy41NDE2M0wxMi4zNDE2IDcuMTk5OTdMMTAuNzY2NiAzLjQ4MzNDMTAuNDgzMyAyLjgwODMgOS41MTY2MSAyLjgwODMgOS4yMzMyNyAzLjQ4MzNMNy42NTgyNyA3LjE5MTYzTDMuNjMzMjcgNy41MzMzQzIuODk5OTQgNy41OTE2MyAyLjU5OTk0IDguNTA4MyAzLjE1ODI3IDguOTkxNjNMNi4yMTY2MSAxMS42NDE2TDUuMjk5OTQgMTUuNTc1QzUuMTMzMjcgMTYuMjkxNiA1LjkwODI3IDE2Ljg1ODMgNi41NDE2MSAxNi40NzVMOS45OTk5NCAxNC4zOTE2WiIgZmlsbD0iI0ZBQ0EyQiIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImNsaXAwXzE4NjBfODQzIj48cmVjdCB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9IndoaXRlIi8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+`}var y=({iconValue:e,...t})=>{if(e===`spinner`)return n(s,{...t,children:n(a,{"aria-hidden":`true`,"data-testid":t.testid||`stSpinnerIcon`,...t})});let{pack:r,icon:i}=p(e);switch(r){case`material`:switch(i){case`star_filled`:return n(s,{...t,children:n(o,{src:v(),"data-testid":t.testid||`stImageIcon`})});default:return n(s,{...t,children:n(f,{pack:r,iconName:i,...t})})}default:return n(s,{...t,children:n(c,{...t,children:i})})}},b=e=>n(l.Suspense,{fallback:n(s,{...e,children:n(c,{...e,children:`\xA0`})}),children:n(y,{...e})},e.iconValue);export{p as a,_ as i,h as n,m as r,b as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/ErrorElement.BWmlOcKX.js b/venv/Lib/site-packages/streamlit/static/static/js/ErrorElement.BWmlOcKX.js new file mode 100644 index 0000000000000000000000000000000000000000..8f130e34baad287f623e5ce8bf8c2f9df4afe0d0 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/ErrorElement.BWmlOcKX.js @@ -0,0 +1,3 @@ +import{a as e,i as t,t as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{f as r}from"./getColors.DtAxY2Hd.js";var i=`-2.65rem`,a=n(`div`,{target:`e1plw2qp0`})(({theme:e,locked:t,target:n})=>({padding:`${e.spacing.sm} 0 ${e.spacing.sm} ${e.spacing.sm}`,position:`absolute`,top:t?i:`-1rem`,right:e.spacing.none,transition:`none`,...!t&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:`opacity 150ms 100ms, top 100ms 100ms`,opacity:1,top:`-2.65rem`},...n&&{[`${n}:hover &, ${n}:active &, ${n}:focus-visible &`]:{transition:`opacity 150ms 100ms, top 100ms 100ms`,opacity:1,top:`-2.65rem`}}}})),o=n(`div`,{target:`e1plw2qp1`})(({theme:e})=>({color:r(e)?e.colors.fadedText60:e.colors.bodyText,display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`flex-end`,boxShadow:e.shadows.toolbar,borderRadius:e.radii.default,backgroundColor:e.colors.lightenedBg05,width:`fit-content`,zIndex:e.zIndices.sidebar+1,padding:e.spacing.twoXS})),s=n(`div`,{target:`e1plw2qp2`})(({height:e,useContainerWidth:t,topCentered:n,useContainerHeight:r})=>({position:`relative`,height:t&&e?e:r?e||`100%`:`fit-content`,maxWidth:`100%`,width:t?`100%`:`fit-content`,...n?{display:`flex`,justifyContent:`center`}:{}})),c={"a > &":{color:`inherit`}},l=n(`code`,{target:`e19xqh4f0`})(({theme:e})=>({padding:`0.2em 0.4em`,overflowWrap:`break-word`,whiteSpace:`pre-wrap`,margin:0,borderRadius:e.radii.sm,background:e.colors.codeBackgroundColor,color:e.colors.codeTextColor,fontFamily:e.genericFonts.codeFont,fontSize:e.fontSizes.inlineCodeFontSize,fontWeight:e.fontWeights.code,...c})),u=(e,t)=>({background:`transparent`,border:0,color:`inherit`,display:`inline`,fontFamily:e.genericFonts.codeFont,fontSize:e.fontSizes.codeFontSize,fontWeight:e.fontWeights.code,lineHeight:`inherit`,margin:0,overflowX:`auto`,padding:0,whiteSpace:t?`pre-wrap`:`pre`,overflowWrap:t?`break-word`:`normal`,...c}),d=n(`code`,{target:`e19xqh4f1`})(({theme:e,wrapLines:t})=>({...u(e,t)})),f=n(`pre`,{target:`e19xqh4f2`})(({theme:e,wrapLines:t})=>({height:`100%`,background:e.colors.codeBackgroundColor,borderRadius:e.radii.default,color:e.colors.bodyText,fontSize:e.fontSizes.twoSm,fontFamily:e.genericFonts.codeFont,display:`block`,margin:0,msOverflowStyle:`scrollbar`,overflow:`auto`,padding:e.spacing.lg,code:{...u(e,t)},".comment.linenumber":{color:e.colors.fadedText40,fontSize:e.fontSizes.twoSm,alignSelf:`center`,minWidth:`${e.spacing.threeXL} !important`},".token.comment, .token.prolog, .token.doctype, .token.cdata":{color:e.colors.gray70},".token.punctuation":{color:e.colors.gray70},".namespace":{opacity:.7},".token.attr-name, .token.property, .token.variable":{color:e.colors.lightBlue80},".token.boolean, .token.constant, .token.symbol":{color:e.colors.green70},".token.number, .token.regex":{color:e.colors.blueGreen80},".token.string, .token.char, .token.attr-value":{color:e.colors.green80},".token.operator, .token.entity":{color:e.colors.orange90},".token.url":{color:e.colors.purple80},".token.decorator, .token.atrule":{color:e.colors.orange90},".token.keyword, .token.tag":{color:e.colors.blue70},".token.function, .token.class-name, .token.selector":{color:e.colors.blue70,fontWeight:e.fontWeights.codeExtraBold},".token.important":{color:e.colors.red70,fontWeight:e.fontWeights.codeExtraBold},".token.comment":{color:e.colors.gray70,fontStyle:`italic`},".token.italic":{fontStyle:`italic`},".token.entity":{cursor:`help`},".token.deleted.line, .token.deleted.prefix":{color:e.colors.red70},".token.inserted.line, .token.inserted.prefix":{color:e.colors.green70},".token.unchanged.line":{color:e.colors.gray70}})),p=`opacity 300ms 150ms`,m=`${p}, visibility 0ms linear 450ms`,h=`${p}, visibility 0ms linear 150ms`,g=n(`div`,{target:`e19xqh4f3`})(({theme:e})=>({opacity:0,visibility:`hidden`,padding:`${e.spacing.sm} ${e.spacing.sm} 0 0`,top:0,right:0,position:`absolute`,zIndex:e.zIndices.sidebar+1,pointerEvents:`none`,transition:m})),_=n(`div`,{target:`e19xqh4f4`})(({theme:e})=>({height:`100%`,position:`relative`,borderRadius:e.radii.default,marginLeft:e.spacing.none,marginRight:e.spacing.none,marginTop:e.spacing.none,marginBottom:void 0,"&:focus":{outline:`none`},"&:focus-visible":{boxShadow:e.shadows.focusRing},"&:hover, &:focus-visible, &:focus-within:has(:focus-visible)":{[`${g}`]:{opacity:1,visibility:`visible`,pointerEvents:`auto`,transition:h}}})),v=n(o,{target:`e19xqh4f5`})({pointerEvents:`auto`}),y=function(e){return e.ERROR=`error`,e.INFO=`info`,e.SUCCESS=`success`,e.WARNING=`warning`,e}({}),b={[y.ERROR]:{bg:`redBackgroundColor`,text:`redTextColor`},[y.WARNING]:{bg:`yellowBackgroundColor`,text:`yellowTextColor`},[y.INFO]:{bg:`blueBackgroundColor`,text:`blueTextColor`},[y.SUCCESS]:{bg:`greenBackgroundColor`,text:`greenTextColor`}},x=n(`div`,{target:`e7hqogy0`})(({theme:e,$kind:t,$width:n})=>({fontWeight:e.fontWeights.normal,marginTop:e.spacing.none,marginBottom:e.spacing.none,marginLeft:e.spacing.none,marginRight:e.spacing.none,...n?{width:`${n}px`}:{},borderRadius:e.radii.default,paddingTop:e.spacing.lg,paddingBottom:e.spacing.lg,paddingRight:e.spacing.lg,paddingLeft:e.spacing.lg,lineHeight:e.lineHeights.small,backgroundColor:e.colors[b[t].bg],color:e.colors[b[t].text]})),S=n(`div`,{target:`e7hqogy1`})(({theme:e})=>({pre:{backgroundColor:e.colors.transparent,paddingTop:e.spacing.lg,paddingBottom:e.spacing.lg,paddingRight:e.spacing.lg,paddingLeft:e.spacing.lg,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,"pre, code":{backgroundColor:e.colors.transparent,color:`inherit`}},code:{backgroundColor:e.colors.transparent,padding:e.spacing.none},"pre, code":{color:`inherit`},a:{color:`inherit`,textDecoration:`underline`}}));function C({kind:e,width:n,children:r}){let i=e.charAt(0).toUpperCase()+e.slice(1);return t(x,{$kind:e,$width:n,"data-testid":`stAlertContainer`,className:`stAlertContainer`,role:e===y.ERROR||e===y.WARNING?`alert`:`status`,children:t(S,{"data-testid":`stAlertContent${i}`,children:r})})}var w=n(`pre`,{target:`e1p6lu300`})(({theme:e})=>({whiteSpace:`pre-wrap`,wordWrap:`break-word`,color:`inherit`,fontSize:e.fontSizes.codeFontSize,fontFamily:e.genericFonts.codeFont,fontWeight:e.fontWeights.code,backgroundColor:e.colors.transparent,overflowX:`auto`,margin:0,borderRadius:e.radii.default,padding:e.spacing.lg,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`})),T=n(`strong`,{target:`e1p6lu301`})(({theme:e})=>({fontWeight:e.fontWeights.codeBold}));function E(n){let{name:r,message:i,stack:a,width:o}=n,s=a?a.split(` +`):[];s.shift();let c=s.map(e=>e.trim()).join(` +`);return e(C,{kind:y.ERROR,width:o,children:[e(T,{children:[r,`: `]}),i,a?t(w,{"data-testid":`stErrorElementStack`,children:t(d,{wrapLines:!1,children:c})}):null]})}export{d as a,g as c,o as d,s as f,y as i,l,w as n,_ as o,a as p,C as r,v as s,E as t,f as u}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/ErrorHandling.H5STbbYb.js b/venv/Lib/site-packages/streamlit/static/static/js/ErrorHandling.H5STbbYb.js new file mode 100644 index 0000000000000000000000000000000000000000..dca7935aed84a029b6d0c6a9605002dc3a1295c2 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/ErrorHandling.H5STbbYb.js @@ -0,0 +1 @@ +function e(e){return e instanceof Error?e:Error(`${e}`)}export{e as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/ErrorOutline.esm.CZ5wypOV.js b/venv/Lib/site-packages/streamlit/static/static/js/ErrorOutline.esm.CZ5wypOV.js new file mode 100644 index 0000000000000000000000000000000000000000..e5b04c9034374af9127df526cbed6d6d01e535ad --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/ErrorOutline.esm.CZ5wypOV.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{y as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as r}from"./index.esm.DCRlH4DP.js";var i=e(t()),a=i.forwardRef(function(e,t){return i.createElement(r,n({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),i.createElement(`path`,{d:`M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z`}))});a.displayName=`ErrorOutline`;export{a as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/Feedback.DgyQ79Uj.js b/venv/Lib/site-packages/streamlit/static/static/js/Feedback.DgyQ79Uj.js new file mode 100644 index 0000000000000000000000000000000000000000..733e2f891b4d0aa4ce815d318fb36d8dc39401de --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/Feedback.DgyQ79Uj.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{i as n,t as r}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{g as i}from"./protobuf.DC2L68b9.js";import{a}from"./utils.BrY_0PXX.js";import{t as o}from"./DynamicIcon.44zobID_.js";import{n as s}from"./useBasicWidgetState.CpWukz_T.js";var c=e(t(),1),l=r(`div`,{target:`e1fiu7py0`})(({containerWidth:e})=>({width:e?`100%`:`auto`,minWidth:`fit-content`})),u=r(`div`,{target:`e1fiu7py1`})(({theme:e})=>({display:`flex`,flexWrap:`nowrap`,gap:e.spacing.threeXS,minWidth:`fit-content`})),d=r(`button`,{target:`e1fiu7py2`})(({theme:e,isSelected:t})=>({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,padding:e.spacing.threeXS,margin:e.spacing.none,backgroundColor:e.colors.transparent,color:t?e.colors.bodyText:e.colors.fadedText60,border:`none`,borderRadius:e.radii.button,cursor:`pointer`,userSelect:`none`,minHeight:`unset`,flex:`0 0 fit-content`,"&:focus":{boxShadow:`none`,outline:`none`},"&:focus-visible":{boxShadow:e.shadows.focusRing},"&:hover:not(:disabled)":{color:e.colors.bodyText},"&:disabled":{color:t?e.colors.fadedText40:e.colors.fadedText10,cursor:`not-allowed`,img:{opacity:.4}}})),f=[`:material/thumb_up:`,`:material/thumb_down:`],p=[`:material/sentiment_sad:`,`:material/sentiment_dissatisfied:`,`:material/sentiment_neutral:`,`:material/sentiment_satisfied:`,`:material/sentiment_very_satisfied:`],m=`:material/star:`,h=`:material/star_filled:`,g=5;function _(e){switch(e){case i.FeedbackType.FACES:return p.map((e,t)=>({icon:e,selectedIcon:e,value:t}));case i.FeedbackType.STARS:return Array.from({length:g},(e,t)=>({icon:m,selectedIcon:h,value:t}));default:return[{icon:f[0],selectedIcon:f[0],value:1},{icon:f[1],selectedIcon:f[1],value:0}]}}function v(e,t){switch(t){case i.FeedbackType.THUMBS:return e===1?`Thumbs up`:`Thumbs down`;case i.FeedbackType.FACES:return[`Very dissatisfied`,`Dissatisfied`,`Neutral`,`Satisfied`,`Very satisfied`][e]??`Rating ${e+1}`;case i.FeedbackType.STARS:return`${e+1} out of ${g} stars`;default:return`Rating ${e+1}`}}function y(e,t,n){return t===null?!1:n===i.FeedbackType.STARS?e<=t:e===t}function b(e,t){let n=e.getStringValue(t);if(n!==void 0)return n===``?null:parseInt(n,10)}function x(e){return e.default??null}function S(e){return e.value??null}function C(e,t,n,r){let i=n.value===null?``:String(n.value);t.setStringValue(e,i,{fromUi:n.fromUi},r)}function w(e){let{disabled:t,element:r,fragmentId:i,widgetMgr:f,widthConfig:p}=e,{type:m}=r,[h,g]=s({getStateFromWidgetMgr:b,getDefaultStateFromProto:x,getCurrStateFromProto:S,updateWidgetMgrState:C,element:r,widgetMgr:f,fragmentId:i,formClearBehavior:`resetValueOnly`}),w=r.value??h,T=a(p),E=(0,c.useMemo)(()=>_(m),[m]),D=(0,c.useRef)([]),O=(0,c.useCallback)(e=>{g({value:w===e?null:e,fromUi:!0})},[w,g]),k=(0,c.useCallback)((e,t)=>{let n;switch(e.key){case`ArrowLeft`:case`ArrowUp`:e.preventDefault(),n=t>0?t-1:E.length-1;break;case`ArrowRight`:case`ArrowDown`:e.preventDefault(),n=t{let i=y(e.value,w,m),a=i?e.selectedIcon:e.icon;return n(d,{ref:e=>{D.current[r]=e},type:`button`,role:`radio`,"aria-checked":w===e.value,"aria-label":v(e.value,m),tabIndex:w===e.value||w===null&&r===0?0:-1,disabled:t,isSelected:i,onClick:()=>O(e.value),onKeyDown:e=>k(e,r),"data-testid":i?`stFeedbackButtonActive`:`stFeedbackButton`,children:n(o,{iconValue:a,size:`lg`})},e.value)})})})}var T=(0,c.memo)(w);export{T as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/FileDownload.esm.BM_tuzhj.js b/venv/Lib/site-packages/streamlit/static/static/js/FileDownload.esm.BM_tuzhj.js new file mode 100644 index 0000000000000000000000000000000000000000..0da692d4fd33fcd5c707dceb4939174cc55748fa --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/FileDownload.esm.BM_tuzhj.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{y as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as r}from"./index.esm.DCRlH4DP.js";var i=e(t()),a=i.forwardRef(function(e,t){return i.createElement(r,n({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),i.createElement(`rect`,{width:24,height:24,fill:`none`}),i.createElement(`path`,{d:`M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z`}))});a.displayName=`FileDownload`;export{a as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/FileSystemDirectoryHandle.p7DJujU-.js b/venv/Lib/site-packages/streamlit/static/static/js/FileSystemDirectoryHandle.p7DJujU-.js new file mode 100644 index 0000000000000000000000000000000000000000..173870585f788433d8f476362349ff5b114a794c --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/FileSystemDirectoryHandle.p7DJujU-.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FileSystemFileHandle.CU3-lWxj.js","./FileSystemHandle.CFTLjada.js","./util.D5poj9OK.js","./rolldown-runtime.DAXXjFlN.js","./preload-helper.HclGiUj8.js","./config.Mbx-WYSj.js"])))=>i.map(i=>d[i]); +import{t as e}from"./preload-helper.HclGiUj8.js";import{t}from"./FileSystemHandle.CFTLjada.js";import{t as n}from"./util.D5poj9OK.js";var{GONE:r,MOD_ERR:i}=n,a=Symbol(`adapter`),o=class n extends t{[a];constructor(e){super(e),this[a]=e}async getDirectoryHandle(e,t={}){if(e===``)throw TypeError(`Name can't be an empty string.`);if(e===`.`||e===`..`||e.includes(`/`))throw TypeError(`Name contains invalid characters.`);t.create=!!t.create;let r=await this[a].getDirectoryHandle(e,t);return new n(r)}async*entries(){let{FileSystemFileHandle:t}=await e(async()=>{let{FileSystemFileHandle:e}=await import(`./FileSystemFileHandle.CU3-lWxj.js`);return{FileSystemFileHandle:e}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);for await(let[e,r]of this[a].entries())yield[r.name,r.kind===`file`?new t(r):new n(r)]}async*getEntries(){let{FileSystemFileHandle:t}=await e(async()=>{let{FileSystemFileHandle:e}=await import(`./FileSystemFileHandle.CU3-lWxj.js`);return{FileSystemFileHandle:e}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);console.warn(`deprecated, use .entries() instead`);for await(let e of this[a].entries())yield e.kind===`file`?new t(e):new n(e)}async getFileHandle(t,n={}){let{FileSystemFileHandle:r}=await e(async()=>{let{FileSystemFileHandle:e}=await import(`./FileSystemFileHandle.CU3-lWxj.js`);return{FileSystemFileHandle:e}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);if(t===``)throw TypeError(`Name can't be an empty string.`);if(t===`.`||t===`..`||t.includes(`/`))throw TypeError(`Name contains invalid characters.`);return n.create=!!n.create,new r(await this[a].getFileHandle(t,n))}async removeEntry(e,t={}){if(e===``)throw TypeError(`Name can't be an empty string.`);if(e===`.`||e===`..`||e.includes(`/`))throw TypeError(`Name contains invalid characters.`);return t.recursive=!!t.recursive,this[a].removeEntry(e,t)}async resolve(e){if(await e.isSameEntry(this))return[];let t=[{handle:this,path:[]}];for(;t.length;){let{handle:n,path:r}=t.pop();for await(let i of n.values()){if(await i.isSameEntry(e))return[...r,i.name];i.kind===`directory`&&t.push({handle:i,path:[...r,i.name]})}}return null}async*keys(){for await(let[e]of this[a].entries())yield e}async*values(){for await(let[e,t]of this)yield t}[Symbol.asyncIterator](){return this.entries()}};if(Object.defineProperty(o.prototype,Symbol.toStringTag,{value:`FileSystemDirectoryHandle`,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(o.prototype,{getDirectoryHandle:{enumerable:!0},entries:{enumerable:!0},getFileHandle:{enumerable:!0},removeEntry:{enumerable:!0}}),globalThis.FileSystemDirectoryHandle){let e=globalThis.FileSystemDirectoryHandle.prototype;e.resolve=async function(e){if(await e.isSameEntry(this))return[];let t=[{handle:this,path:[]}];for(;t.length;){let{handle:n,path:r}=t.pop();for await(let i of n.values()){if(await i.isSameEntry(e))return[...r,i.name];i.kind===`directory`&&t.push({handle:i,path:[...r,i.name]})}}return null};async function t(e){if(await(await navigator.storage.getDirectory()).resolve(e)===null)throw new DOMException(...r)}let n=e.entries;e.entries=async function*(){await t(this),yield*n.call(this)},e[Symbol.asyncIterator]=async function*(){yield*this.entries()};let a=e.removeEntry;e.removeEntry=async function(e,t={}){return a.call(this,e,t).catch(async e=>{throw e instanceof DOMException&&e.name===`UnknownError`&&!t.recursive&&!(await n.call(this).next()).done?new DOMException(...i):e})}}export{o as FileSystemDirectoryHandle,o as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/FileSystemFileHandle.CU3-lWxj.js b/venv/Lib/site-packages/streamlit/static/static/js/FileSystemFileHandle.CU3-lWxj.js new file mode 100644 index 0000000000000000000000000000000000000000..f0bf85ed153b3b07751b37eecea1d663a0b3c7fd --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/FileSystemFileHandle.CU3-lWxj.js @@ -0,0 +1 @@ +import{t as e}from"./FileSystemHandle.CFTLjada.js";import{t}from"./util.D5poj9OK.js";import{t as n}from"./config.Mbx-WYSj.js";var{WritableStream:r}=n,i=class e extends r{#e;constructor(t){super(t),this.#e=t,Object.setPrototypeOf(this,e.prototype),this._closed=!1}async close(){this._closed=!0;let e=this.getWriter(),t=e.close();return e.releaseLock(),t}seek(e){return this.write({type:`seek`,position:e})}truncate(e){return this.write({type:`truncate`,size:e})}write(e){if(this._closed)return Promise.reject(TypeError(`Cannot write to a CLOSED writable stream`));let t=this.getWriter(),n=t.write(e);return t.releaseLock(),n}};Object.defineProperty(i.prototype,Symbol.toStringTag,{value:`FileSystemWritableFileStream`,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(i.prototype,{close:{enumerable:!0},seek:{enumerable:!0},truncate:{enumerable:!0},write:{enumerable:!0}}),globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable&&!globalThis.FileSystemWritableFileStream&&(globalThis.FileSystemWritableFileStream=i);var{INVALID:a,SYNTAX:o,GONE:s}=t,c=Symbol(`adapter`),l=class extends e{[c];constructor(e){super(e),this[c]=e}async createWritable(e={}){return new i(await this[c].createWritable(e))}async getFile(){return this[c].getFile()}};if(Object.defineProperty(l.prototype,Symbol.toStringTag,{value:`FileSystemFileHandle`,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(l.prototype,{createWritable:{enumerable:!0},getFile:{enumerable:!0}}),globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable){let e=new WeakMap,t,n=()=>{let e,t;onmessage=async n=>{let r=n.ports[0],i=n.data;switch(i.type){case`open`:let n=i.name,r=await navigator.storage.getDirectory();for(let e of i.path)r=await r.getDirectoryHandle(e);e=await r.getFileHandle(n),t=await e.createSyncAccessHandle();break;case`write`:t.write(i.data,{at:i.position}),t.flush();break;case`truncate`:t.truncate(i.size);break;case`abort`:case`close`:t.close();break}r.postMessage(0)}};globalThis.FileSystemFileHandle.prototype.createWritable=async function(r){if(!t){let e=`(${n.toString()})()`,r=new Blob([e],{type:`text/javascript`});t=URL.createObjectURL(r)}let c=new Worker(t,{type:`module`}),l=0,u=new TextEncoder,d=await this.getFile().then(e=>e.size),f=e=>new Promise((t,n)=>{let r=new MessageChannel;r.port1.onmessage=e=>{e.data instanceof Error?n(e.data):t(e.data),r.port1.close(),r.port2.close(),r.port1.onmessage=null},c.postMessage(e,[r.port2])}),p=await navigator.storage.getDirectory(),m=await e.get(this),h=await p.resolve(m);if(h===null)throw new DOMException(...s);return await f({type:`open`,path:h,name:this.name}),r?.keepExistingData===!1&&(await f({type:`truncate`,size:0}),d=0),new i({start:e=>{},async write(e){if(e=e?.constructor===Object?{...e}:{type:`write`,data:e,position:l},e.type===`write`){if(!(`data`in e))throw await f({type:`close`}),new DOMException(...o(`write requires a data argument`));if(e.position??=l,typeof e.data==`string`)e.data=u.encode(e.data);else if(e.data instanceof ArrayBuffer)e.data=new Uint8Array(e.data);else if(!(e.data instanceof Uint8Array)&&ArrayBuffer.isView(e.data))e.data=new Uint8Array(e.data.buffer,e.data.byteOffset,e.data.byteLength);else if(!(e.data instanceof Uint8Array)){let t=await new Response(e.data).arrayBuffer();e.data=new Uint8Array(t)}Number.isInteger(e.position)&&e.position>=0&&(l=e.position),l+=e.data.byteLength,d+=e.data.byteLength}else if(e.type===`seek`)if(Number.isInteger(e.position)&&e.position>=0){if(d=0)d=e.size,l>d&&(l=d);else throw await f({type:`close`}),new DOMException(...o(`truncate requires a size argument`));await f(e)},async close(){await f({type:`close`}),c.terminate()},async abort(e){await f({type:`abort`,reason:e}),c.terminate()}})};let r=FileSystemDirectoryHandle.prototype.getFileHandle;FileSystemDirectoryHandle.prototype.getFileHandle=async function(...t){let n=await r.call(this,...t);return e.set(n,this),n}}export{l as FileSystemFileHandle,l as default,i as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/FileSystemHandle.CFTLjada.js b/venv/Lib/site-packages/streamlit/static/static/js/FileSystemHandle.CFTLjada.js new file mode 100644 index 0000000000000000000000000000000000000000..5a133d99737bdf47a6b144b70b4e9f971f3e79f8 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/FileSystemHandle.CFTLjada.js @@ -0,0 +1 @@ +var e=Symbol(`adapter`),t=class{[e];name;kind;constructor(t){this.kind=t.kind,this.name=t.name,this[e]=t}async queryPermission(t={}){let{mode:n=`read`}=t,r=this[e];if(r.queryPermission)return r.queryPermission({mode:n});if(n===`read`)return`granted`;if(n===`readwrite`)return r.writable?`granted`:`denied`;throw TypeError(`Mode ${n} must be 'read' or 'readwrite'`)}async requestPermission({mode:t=`read`}={}){let n=this[e];if(n.requestPermission)return n.requestPermission({mode:t});if(t===`read`)return`granted`;if(t===`readwrite`)return n.writable?`granted`:`denied`;throw TypeError(`Mode ${t} must be 'read' or 'readwrite'`)}async remove(t={}){await this[e].remove(t)}async isSameEntry(t){return this===t?!0:!t||typeof t!=`object`||this.kind!==t.kind||!t[e]?!1:this[e].isSameEntry(t[e])}};Object.defineProperty(t.prototype,Symbol.toStringTag,{value:`FileSystemHandle`,writable:!1,enumerable:!1,configurable:!0}),globalThis.FileSystemHandle&&(globalThis.FileSystemHandle.prototype.queryPermission??=function(e){return`granted`});export{t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/FileUploader.Bg9tjvVJ.js b/venv/Lib/site-packages/streamlit/static/static/js/FileUploader.Bg9tjvVJ.js new file mode 100644 index 0000000000000000000000000000000000000000..c71e2154b50319127fed2e41dabbb6cc481e8b55 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/FileUploader.Bg9tjvVJ.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as n,i as r,r as i,t as a}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as o}from"./react-dom.DZwq-Xzd.js";import{Xt as s,c}from"./utils.94RcZhG4.js";import{_ as l,z as u}from"./protobuf.DC2L68b9.js";import{t as d}from"./types.cZoyy9Y-.js";import{t as f}from"./isEqual.CgNOpGTC.js";import{t as p}from"./zip.DLtjLZjW.js";import{n as m,t as h}from"./styled-components.B5oT30oI.js";import{t as g}from"./BaseButton.DzUQ5vsa.js";import{n as _}from"./FormClearHelper.D0Yt6KG5.js";import{t as v}from"./DynamicButtonLabel.UT8nPWDL.js";import{t as y}from"./useCalculatedDimensions.BnLCBgVi.js";import{a as b,c as x,d as S,f as C,i as w,l as T,n as E,o as D,p as O,r as k,s as A,t as j,u as M}from"./utils.Ca1sxtey.js";import{t as N}from"./WidgetLabel.CVV1ys75.js";import{t as P}from"./WidgetLabelHelpIcon.BmvkC-YW.js";import{t as F}from"./UploadFileInfo.WAP1L8Dh.js";var I=e(t(),1),L=e(o(),1),R=a(`section`,{target:`e3v525e0`})(({isDisabled:e,isDragActive:t,theme:n})=>({position:`relative`,display:`flex`,gap:n.spacing.lg,alignItems:`flex-start`,padding:n.spacing.md,backgroundColor:n.colors.secondaryBg,borderRadius:n.radii.default,border:n.colors.widgetBorderColor?`${n.sizes.borderWidth} solid ${n.colors.widgetBorderColor}`:void 0,height:`auto`,minHeight:n.sizes.largestElementHeight,":focus":{outline:`none`},":focus-visible":{boxShadow:n.shadows.focusRingOutline},cursor:e?`not-allowed`:`pointer`,...t&&{boxShadow:`inset 0 0 0 2px ${n.colors.primary}`}})),z=a(`div`,{target:`e3v525e1`})(({theme:e})=>({position:`absolute`,top:e.spacing.threeXS,right:e.spacing.threeXS,bottom:e.spacing.threeXS,left:e.spacing.threeXS,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:e.colors.secondaryBg,borderRadius:e.radii.default,zIndex:e.zIndices.priority})),B=a(`span`,{target:`e3v525e2`})(({theme:e})=>({color:e.colors.primary,fontSize:e.fontSizes.sm,fontWeight:e.fontWeights.extrabold})),V=a(`div`,{target:`e3v525e3`})({display:`flex`,alignItems:`center`,justifyContent:`flex-start`,textAlign:`left`,alignSelf:`center`,minWidth:0,flex:1}),H=a(`span`,{target:`e3v525e4`})(({theme:e,disabled:t})=>({fontSize:e.fontSizes.sm,color:t?e.colors.fadedText40:e.colors.fadedText60,display:`block`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`})),U=a(`div`,{target:`e3v525e5`})({display:`flex`,flexDirection:`column`,minWidth:0,maxWidth:`100%`}),W=a(`span`,{target:`e3v525e6`})({whiteSpace:`nowrap`}),G=a(`div`,{target:`e3v525e7`})(({theme:e})=>({lineHeight:e.lineHeights.tight})),K=2.5,q=.5;function J(e){let t=Math.floor(e),n=e-t;return`${t*K+Math.max(0,t-1)*q+(n>0?q+n*K:0)}rem`}var Y=()=>({[C]:{maxHeight:J(2.25),overflowY:`auto`}}),X=e=>({[R]:{flexDirection:`column`,alignItems:`stretch`,height:`fit-content`,gap:e.spacing.md},[V]:{alignSelf:`stretch`},[C]:{flexDirection:`column`,flexWrap:`nowrap`,alignItems:`flex-start`,maxHeight:`none`,overflowY:`visible`,gap:e.spacing.sm},[M]:{display:`flex`,flexDirection:`column`,flexWrap:`nowrap`,alignItems:`flex-start`,gap:e.spacing.sm,maxHeight:J(5.25),overflowY:`auto`,width:e.sizes.full},[S]:{width:e.sizes.full},[T]:{width:e.sizes.full}}),Z=a(`div`,{target:`e3v525e8`})(({theme:e,width:t})=>({...Y(),...tr(V,{"data-testid":`stFileUploaderDropzoneInstructions`,children:r(U,{children:n(H,{disabled:i,children:[`${D(t,k.Byte,0)} per file`,e.length?` • ${w(e)}`:null]})})})),ee=(0,I.memo)(({onDrop:e,multiple:t,acceptedTypes:a,maxSizeBytes:o,disabled:s,label:c,acceptDirectory:l=!1,uploadedFiles:u,hasFiles:d=!1})=>r(O,{onDrop:e,multiple:t,accept:j(a),maxSize:o,disabled:s,useFsAccessApi:!1,children:({getRootProps:e,getInputProps:f,isDragActive:p})=>{let _=f({multiple:t||!!l});return n(R,{...e({tabIndex:-1}),"data-testid":`stFileUploaderDropzone`,isDisabled:s,isDragActive:p,"aria-label":c,"aria-disabled":s,children:[r(`input`,{"data-testid":`stFileUploaderDropzoneInput`,..._,...l&&{webkitdirectory:``}}),p&&r(z,{children:r(B,{children:l?`Drag and drop directories here`:t?`Drag and drop files here`:`Drag and drop a file here`})}),d&&u?u:n(i,{children:[r(W,{children:r(g,{kind:h.SECONDARY,disabled:s,size:m.MEDIUM,children:r(v,{icon:`:material/upload:`,label:l?`Upload directories`:`Upload`})})}),r(Q,{acceptedTypes:a,maxSizeBytes:o,disabled:s})]})]})}})),te=(0,I.memo)(({items:e,onDelete:t,disabled:n,trailingContent:i})=>r(G,{children:r(E,{items:e,onDelete:t,disabled:n,trailingContent:i})})),ne=(e,t)=>{let n=t.getFileUploaderStateValue(e);if(d(n))return{files:[],nextLocalId:1};let{uploadedFileInfo:r}=n;if(d(r)||r.length===0)return{files:[],nextLocalId:1};let i=1;return{files:r.map(e=>{let t=e.name,n=e.size,r=e.fileId,a=e.fileUrls,o=new F(t,n,i,{type:`uploaded`,fileId:r,fileUrls:a});return i+=1,o}),nextLocalId:i}},$=e=>new l({uploadedFileInfo:e.filter(e=>e.status.type===`uploaded`).map(e=>{let{name:t,size:n,status:r}=e,{fileId:i,fileUrls:a}=r;return new u({fileId:i,fileUrls:a,name:t,size:n})})}),re=(0,I.memo)(({disabled:e,element:t,widgetMgr:i,uploadClient:a,fragmentId:o})=>{let{width:c,elementRef:l}=y(),{files:u,nextLocalId:S}=(0,I.useMemo)(()=>ne(t,i),[t,i]),C=(0,I.useRef)(S),[w,T]=(0,I.useState)(()=>u),E=(0,I.useRef)(w);(0,I.useEffect)(()=>{E.current=w},[w]);let[D,O]=(0,I.useState)(!1),j=(0,I.useCallback)(()=>{let e=C.current;return C.current+=1,e},[]),M=(0,I.useMemo)(()=>{let e=t.maxUploadSizeMb;return x(e,k.Megabyte,k.Byte)},[t.maxUploadSizeMb]),R=(0,I.useCallback)(e=>{(0,L.flushSync)(()=>{T(t=>{let n=typeof e==`function`?e(t):e;return E.current=n,n})})},[]),z=(0,I.useCallback)(e=>{(0,L.flushSync)(()=>{O(e)})},[O]),B=(0,I.useCallback)(e=>{R(t=>[...t,e])},[R]),V=(0,I.useCallback)(e=>{e.length!==0&&R(t=>[...t,...e])},[R]),H=(0,I.useCallback)(e=>{R(t=>t.filter(t=>t.id!==e))},[R]),U=(0,I.useCallback)((e,t)=>{R(n=>n.map(n=>n.id===e?t:n))},[R]),W=(0,I.useCallback)(e=>E.current.find(t=>t.id===e),[]),G=w.some(e=>e.status.type===`uploading`)||D?`updating`:`ready`;(0,I.useEffect)(()=>{i.getFileUploaderStateValue(t)===void 0&&i.setFileUploaderStateValue(t,$(E.current),{fromUi:!1},o)},[i,t,o]),(0,I.useEffect)(()=>{if(G!==`ready`)return;let e=$(w);f(e,i.getFileUploaderStateValue(t))||i.setFileUploaderStateValue(t,e,{fromUi:!0},o)},[G,w,i,t,o]),_({element:t,widgetMgr:i,onFormCleared:(0,I.useCallback)(()=>{R(()=>[]);let e=$([]);i.setFileUploaderStateValue(t,e,{fromUi:!0},o)},[t,o,R,i])});let K=t.type,q=(0,I.useCallback)(e=>{let t=[],n=[];return e.forEach(e=>{A(e,K)?t.push(e):n.push({file:e,errors:[{code:`file-invalid-type`,message:`${e.type} files are not allowed.`}]})}),{accepted:t,rejected:n}},[K]),J=(0,I.useCallback)((e,t)=>{let n=W(e);d(n)||n.status.type!==`uploading`||U(n.id,n.setStatus({type:`uploaded`,fileId:t.fileId,fileUrls:t}))},[W,U]),Y=(0,I.useCallback)((e,n)=>{let r=new AbortController,i=new F(n.webkitRelativePath||n.name,n.size,j(),{type:`uploading`,abortController:r,progress:0});B(i),a.uploadFile(t,e.uploadUrl,n,void 0,r.signal).then(()=>J(i.id,e)).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||U(i.id,i.setStatus({type:`error`,errorMessage:e?e.toString():`Unknown error`}))})},[B,t,j,J,U,a]),X=(0,I.useCallback)(t=>{if(e)return;let n=W(t);d(n)||(n.status.type===`uploading`&&n.status.abortController.abort(),n.status.type===`uploaded`&&n.status.fileUrls.deleteUrl&&a.deleteFile(n.status.fileUrls.deleteUrl),H(t))},[e,W,H,a]),Q=(0,I.useCallback)((e,n)=>{let{multipleFiles:r}=t,i=!!t.acceptDirectory,o=[...e],s=[...n];if(i&&o.length>0){let{accepted:e,rejected:t}=q(o);o=e,s=[...s,...t]}if(!r&&o.length===0&&s.length>1){let e=s.findIndex(e=>e.errors.length===1&&e.errors[0].code===`too-many-files`);e>=0&&(o.push(s[e].file),s.splice(e,1))}if(a.fetchFileURLs(o).then(e=>{if(!r&&o.length>0){let e=E.current.find(e=>e.status.type!==`error`);if(e){z(!0);try{X(e.id)}finally{z(!1)}}}p(e,o).forEach(([e,t])=>{Y(e,t)})}).catch(e=>{V(o.map(t=>new F(t.name,t.size,j(),{type:`error`,errorMessage:e})))}),s.length>0){let e=s.map(e=>b(e,j(),M));V(e)}},[V,X,t,q,M,j,a,Y,z]);return n(Z,{className:`stFileUploader`,"data-testid":`stFileUploader`,width:c,ref:l,children:[r(N,{label:t.label,disabled:e,labelVisibility:s(t.labelVisibility?.value),children:t.help&&r(P,{content:t.help,label:t.label})}),r(ee,{onDrop:Q,multiple:t.multipleFiles,acceptedTypes:K,maxSizeBytes:M,label:t.label,disabled:e,acceptDirectory:!!t.acceptDirectory,hasFiles:w.length>0,uploadedFiles:w.length>0?r(te,{items:w,onDelete:X,disabled:e,trailingContent:r(g,{kind:h.BORDERLESS_ICON,disabled:e,size:m.XSMALL,"aria-label":`Add files`,children:r(v,{icon:`:material/add:`})})}):null})]})});export{re as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/FocusScope.0TQQ9LKf.js b/venv/Lib/site-packages/streamlit/static/static/js/FocusScope.0TQQ9LKf.js new file mode 100644 index 0000000000000000000000000000000000000000..6d2082c798680edce8d6fc4f65d4abb49c3095fa --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/FocusScope.0TQQ9LKf.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{t as n}from"./react-dom.DZwq-Xzd.js";import{$ as r,H as i,J as a,K as o,M as s,O as c,V as l,W as u,X as d,Y as f,at as p,dt as m,nt as h,q as g}from"./Tooltip.PNC8NIZa.js";import{l as _,s as v}from"./useFocusRing.C8atAWyK.js";var y=e(n(),1),b=e(t(),1),x=(0,b.createContext)(null);function S(e){let t=(0,b.useRef)({});return b.createElement(x.Provider,{value:t},e.children)}var C=(0,b.forwardRef)(function(e,t){let{name:n,isVisible:i=!0,children:a,className:o,style:s,render:c,...l}=e,[u,d]=(0,b.useState)(i?`visible`:`hidden`),f=(0,b.useContext)(x);if(!f)throw Error(` must be rendered inside a `);i&&u===`hidden`&&d(`visible`),t=p(t),m(()=>{let e=t.current,r=f.current,a=r[n],o=null;if(e&&i&&a){d(`visible`);let t=e.getAnimations(),i=a.style.map(([t,n])=>{let r=e.style[t];if(t===`translate`){let t=a.rect,n=e.getBoundingClientRect(),r=t.left-n?.left,i=t.top-n?.top;e.style.translate=`${r}px ${i}px`}else e.style[t]=n;return[t,r]});for(let n of e.getAnimations())t.includes(n)||n.cancel();o=requestAnimationFrame(()=>{o=null;for(let[t,n]of i)e.style[t]=n}),delete r[n]}else e&&i&&!a?(queueMicrotask(()=>(0,y.flushSync)(()=>d(`entering`))),o=requestAnimationFrame(()=>{o=null,d(`visible`)})):e&&!i&&queueMicrotask(()=>{r[n]?(delete r[n],(0,y.flushSync)(()=>d(`exiting`)),Promise.all(e.getAnimations().map(e=>e.finished)).then(()=>d(`hidden`)).catch(()=>{})):d(`hidden`)});return()=>{if(o!=null&&cancelAnimationFrame(o),e&&e.isConnected&&!e.hasAttribute(`data-exiting`)){let t=window.getComputedStyle(e);if(t.transitionProperty!==`none`){let i=t.transitionProperty.split(/\s*,\s*/);r[n]={rect:e.getBoundingClientRect(),style:i.map(e=>[e,t[e]])}}}}},[t,f,n,i]);let g=r({children:a,className:o,style:s,render:c,values:{isEntering:u===`entering`,isExiting:u===`exiting`}});return u===`hidden`?null:b.createElement(h.div,{...l,...g,ref:t,"data-entering":u===`entering`||void 0,"data-exiting":u===`exiting`||void 0})}),w=class{constructor(e,t,n,r){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.shadowRoot;if(t){let e=this._doc.createTreeWalker(t,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(e),NodeFilter.FILTER_ACCEPT}else if(typeof this.filter==`function`)return this.filter(e);else if(this.filter?.acceptNode)return this.filter.acceptNode(e);else if(this.filter===null)return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=r??null,this.whatToShow=n??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,n,this._acceptNode));let i=t.shadowRoot;if(i){let e=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(e)}}get currentNode(){return this._currentNode}set currentNode(e){if(!u(this.root,e))throw Error(`Cannot set currentNode to a node that is not contained by the root node.`);let t=[],n=e,r=e;for(this._currentNode=e;n&&n!==this.root;)if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=n,i=this._doc.createTreeWalker(e,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),n=r=e.host}else n=n.parentNode;let i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return u(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let t;if(typeof this.filter==`function`?t=this.filter(e):this.filter?.acceptNode&&(t=this.filter.acceptNode(e)),t===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.nextNode();return e&&(this.currentNode=e),e}else return null}previousNode(){let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}else return null;return null}let t=e.previousNode();if(t){if(t.shadowRoot){let e;if(typeof this.filter==`function`?e=this.filter(t):this.filter?.acceptNode&&(e=this.filter.acceptNode(t)),e===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let n=this.lastChild();return n&&(this.currentNode=n),n}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}};function T(e,t,n,r){return a()?new w(e,t,n,r):e.createTreeWalker(t,n,r)}var E=b.createContext(null),D=`react-aria-focus-scope-restore`,O=null;function k(e){let{children:t,contain:n,restoreFocus:r,autoFocus:i}=e,a=(0,b.useRef)(null),s=(0,b.useRef)(null),c=(0,b.useRef)([]),{parentNode:l}=(0,b.useContext)(E)||{},u=(0,b.useMemo)(()=>new Q({scopeRef:c}),[c]);m(()=>{let e=l||$.root;if($.getTreeNode(e.scopeRef)&&O&&!z(O,e.scopeRef)){let t=$.getTreeNode(O);t&&(e=t)}e.addChild(u),$.addNode(u)},[u,l]),m(()=>{let e=$.getTreeNode(c);e&&(e.contain=!!n)},[n]),m(()=>{let e=a.current?.nextSibling,t=[],n=e=>e.stopPropagation();for(;e&&e!==s.current;)t.push(e),e.addEventListener(D,n),e=e.nextSibling;return c.current=t,()=>{for(let e of t)e.removeEventListener(D,n)}},[t]),W(c,r,n),P(c,n),K(c,r,n),U(c,i),(0,b.useEffect)(()=>{let e=o(f(c.current?c.current[0]:void 0)),t=null;if(I(e,c.current)){for(let n of $.traverse())n.scopeRef&&I(e,n.scopeRef.current)&&(t=n);t===$.getTreeNode(c)&&(O=t.scopeRef)}},[c]),m(()=>()=>{let e=$.getTreeNode(c)?.parent?.scopeRef??null;(c===O||z(c,O))&&(!e||$.getTreeNode(e))&&(O=e),$.removeTreeNode(c)},[c]);let d=(0,b.useMemo)(()=>ee(c),[]),p=(0,b.useMemo)(()=>({focusManager:d,parentNode:u}),[u,d]);return b.createElement(E.Provider,{value:p},b.createElement(`span`,{"data-focus-scope-start":!0,hidden:!0,ref:a}),t,b.createElement(`span`,{"data-focus-scope-end":!0,hidden:!0,ref:s}))}function ee(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:s}=t,c=r||o(f(n[0]??void 0)),l=n[0].previousElementSibling,u=J(A(n),{tabbable:i,accept:s},n);u.currentNode=I(c,n)?c:l;let d=u.nextNode();return!d&&a&&(u.currentNode=l,d=u.nextNode()),d&&B(d,!0),d},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:s}=t,c=r||o(f(n[0]??void 0)),l=n[n.length-1].nextElementSibling,u=J(A(n),{tabbable:i,accept:s},n);u.currentNode=I(c,n)?c:l;let d=u.previousNode();return!d&&a&&(u.currentNode=l,d=u.previousNode()),d&&B(d,!0),d},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=J(A(n),{tabbable:r,accept:i},n);a.currentNode=n[0].previousElementSibling;let o=a.nextNode();return o&&B(o,!0),o},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=J(A(n),{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let o=a.previousNode();return o&&B(o,!0),o}}}function A(e){return e[0].parentElement}function j(e){let t=$.getTreeNode(O);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function M(e){if(!e.form)return Array.from(f(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),n=d(e);return t instanceof n.RadioNodeList?Array.from(t).filter(e=>e instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function N(e){if(e.checked)return!0;let t=M(e);return t.length>0&&!t.some(e=>e.checked)}function P(e,t){let n=(0,b.useRef)(void 0),r=(0,b.useRef)(void 0);m(()=>{let i=e.current;if(!t){r.current&&=(cancelAnimationFrame(r.current),void 0);return}let a=f(i?i[0]:void 0),l=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!j(e)||t.isComposing)return;let n=o(a),r=e.current;if(!r||!I(n,r))return;let i=J(A(r),{tabbable:!0},r);if(!n)return;i.currentNode=n;let s=t.shiftKey?i.previousNode():i.nextNode();s||=(i.currentNode=t.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),s&&(B(s,!0),s instanceof d(s).HTMLInputElement&&s.select())},u=t=>{(!O||z(O,e))&&I(g(t),e.current)?(O=e,n.current=g(t)):j(e)&&!L(g(t),e)?n.current?n.current.focus():O&&O.current&&H(O.current):j(e)&&(n.current=g(t))},p=t=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let r=_(),i=(r===`virtual`||r===null)&&s()&&c(),l=o(a);if(!i&&l&&j(e)&&!L(l,e)){O=e;let r=g(t);r&&r.isConnected?(n.current=r,n.current?.focus()):O.current&&H(O.current)}})};return a.addEventListener(`keydown`,l,!1),a.addEventListener(`focusin`,u,!1),i?.forEach(e=>e.addEventListener(`focusin`,u,!1)),i?.forEach(e=>e.addEventListener(`focusout`,p,!1)),()=>{a.removeEventListener(`keydown`,l,!1),a.removeEventListener(`focusin`,u,!1),i?.forEach(e=>e.removeEventListener(`focusin`,u,!1)),i?.forEach(e=>e.removeEventListener(`focusout`,p,!1))}},[e,t]),m(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function F(e){return L(e)}function I(e,t){return!e||!t?!1:t.some(t=>u(t,e))}function L(e,t=null){if(e instanceof Element&&e.closest(`[data-react-aria-top-layer]`))return!0;for(let{scopeRef:n}of $.traverse($.getTreeNode(t)))if(n&&I(e,n.current))return!0;return!1}function R(e){return L(e,O)}function z(e,t){let n=$.getTreeNode(t)?.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function B(e,t=!1){if(e!=null&&!t)try{v(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function V(e,t=!0){let n=e[0].previousElementSibling,r=A(e),i=J(r,{tabbable:t},e);i.currentNode=n;let a=i.nextNode();return t&&!a&&(r=A(e),i=J(r,{tabbable:!1},e),i.currentNode=n,a=i.nextNode()),a}function H(e,t=!0){B(V(e,t))}function U(e,t){let n=b.useRef(t);(0,b.useEffect)(()=>{n.current&&(O=e,!I(o(f(e.current?e.current[0]:void 0)),O.current)&&e.current&&H(e.current)),n.current=!1},[e])}function W(e,t,n){m(()=>{if(t||n)return;let r=e.current,i=f(r?r[0]:void 0),a=t=>{let n=g(t);I(n,e.current)?O=e:F(n)||(O=null)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,t,n])}function G(e){let t=$.getTreeNode(O);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function K(e,t,n){let r=(0,b.useRef)(typeof document<`u`?o(f(e.current?e.current[0]:void 0)):null);m(()=>{let r=e.current,i=f(r?r[0]:void 0);if(!t||n)return;let a=()=>{(!O||z(O,e))&&I(o(i),e.current)&&(O=e)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,n]),m(()=>{let r=f(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!j(e)||t.isComposing)return;let n=r.activeElement;if(!L(n,e)||!G(e))return;let i=$.getTreeNode(e);if(!i)return;let a=i.nodeToRestore,o=J(r.body,{tabbable:!0});o.currentNode=n;let s=t.shiftKey?o.previousNode():o.nextNode();if((!a||!a.isConnected||a===r.body)&&(a=void 0,i.nodeToRestore=void 0),(!s||!L(s,e))&&a){o.currentNode=a;do s=t.shiftKey?o.previousNode():o.nextNode();while(L(s,e));t.preventDefault(),t.stopPropagation(),s?B(s,!0):F(a)?B(a,!0):n.blur()}};return n||r.addEventListener(`keydown`,i,!0),()=>{n||r.removeEventListener(`keydown`,i,!0)}},[e,t,n]),m(()=>{let n=f(e.current?e.current[0]:void 0);if(!t)return;let i=$.getTreeNode(e);if(i)return i.nodeToRestore=r.current??void 0,()=>{let r=$.getTreeNode(e);if(!r)return;let i=r.nodeToRestore,a=o(n);if(t&&i&&(a&&L(a,e)||a===n.body&&G(e))){let t=$.clone();requestAnimationFrame(()=>{if(n.activeElement===n.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&n.nodeToRestore.isConnected){q(n.nodeToRestore);return}n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&n.scopeRef.current&&$.getTreeNode(n.scopeRef)){q(V(n.scopeRef.current,!0));return}n=n.parent}}})}}},[e,t])}function q(e){e.dispatchEvent(new CustomEvent(D,{bubbles:!0,cancelable:!0}))&&B(e)}function J(e,t,n){let r=t?.tabbable?i:l,a=f(e?.nodeType===Node.ELEMENT_NODE?e:null),o=T(a,e||a,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return u(t?.from,e)||t?.tabbable&&e.tagName===`INPUT`&&e.getAttribute(`type`)===`radio`&&(!N(e)||o.currentNode.tagName===`INPUT`&&o.currentNode.type===`radio`&&o.currentNode.name===e.name)?NodeFilter.FILTER_REJECT:r(e)&&(!n||I(e,n))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function Y(e,t={}){return{focusNext(n={}){let r=e.current;if(!r)return null;let{from:i,tabbable:a=t.tabbable,wrap:s=t.wrap,accept:c=t.accept}=n,l=i||o(f(r)),d=J(r,{tabbable:a,accept:c});u(r,l)&&(d.currentNode=l);let p=d.nextNode();return!p&&s&&(d.currentNode=r,p=d.nextNode()),p&&B(p,!0),p},focusPrevious(n=t){let r=e.current;if(!r)return null;let{from:i,tabbable:a=t.tabbable,wrap:s=t.wrap,accept:c=t.accept}=n,l=i||o(f(r)),d=J(r,{tabbable:a,accept:c});if(u(r,l))d.currentNode=l;else{let e=X(d);return e&&B(e,!0),e??null}let p=d.previousNode();if(!p&&s){d.currentNode=r;let e=X(d);if(!e)return null;p=e}return p&&B(p,!0),p??null},focusFirst(n=t){let r=e.current;if(!r)return null;let{tabbable:i=t.tabbable,accept:a=t.accept}=n,o=J(r,{tabbable:i,accept:a}).nextNode();return o&&B(o,!0),o},focusLast(n=t){let r=e.current;if(!r)return null;let{tabbable:i=t.tabbable,accept:a=t.accept}=n,o=X(J(r,{tabbable:i,accept:a}));return o&&B(o,!0),o??null}}}function X(e){let t,n;do n=e.lastChild(),n&&(t=n);while(n);return t}var Z=class e{constructor(){this.fastMap=new Map,this.root=new Q({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(t??null);if(!r)return;let i=new Q({scopeRef:e});r.addChild(i),i.parent=r,this.fastMap.set(e,i),n&&(i.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&I(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>0&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){let t=new e;for(let e of this.traverse())t.addTreeNode(e.scopeRef,e.parent?.scopeRef??null,e.nodeToRestore);return t}},Q=class{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}},$=new Z;export{T as a,Y as i,k as n,S as o,J as r,C as s,R as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/FormClearHelper.D0Yt6KG5.js b/venv/Lib/site-packages/streamlit/static/static/js/FormClearHelper.D0Yt6KG5.js new file mode 100644 index 0000000000000000000000000000000000000000..9e29b8de8b61a9e3321dee114037b50aedd33a7a --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/FormClearHelper.D0Yt6KG5.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{Jt as n}from"./utils.94RcZhG4.js";import{n as r}from"./types.cZoyy9Y-.js";var i=e(t(),1),a=class{manageFormClearListener(e,t,i){r(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),n(t)&&(this.formClearListener=e.addFormClearedListener(t,i),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){this.formClearListener?.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}};function o({element:e,widgetMgr:t,onFormCleared:r}){(0,i.useEffect)(()=>{if(!t||!n(e.formId))return;let i=t.addFormClearedListener(e.formId,r);return()=>{i.disconnect()}},[e,t,r])}export{o as n,a as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/FormSubmitContent.BI0VZSTX.js b/venv/Lib/site-packages/streamlit/static/static/js/FormSubmitContent.BI0VZSTX.js new file mode 100644 index 0000000000000000000000000000000000000000..15626bb205ea5f42387032e0f5a731aba3317bda --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/FormSubmitContent.BI0VZSTX.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{i as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{o as r}from"./Tooltip.PNC8NIZa.js";import{n as i,t as a}from"./styled-components.B5oT30oI.js";import{t as o}from"./BaseButton.DzUQ5vsa.js";import{t as s}from"./BaseButtonTooltip.DyFZqtoX.js";import{i as c,t as l}from"./DynamicButtonLabel.UT8nPWDL.js";import{r as u,t as d}from"./FormsContext.Dt-mNfG5.js";import{t as f}from"./useRequiredContext.F4hG38Ff.js";import{t as p}from"./iconPosition.CHJpUZea.js";var m=e(t(),1),h=(0,m.memo)(function(e){let{disabled:t,element:u,widgetMgr:h,fragmentId:g}=e,{formId:_}=u,v=u.shortcut?u.shortcut:void 0,{formsData:y}=f(d),b=y.formsWithUploads.has(_),x=a.SECONDARY_FORM_SUBMIT;u.type===`primary`?x=a.PRIMARY_FORM_SUBMIT:u.type===`tertiary`&&(x=a.TERTIARY_FORM_SUBMIT);let S=t||b;(0,m.useEffect)(()=>(h.addSubmitButton(_,u),()=>h.removeSubmitButton(_,u)),[h,_,u]);let C=(0,m.useCallback)(()=>{S||h.submitForm(u.formId,g,u)},[S,h,u,g]);return c({shortcut:v,disabled:S,onActivate:C}),n(r,{className:`stFormSubmitButton`,"data-testid":`stFormSubmitButton`,children:n(s,{help:u.help,containerWidth:!0,children:n(o,{kind:x,size:i.SMALL,containerWidth:!0,disabled:S,onClick:C,children:n(l,{icon:u.icon,iconPosition:p(u.iconPosition),label:u.label,shortcut:v})})})})});function g(e){return n(u,{children:n(h,{...e})})}export{g as FormSubmitContent}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/FormsContext.Dt-mNfG5.js b/venv/Lib/site-packages/streamlit/static/static/js/FormsContext.Dt-mNfG5.js new file mode 100644 index 0000000000000000000000000000000000000000..f76e36bae94cd18721a90eb9d2882cccae0d2939 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/FormsContext.Dt-mNfG5.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{t as n}from"./emotion-styled.browser.esm.DsRKNFfx.js";var r=n(`div`,{target:`e1wbhg7m0`})({display:`flex`}),i=n(`div`,{target:`e1wbhg7m1`})(({theme:e,border:t,overflow:n})=>({...t&&{border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.default,padding:`calc(${e.spacing.lg} - ${e.sizes.borderWidth})`},width:`100%`,height:`100%`,overflow:n})),a=(0,e(t(),1).createContext)(null);a.displayName=`FormsContext`;export{i as n,r,a as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/GraphVizChart.tdvLWnZL.js b/venv/Lib/site-packages/streamlit/static/static/js/GraphVizChart.tdvLWnZL.js new file mode 100644 index 0000000000000000000000000000000000000000..777844b9df9886ff935e35fae6035cd01420cd3a --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/GraphVizChart.tdvLWnZL.js @@ -0,0 +1,3 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{a as n,i as r,t as i}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as a}from"./loglevel.BJBYxGId.js";import{a as o,i as s}from"./utils.BrY_0PXX.js";import{n as c}from"./UriUtil.olyUCSHN.js";import{f as l}from"./ErrorElement.BWmlOcKX.js";import{t as u}from"./useCalculatedDimensions.BnLCBgVi.js";import{t as d}from"./Toolbar.BynU-Hbw.js";import{t as f}from"./useRequiredContext.F4hG38Ff.js";import{n as p,t as m}from"./withFullScreenWrapper.DjqP6oFO.js";import{t as h}from"./defaultLocale.DAnyU4o_.js";import{n as g}from"./path.C6YKSwkP.js";import{t as _}from"./value.D6n4OHqi.js";import{i as v,s as y}from"./timer.BMV81txb.js";import{a as b,c as x,d as S,i as C,l as w,n as T,o as E,r as D,s as O,t as k,u as A}from"./src.CE7XIH0z.js";function j(e){return typeof e==`string`?new O([document.querySelectorAll(e)],[document.documentElement]):new O([A(e)],x)}var M=[null];function N(e,t){var n=e.__transition,r,i;if(n){for(i in t=t==null?null:t+``,n)if((r=n[i]).state>1&&r.name===t)return new C([[e]],M,t,+i)}return null}var P=e(t(),1);function ee(e){var t={},n=e.node().nodeName;t.tag=n,n==`#text`?t.text=e.text():n==`#comment`&&(t.comment=e.text()),t.attributes={};var r=e.node().attributes;if(r)for(var i=0;ie.length)&&(n=e.length);var r=new U(n-t);return r.set(e.subarray(t,n)),r},Te=function(e,t,n,r){if(U.prototype.fill)return U.prototype.fill.call(e,t,n,r);for((n==null||n<0)&&(n=0),(r==null||r>e.length)&&(r=e.length);ne.length)&&(r=e.length);n2046MB)`,`invalid block type`,`FSE accuracy too high`,`match distance too far back`,`unexpected EOF`],W=function(e,t,n){var r=Error(t||De[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,W),!n)throw r;return r},Oe=function(e,t,n){for(var r=0,i=0;r>>0},ke=function(e,t){var n=e[0]|e[1]<<8|e[2]<<16;if(n==3126568&&e[3]==253){var r=e[4],i=r>>5&1,a=r>>2&1,o=r&3,s=r>>6;r&8&&W(0);var c=6-i,l=o==3?4:o,u=Oe(e,c,l);c+=l;var d=s?1<>3);p=m+(m>>3)*(e[5]&7)}p>2145386496&&W(1);var h=new U((t==1?f||p:t?0:p)+12);return h[0]=1,h[4]=4,h[8]=8,{b:c+d,y:0,l:0,d:u,w:t&&t!=1?t:h.subarray(12),e:p,o:new Ce(h.buffer,0,3),u:f,c:a,m:Math.min(131072,p)}}else if((n>>4|e[3]<<20)==25481893)return G(e,4)+8;W(0)},Ae=function(e){for(var t=0;1<n&&W(3);for(var a=1<0;){var v=Ae(o+1),y=r>>3,b=(1<>(r&7)&b,S=(1<S&&(x-=C)),f[++s]=--x,x==-1?(o+=x,g[--u]=s):o-=x,!x)do{var T=r>>3;c=(e[T]|e[T+1]<<8)>>(r&7)&3,r+=2,s+=c}while(c==3)}(s>255||o)&&W(0);for(var E=0,D=(a>>1)+(a>>3)+3,O=a-1,k=0;k<=s;++k){var A=f[k];if(A<1){p[k]=-A;continue}for(l=0;l=u)}}for(E&&W(0),l=0;l>3,{b:i,s:g,n:_,t:m}]},Me=function(e,t){var n=0,r=-1,i=new U(292),a=e[t],o=i.subarray(0,256),s=i.subarray(256,268),c=new xe(i.buffer,268);if(a<128){var l=je(e,t+1,6),u=l[0],d=l[1];t+=a;var f=u<<3,p=e[t];p||W(0);for(var m=0,h=0,g=d.b,_=g,v=(++t<<3)-8+Ae(p);v-=g,!(v>3;if(m+=(e[y]|e[y+1]<<8)>>(v&7)&(1<>3,h+=(e[y]|e[y+1]<<8)>>(v&7)&(1<<_)-1,o[++r]=d.s[h],g=d.n[m],m=d.t[m],_=d.n[h],h=d.t[h]}++r>255&&W(0)}else{for(r=a-127;n>4,o[n+1]=b&15}++t}var x=0;for(n=0;n11&&W(0),x+=S&&1<0;--n){var k=c[n];Te(O,n,k,c[n-1]=k+s[n]*(1<s&&d>3,p=(e[f]|e[f+1]<<8|e[f+2]<<16)>>(u&7);c=(c<>2,a=i<<1,o=i+a;Re(e.subarray(r,r+=e[0]|e[1]<<8),t.subarray(0,i),n),Re(e.subarray(r,r+=e[2]|e[3]<<8),t.subarray(i,a),n),Re(e.subarray(r,r+=e[4]|e[5]<<8),t.subarray(a,o),n),Re(e.subarray(r),t.subarray(o),n)},Be=function(e,t,n){var r,i=t.b,a=e[i],o=a>>1&3;t.l=a&1;var s=a>>3|e[i+1]<<5|e[i+2]<<13,c=(i+=3)+s;if(o==1)return i>=e.length?void 0:(t.b=i+1,n?(Te(n,e[i],t.y,t.y+=s),n):Te(new U(s),e[i]));if(!(c>e.length)){if(o==0)return t.b=c,n?(n.set(e.subarray(i,c),t.y),t.y+=s,n):we(e,i,c);if(o==2){var l=e[i],u=l&3,d=l>>2&3,f=l>>4,p=0,m=0;u<2?d&1?f|=e[++i]<<4|(d&2&&e[++i]<<12):f=l>>3:(m=d,d<2?(f|=(e[++i]&63)<<4,p=e[i]>>6|e[++i]<<2):d==2?(f|=e[++i]<<4|(e[++i]&3)<<12,p=e[i]>>2|e[++i]<<6):(f|=e[++i]<<4|(e[++i]&63)<<12,p=e[i]>>6|e[++i]<<2|e[++i]<<10)),++i;var h=n?n.subarray(t.y,t.y+t.m):new U(t.m),g=h.length-f;if(u==0)h.set(e.subarray(i,i+=f),g);else if(u==1)Te(h,e[i++],g);else{var _=t.h;if(u==2){var v=Me(e,i);p+=i-(i=v[0]),t.h=_=v[1]}else _||W(0);(m?ze:Re)(e.subarray(i,i+=p),h.subarray(g),_)}var y=e[i++];if(y){y==255?y=(e[i++]|e[i++]<<8)+32512:y>127&&(y=y-128<<8|e[i++]);var b=e[i++];b&3&&W(0);for(var x=[Pe,Fe,Ne],S=2;S>-1;--S){var C=b>>(S<<1)+2&3;if(C==1){var w=new U([0,0,e[i++]]);x[S]={s:w.subarray(2,3),n:w.subarray(0,1),t:new xe(w.buffer,0,1),b:0}}else C==2?(r=je(e,i,9-(S&1)),i=r[0],x[S]=r[1]):C==3&&(t.t||W(0),x[S]=t.t[S])}var T=t.t=x,E=T[0],D=T[1],O=T[2],k=e[c-1];k||W(0);var A=(c<<3)-8+Ae(k)-O.b,j=A>>3,M=0,N=(e[j]|e[j+1]<<8)>>(A&7)&(1<>3;var P=(e[j]|e[j+1]<<8)>>(A&7)&(1<>3;var ee=(e[j]|e[j+1]<<8)>>(A&7)&(1<>3;var ie=1<>>(A&7)&ie-1);j=(A-=Ie[L])>>3;var z=Le[L]+((e[j]|e[j+1]<<8|e[j+2]<<16)>>(A&7)&(1<>3;var ae=J[F]+((e[j]|e[j+1]<<8|e[j+2]<<16)>>(A&7)&(1<>3,N=O.t[N]+((e[j]|e[j+1]<<8)>>(A&7)&(1<>3,ee=E.t[ee]+((e[j]|e[j+1]<<8)>>(A&7)&(1<>3,P=D.t[P]+((e[j]|e[j+1]<<8)>>(A&7)&(1<3)t.o[2]=t.o[1],t.o[1]=t.o[0],t.o[0]=R-=3;else{var oe=R-(ae!=0);oe?(R=oe==3?t.o[0]-1:t.o[oe],oe>1&&(t.o[2]=t.o[1]),t.o[1]=t.o[0],t.o[0]=R):R=t.o[0]}for(var S=0;Sz&&(ce=z);for(var S=0;S{r=e,i=t}),o=Object.assign({},n),s=`./this.program`,c=(e,t)=>{throw t},l=``;function u(e){return l+e}var d,f,p=console.log.bind(console),m=console.error.bind(console);Object.assign(n,o),o=null;var h=n.wasmBinary,g,_=!1;function v(e,t){e||L(t)}var y,b,x,S,C,w;function T(){var e=g.buffer;n.HEAP8=y=new Int8Array(e),n.HEAP16=x=new Int16Array(e),n.HEAPU8=b=new Uint8Array(e),n.HEAPU16=new Uint16Array(e),n.HEAP32=S=new Int32Array(e),n.HEAPU32=C=new Uint32Array(e),n.HEAPF32=new Float32Array(e),n.HEAPF64=w=new Float64Array(e)}var E=[],D=[],O=[];function k(){fe(E)}function A(){!n.noFSInit&&!K.initialized&&K.init(),K.ignorePermissions=!1,Ee.init(),fe(D)}function j(){fe(O)}function M(e){D.unshift(e)}var N=0,P=null,ee=null;function F(e){N++}function I(e){if(N--,N==0&&(P!==null&&(clearInterval(P),P=null),ee)){var t=ee;ee=null,t()}}function L(e){e=`Aborted(`+e+`)`,m(e),_=!0,e+=`. Build with -sASSERTIONS for more info.`;var t=new WebAssembly.RuntimeError(e);throw i(t),t}var te=`data:application/octet-stream;base64,`,ne=e=>e.startsWith(te),re=e=>e.startsWith(`file://`);function ie(){var e=`graphvizlib.wasm`;return ne(e)?e:u(e)}var R;function z(e){if(e==R&&h)return new Uint8Array(h);if(f)return f(e);throw`both async and sync fetching of the wasm failed`}function ae(e){return h?Promise.resolve().then(()=>z(e)):d(e).then(e=>new Uint8Array(e),()=>z(e))}function oe(e,t,n){return ae(e).then(e=>WebAssembly.instantiate(e,t)).then(n,e=>{m(`failed to asynchronously prepare wasm: ${e}`),L(e)})}function se(e,t,n,r){return!e&&typeof WebAssembly.instantiateStreaming==`function`&&!ne(t)&&!re(t)&&typeof fetch==`function`?fetch(t,{credentials:`same-origin`}).then(e=>WebAssembly.instantiateStreaming(e,n).then(r,function(e){return m(`wasm streaming compile failed: ${e}`),m(`falling back to ArrayBuffer instantiation`),oe(t,n,r)})):oe(t,n,r)}function ce(){return{a:Et}}function le(){function e(e,t){return Y=e.exports,g=Y.B,T(),M(Y.C),I(`wasm-instantiate`),Y}F(`wasm-instantiate`);function t(t){e(t.instance)}var n=ce();return R??=ie(),se(h,R,n,t).catch(i),{}}var B,V,ue={173064:(e,t)=>{var n=q(e),r=q(t);K.createPath(`/`,H.dirname(n)),K.writeFile(H.join(`/`,n),r)}};class de{name=`ExitStatus`;constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var fe=e=>{for(;e.length>0;)e.shift()(n)};class pe{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){C[this.ptr+4>>2]=e}get_type(){return C[this.ptr+4>>2]}set_destructor(e){C[this.ptr+8>>2]=e}get_destructor(){return C[this.ptr+8>>2]}set_caught(e){e=+!!e,y[this.ptr+12]=e}get_caught(){return y[this.ptr+12]!=0}set_rethrown(e){e=+!!e,y[this.ptr+13]=e}get_rethrown(){return y[this.ptr+13]!=0}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){C[this.ptr+16>>2]=e}get_adjusted_ptr(){return C[this.ptr+16>>2]}}var me=0,he=0,ge=(e,t,n)=>{throw new pe(e).init(t,n),me=e,he++,me},H={isAbs:e=>e.charAt(0)===`/`,splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];i===`.`?e.splice(r,1):i===`..`?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift(`..`);return e},normalize:e=>{var t=H.isAbs(e),n=e.substr(-1)===`/`;return e=H.normalizeArray(e.split(`/`).filter(e=>!!e),!t).join(`/`),!e&&!t&&(e=`.`),e&&n&&(e+=`/`),(t?`/`:``)+e},dirname:e=>{var t=H.splitPath(e),n=t[0],r=t[1];return!n&&!r?`.`:(r&&=r.substr(0,r.length-1),n+r)},basename:e=>{if(e===`/`)return`/`;e=H.normalize(e),e=e.replace(/\/$/,``);var t=e.lastIndexOf(`/`);return t===-1?e:e.substr(t+1)},join:(...e)=>H.normalize(e.join(`/`)),join2:(e,t)=>H.normalize(e+`/`+t)},_e=()=>{if(typeof crypto==`object`&&typeof crypto.getRandomValues==`function`)return e=>crypto.getRandomValues(e);L(`initRandomDevice`)},ve=e=>(ve=_e())(e),ye={resolve:(...e)=>{for(var t=``,n=!1,r=e.length-1;r>=-1&&!n;r--){var i=r>=0?e[r]:K.cwd();if(typeof i!=`string`)throw TypeError(`Arguments to path.resolve must be strings`);if(!i)return``;t=i+`/`+t,n=H.isAbs(i)}return t=H.normalizeArray(t.split(`/`).filter(e=>!!e),!n).join(`/`),(n?`/`:``)+t||`.`},relative:(e,t)=>{e=ye.resolve(e).substr(1),t=ye.resolve(t).substr(1);function n(e){for(var t=0;t=0&&e[n]===``;n--);return t>n?[]:e.slice(t,n-t+1)}for(var r=n(e.split(`/`)),i=n(t.split(`/`)),a=Math.min(r.length,i.length),o=a,s=0;s{for(var r=t+n,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&be)return be.decode(e.subarray(t,i));for(var a=``;t>10,56320|l&1023)}}return a},xe=[],Se=e=>{for(var t=0,n=0;n=55296&&r<=57343?(t+=4,++n):t+=3}return t},Ce=(e,t,n,r)=>{if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o=55296&&s<=57343){var c=e.charCodeAt(++o);s=65536+((s&1023)<<10)|c&1023}if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63}}return t[n]=0,n-i};function we(e,t,n){var r=n>0?n:Se(e)+1,i=Array(r),a=Ce(e,i,0,i.length);return t&&(i.length=a),i}var Te=()=>xe.length?xe.shift():null,Ee={ttys:[],init(){},shutdown(){},register(e,t){Ee.ttys[e]={input:[],output:[],ops:t},K.registerDevice(e,Ee.stream_ops)},stream_ops:{open(e){var t=Ee.ttys[e.node.rdev];if(!t)throw new K.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,n,r,i){if(!e.tty||!e.tty.ops.get_char)throw new K.ErrnoError(60);for(var a=0,o=0;o0&&(p(U(e.output)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,t,n){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,t){t===null||t===10?(m(U(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(m(U(e.output)),e.output=[])}}},De=(e,t)=>{b.fill(0,e,e+t)},W=(e,t)=>Math.ceil(e/t)*t,Oe=e=>{e=W(e,65536);var t=Qt(65536,e);return t&&De(t,e),t},G={ops_table:null,mount(e){return G.createNode(null,`/`,16895,0)},createNode(e,t,n,r){if(K.isBlkdev(n)||K.isFIFO(n))throw new K.ErrnoError(63);G.ops_table||={dir:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,lookup:G.node_ops.lookup,mknod:G.node_ops.mknod,rename:G.node_ops.rename,unlink:G.node_ops.unlink,rmdir:G.node_ops.rmdir,readdir:G.node_ops.readdir,symlink:G.node_ops.symlink},stream:{llseek:G.stream_ops.llseek}},file:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:{llseek:G.stream_ops.llseek,read:G.stream_ops.read,write:G.stream_ops.write,allocate:G.stream_ops.allocate,mmap:G.stream_ops.mmap,msync:G.stream_ops.msync}},link:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr,readlink:G.node_ops.readlink},stream:{}},chrdev:{node:{getattr:G.node_ops.getattr,setattr:G.node_ops.setattr},stream:K.chrdev_stream_ops}};var i=K.createNode(e,t,n,r);return K.isDir(i.mode)?(i.node_ops=G.ops_table.dir.node,i.stream_ops=G.ops_table.dir.stream,i.contents={}):K.isFile(i.mode)?(i.node_ops=G.ops_table.file.node,i.stream_ops=G.ops_table.file.stream,i.usedBytes=0,i.contents=null):K.isLink(i.mode)?(i.node_ops=G.ops_table.link.node,i.stream_ops=G.ops_table.link.stream):K.isChrdev(i.mode)&&(i.node_ops=G.ops_table.chrdev.node,i.stream_ops=G.ops_table.chrdev.stream),i.timestamp=Date.now(),e&&(e.contents[t]=i,e.timestamp=i.timestamp),i},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array},expandFileStorage(e,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),n!=0&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(t==0)e.contents=null,e.usedBytes=0;else{var n=e.contents;e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=K.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,K.isDir(e.mode)?t.size=4096:K.isFile(e.mode)?t.size=e.usedBytes:K.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&G.resizeFileStorage(e,t.size)},lookup(e,t){throw G.doesNotExistError},mknod(e,t,n,r){return G.createNode(e,t,n,r)},rename(e,t,n){if(K.isDir(e.mode)){var r;try{r=K.lookupNode(t,n)}catch{}if(r)for(var i in r.contents)throw new K.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=n,t.contents[n]=e,t.timestamp=e.parent.timestamp},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){for(var n in K.lookupNode(e,t).contents)throw new K.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[`.`,`..`];for(var n of Object.keys(e.contents))t.push(n);return t},symlink(e,t,n){var r=G.createNode(e,t,41471,0);return r.link=n,r},readlink(e){if(!K.isLink(e.mode))throw new K.ErrnoError(28);return e.link}},stream_ops:{read(e,t,n,r,i){var a=e.node.contents;if(i>=e.node.usedBytes)return 0;var o=Math.min(e.node.usedBytes-i,r);if(o>8&&a.subarray)t.set(a.subarray(i,i+o),n);else for(var s=0;s0||n+t{var i=r?``:`al ${e}`;d(e).then(e=>{t(new Uint8Array(e)),i&&I(i)},t=>{if(n)n();else throw`Loading data file "${e}" failed.`}),i&&F(i)},Ae=(e,t,n,r,i,a)=>{K.createDataFile(e,t,n,r,i,a)},je=[],Me=(e,t,n,r)=>{typeof Browser<`u`&&Browser.init();var i=!1;return je.forEach(a=>{i||a.canHandle(t)&&(a.handle(e,t,n,r),i=!0)}),i},Ne=(e,t,n,r,i,a,o,s,c,l)=>{var u=t?ye.resolve(H.join2(e,t)):e,d=`cp ${u}`;function f(n){function f(n){l?.(),s||Ae(e,t,n,r,i,c),a?.(),I(d)}Me(n,u,f,()=>{o?.(),I(d)})||f(n)}F(d),typeof n==`string`?ke(n,f,o):f(n)},Pe=e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(typeof t>`u`)throw Error(`Unknown file open mode: ${e}`);return t},Fe=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},K={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:`/`,initialized:!1,ignorePermissions:!0,ErrnoError:class{name=`ErrnoError`;constructor(e){this.errno=e}},filesystems:null,syncFSRequests:0,FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!=1}get isWrite(){return(this.flags&2097155)!=0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,t,n,r){e||=this,this.parent=e,this.mount=e.mount,this.id=K.nextInode++,this.name=t,this.mode=n,this.rdev=r}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return K.isDir(this.mode)}get isDevice(){return K.isChrdev(this.mode)}},lookupPath(e,t={}){if(e=ye.resolve(e),!e)return{path:``,node:null};if(t=Object.assign({follow_mount:!0,recurse_count:0},t),t.recurse_count>8)throw new K.ErrnoError(32);for(var n=e.split(`/`).filter(e=>!!e),r=K.root,i=`/`,a=0;a40)throw new K.ErrnoError(32)}}return{path:i,node:r}},getPath(e){for(var t;;){if(K.isRoot(e)){var n=e.mount.mountpoint;return t?n[n.length-1]===`/`?n+t:`${n}/${t}`:n}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var n=0,r=0;r>>0)%K.nameTable.length},hashAddNode(e){var t=K.hashName(e.parent.id,e.name);e.name_next=K.nameTable[t],K.nameTable[t]=e},hashRemoveNode(e){var t=K.hashName(e.parent.id,e.name);if(K.nameTable[t]===e)K.nameTable[t]=e.name_next;else for(var n=K.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode(e,t){var n=K.mayLookup(e);if(n)throw new K.ErrnoError(n);for(var r=K.hashName(e.id,t),i=K.nameTable[r];i;i=i.name_next){var a=i.name;if(i.parent.id===e.id&&a===t)return i}return K.lookup(e,t)},createNode(e,t,n,r){var i=new K.FSNode(e,t,n,r);return K.hashAddNode(i),i},destroyNode(e){K.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)==32768},isDir(e){return(e&61440)==16384},isLink(e){return(e&61440)==40960},isChrdev(e){return(e&61440)==8192},isBlkdev(e){return(e&61440)==24576},isFIFO(e){return(e&61440)==4096},isSocket(e){return(e&49152)==49152},flagsToPermissionString(e){var t=[`r`,`w`,`rw`][e&3];return e&512&&(t+=`w`),t},nodePermissions(e,t){return K.ignorePermissions?0:t.includes(`r`)&&!(e.mode&292)||t.includes(`w`)&&!(e.mode&146)||t.includes(`x`)&&!(e.mode&73)?2:0},mayLookup(e){return K.isDir(e.mode)?K.nodePermissions(e,`x`)||(e.node_ops.lookup?0:2):54},mayCreate(e,t){try{return K.lookupNode(e,t),20}catch{}return K.nodePermissions(e,`wx`)},mayDelete(e,t,n){var r;try{r=K.lookupNode(e,t)}catch(e){return e.errno}var i=K.nodePermissions(e,`wx`);if(i)return i;if(n){if(!K.isDir(r.mode))return 54;if(K.isRoot(r)||K.getPath(r)===K.cwd())return 10}else if(K.isDir(r.mode))return 31;return 0},mayOpen(e,t){return e?K.isLink(e.mode)?32:K.isDir(e.mode)&&(K.flagsToPermissionString(t)!==`r`||t&512)?31:K.nodePermissions(e,K.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=K.MAX_OPEN_FDS;e++)if(!K.streams[e])return e;throw new K.ErrnoError(33)},getStreamChecked(e){var t=K.getStream(e);if(!t)throw new K.ErrnoError(8);return t},getStream:e=>K.streams[e],createStream(e,t=-1){return e=Object.assign(new K.FSStream,e),t==-1&&(t=K.nextfd()),e.fd=t,K.streams[t]=e,e},closeStream(e){K.streams[e]=null},dupStream(e,t=-1){var n=K.createStream(e,t);return n.stream_ops?.dup?.(n),n},chrdev_stream_ops:{open(e){e.stream_ops=K.getDevice(e.node.rdev).stream_ops,e.stream_ops.open?.(e)},llseek(){throw new K.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,t)=>e<<8|t,registerDevice(e,t){K.devices[e]={stream_ops:t}},getDevice:e=>K.devices[e],getMounts(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push(...r.mounts)}return t},syncfs(e,t){typeof e==`function`&&(t=e,e=!1),K.syncFSRequests++,K.syncFSRequests>1&&m(`warning: ${K.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=K.getMounts(K.root.mount),r=0;function i(e){return K.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,i(e));++r>=n.length&&i(null)}n.forEach(t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,e,a)})},mount(e,t,n){var r=n===`/`,i=!n,a;if(r&&K.root)throw new K.ErrnoError(10);if(!r&&!i){var o=K.lookupPath(n,{follow_mount:!1});if(n=o.path,a=o.node,K.isMountpoint(a))throw new K.ErrnoError(10);if(!K.isDir(a.mode))throw new K.ErrnoError(54)}var s={type:e,opts:t,mountpoint:n,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,r?K.root=c:a&&(a.mounted=s,a.mount&&a.mount.mounts.push(s)),c},unmount(e){var t=K.lookupPath(e,{follow_mount:!1});if(!K.isMountpoint(t.node))throw new K.ErrnoError(28);var n=t.node,r=n.mounted,i=K.getMounts(r);Object.keys(K.nameTable).forEach(e=>{for(var t=K.nameTable[e];t;){var n=t.name_next;i.includes(t.mount)&&K.destroyNode(t),t=n}}),n.mounted=null;var a=n.mount.mounts.indexOf(r);n.mount.mounts.splice(a,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,n){var r=K.lookupPath(e,{parent:!0}).node,i=H.basename(e);if(!i||i===`.`||i===`..`)throw new K.ErrnoError(28);var a=K.mayCreate(r,i);if(a)throw new K.ErrnoError(a);if(!r.node_ops.mknod)throw new K.ErrnoError(63);return r.node_ops.mknod(r,i,t,n)},statfs(e){var t={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:K.nextInode,ffree:K.nextInode-1,fsid:42,flags:2,namelen:255},n=K.lookupPath(e,{follow:!0}).node;return n?.node_ops.statfs&&Object.assign(t,n.node_ops.statfs(n.mount.opts.root)),t},create(e,t=438){return t&=4095,t|=32768,K.mknod(e,t,0)},mkdir(e,t=511){return t&=1023,t|=16384,K.mknod(e,t,0)},mkdirTree(e,t){for(var n=e.split(`/`),r=``,i=0;i`u`&&(n=t,t=438),t|=8192,K.mknod(e,t,n)},symlink(e,t){if(!ye.resolve(e))throw new K.ErrnoError(44);var n=K.lookupPath(t,{parent:!0}).node;if(!n)throw new K.ErrnoError(44);var r=H.basename(t),i=K.mayCreate(n,r);if(i)throw new K.ErrnoError(i);if(!n.node_ops.symlink)throw new K.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename(e,t){var n=H.dirname(e),r=H.dirname(t),i=H.basename(e),a=H.basename(t),o,s,c;if(o=K.lookupPath(e,{parent:!0}),s=o.node,o=K.lookupPath(t,{parent:!0}),c=o.node,!s||!c)throw new K.ErrnoError(44);if(s.mount!==c.mount)throw new K.ErrnoError(75);var l=K.lookupNode(s,i),u=ye.relative(e,r);if(u.charAt(0)!==`.`)throw new K.ErrnoError(28);if(u=ye.relative(t,n),u.charAt(0)!==`.`)throw new K.ErrnoError(55);var d;try{d=K.lookupNode(c,a)}catch{}if(l!==d){var f=K.isDir(l.mode),p=K.mayDelete(s,i,f);if(p||(p=d?K.mayDelete(c,a,f):K.mayCreate(c,a),p))throw new K.ErrnoError(p);if(!s.node_ops.rename)throw new K.ErrnoError(63);if(K.isMountpoint(l)||d&&K.isMountpoint(d))throw new K.ErrnoError(10);if(c!==s&&(p=K.nodePermissions(s,`w`),p))throw new K.ErrnoError(p);K.hashRemoveNode(l);try{s.node_ops.rename(l,c,a),l.parent=c}catch(e){throw e}finally{K.hashAddNode(l)}}},rmdir(e){var t=K.lookupPath(e,{parent:!0}).node,n=H.basename(e),r=K.lookupNode(t,n),i=K.mayDelete(t,n,!0);if(i)throw new K.ErrnoError(i);if(!t.node_ops.rmdir)throw new K.ErrnoError(63);if(K.isMountpoint(r))throw new K.ErrnoError(10);t.node_ops.rmdir(t,n),K.destroyNode(r)},readdir(e){var t=K.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new K.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=K.lookupPath(e,{parent:!0}).node;if(!t)throw new K.ErrnoError(44);var n=H.basename(e),r=K.lookupNode(t,n),i=K.mayDelete(t,n,!1);if(i)throw new K.ErrnoError(i);if(!t.node_ops.unlink)throw new K.ErrnoError(63);if(K.isMountpoint(r))throw new K.ErrnoError(10);t.node_ops.unlink(t,n),K.destroyNode(r)},readlink(e){var t=K.lookupPath(e).node;if(!t)throw new K.ErrnoError(44);if(!t.node_ops.readlink)throw new K.ErrnoError(28);return t.node_ops.readlink(t)},stat(e,t){var n=K.lookupPath(e,{follow:!t}).node;if(!n)throw new K.ErrnoError(44);if(!n.node_ops.getattr)throw new K.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return K.stat(e,!0)},chmod(e,t,n){var r=typeof e==`string`?K.lookupPath(e,{follow:!n}).node:e;if(!r.node_ops.setattr)throw new K.ErrnoError(63);r.node_ops.setattr(r,{mode:t&4095|r.mode&-4096,timestamp:Date.now()})},lchmod(e,t){K.chmod(e,t,!0)},fchmod(e,t){var n=K.getStreamChecked(e);K.chmod(n.node,t)},chown(e,t,n,r){var i=typeof e==`string`?K.lookupPath(e,{follow:!r}).node:e;if(!i.node_ops.setattr)throw new K.ErrnoError(63);i.node_ops.setattr(i,{timestamp:Date.now()})},lchown(e,t,n){K.chown(e,t,n,!0)},fchown(e,t,n){var r=K.getStreamChecked(e);K.chown(r.node,t,n)},truncate(e,t){if(t<0)throw new K.ErrnoError(28);var n=typeof e==`string`?K.lookupPath(e,{follow:!0}).node:e;if(!n.node_ops.setattr)throw new K.ErrnoError(63);if(K.isDir(n.mode))throw new K.ErrnoError(31);if(!K.isFile(n.mode))throw new K.ErrnoError(28);var r=K.nodePermissions(n,`w`);if(r)throw new K.ErrnoError(r);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate(e,t){var n=K.getStreamChecked(e);if(!(n.flags&2097155))throw new K.ErrnoError(28);K.truncate(n.node,t)},utime(e,t,n){var r=K.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,n)})},open(e,t,n=438){if(e===``)throw new K.ErrnoError(44);t=typeof t==`string`?Pe(t):t,n=t&64?n&4095|32768:0;var r;if(typeof e==`object`)r=e;else{e=H.normalize(e);try{r=K.lookupPath(e,{follow:!(t&131072)}).node}catch{}}var i=!1;if(t&64)if(r){if(t&128)throw new K.ErrnoError(20)}else r=K.mknod(e,n,0),i=!0;if(!r)throw new K.ErrnoError(44);if(K.isChrdev(r.mode)&&(t&=-513),t&65536&&!K.isDir(r.mode))throw new K.ErrnoError(54);if(!i){var a=K.mayOpen(r,t);if(a)throw new K.ErrnoError(a)}t&512&&!i&&K.truncate(r,0),t&=-131713;var o=K.createStream({node:r,path:K.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return o.stream_ops.open&&o.stream_ops.open(o),o},close(e){if(K.isClosed(e))throw new K.ErrnoError(8);e.getdents&&=null;try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{K.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,n){if(K.isClosed(e))throw new K.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new K.ErrnoError(70);if(n!=0&&n!=1&&n!=2)throw new K.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read(e,t,n,r,i){if(r<0||i<0)throw new K.ErrnoError(28);if(K.isClosed(e)||(e.flags&2097155)==1)throw new K.ErrnoError(8);if(K.isDir(e.node.mode))throw new K.ErrnoError(31);if(!e.stream_ops.read)throw new K.ErrnoError(28);var a=typeof i<`u`;if(!a)i=e.position;else if(!e.seekable)throw new K.ErrnoError(70);var o=e.stream_ops.read(e,t,n,r,i);return a||(e.position+=o),o},write(e,t,n,r,i,a){if(r<0||i<0)throw new K.ErrnoError(28);if(K.isClosed(e)||!(e.flags&2097155))throw new K.ErrnoError(8);if(K.isDir(e.node.mode))throw new K.ErrnoError(31);if(!e.stream_ops.write)throw new K.ErrnoError(28);e.seekable&&e.flags&1024&&K.llseek(e,0,2);var o=typeof i<`u`;if(!o)i=e.position;else if(!e.seekable)throw new K.ErrnoError(70);var s=e.stream_ops.write(e,t,n,r,i,a);return o||(e.position+=s),s},allocate(e,t,n){if(K.isClosed(e))throw new K.ErrnoError(8);if(t<0||n<=0)throw new K.ErrnoError(28);if(!(e.flags&2097155))throw new K.ErrnoError(8);if(!K.isFile(e.node.mode)&&!K.isDir(e.node.mode))throw new K.ErrnoError(43);if(!e.stream_ops.allocate)throw new K.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap(e,t,n,r,i){if(r&2&&!(i&2)&&(e.flags&2097155)!=2||(e.flags&2097155)==1)throw new K.ErrnoError(2);if(!e.stream_ops.mmap)throw new K.ErrnoError(43);if(!t)throw new K.ErrnoError(28);return e.stream_ops.mmap(e,t,n,r,i)},msync(e,t,n,r,i){return e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,i):0},ioctl(e,t,n){if(!e.stream_ops.ioctl)throw new K.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||`binary`,t.encoding!==`utf8`&&t.encoding!==`binary`)throw Error(`Invalid encoding type "${t.encoding}"`);var n,r=K.open(e,t.flags),i=K.stat(e).size,a=new Uint8Array(i);return K.read(r,a,0,i,0),t.encoding===`utf8`?n=U(a):t.encoding===`binary`&&(n=a),K.close(r),n},writeFile(e,t,n={}){n.flags=n.flags||577;var r=K.open(e,n.flags,n.mode);if(typeof t==`string`){var i=new Uint8Array(Se(t)+1),a=Ce(t,i,0,i.length);K.write(r,i,0,a,void 0,n.canOwn)}else if(ArrayBuffer.isView(t))K.write(r,t,0,t.byteLength,void 0,n.canOwn);else throw Error(`Unsupported data type`);K.close(r)},cwd:()=>K.currentPath,chdir(e){var t=K.lookupPath(e,{follow:!0});if(t.node===null)throw new K.ErrnoError(44);if(!K.isDir(t.node.mode))throw new K.ErrnoError(54);var n=K.nodePermissions(t.node,`x`);if(n)throw new K.ErrnoError(n);K.currentPath=t.path},createDefaultDirectories(){K.mkdir(`/tmp`),K.mkdir(`/home`),K.mkdir(`/home/web_user`)},createDefaultDevices(){K.mkdir(`/dev`),K.registerDevice(K.makedev(1,3),{read:()=>0,write:(e,t,n,r,i)=>r,llseek:()=>0}),K.mkdev(`/dev/null`,K.makedev(1,3)),Ee.register(K.makedev(5,0),Ee.default_tty_ops),Ee.register(K.makedev(6,0),Ee.default_tty1_ops),K.mkdev(`/dev/tty`,K.makedev(5,0)),K.mkdev(`/dev/tty1`,K.makedev(6,0));var e=new Uint8Array(1024),t=0,n=()=>(t===0&&(t=ve(e).byteLength),e[--t]);K.createDevice(`/dev`,`random`,n),K.createDevice(`/dev`,`urandom`,n),K.mkdir(`/dev/shm`),K.mkdir(`/dev/shm/tmp`)},createSpecialDirectories(){K.mkdir(`/proc`);var e=K.mkdir(`/proc/self`);K.mkdir(`/proc/self/fd`),K.mount({mount(){var t=K.createNode(e,`fd`,16895,73);return t.node_ops={lookup(e,t){var n=+t,r=K.getStreamChecked(n),i={parent:null,mount:{mountpoint:`fake`},node_ops:{readlink:()=>r.path}};return i.parent=i,i}},t}},{},`/proc/self/fd`)},createStandardStreams(e,t,n){e?K.createDevice(`/dev`,`stdin`,e):K.symlink(`/dev/tty`,`/dev/stdin`),t?K.createDevice(`/dev`,`stdout`,null,t):K.symlink(`/dev/tty`,`/dev/stdout`),n?K.createDevice(`/dev`,`stderr`,null,n):K.symlink(`/dev/tty1`,`/dev/stderr`),K.open(`/dev/stdin`,0),K.open(`/dev/stdout`,1),K.open(`/dev/stderr`,1)},staticInit(){K.nameTable=Array(4096),K.mount(G,{},`/`),K.createDefaultDirectories(),K.createDefaultDevices(),K.createSpecialDirectories(),K.filesystems={MEMFS:G}},init(e,t,n){K.initialized=!0,K.createStandardStreams(e,t,n)},quit(){K.initialized=!1;for(var e=0;e{var t=o.stream_ops[e];s[e]=(...e)=>(K.forceLoadFile(o),t(...e))});function c(e,t,n,r,i){var a=e.node.contents;if(i>=a.length)return 0;var o=Math.min(a.length-i,r);if(a.slice)for(var s=0;s(K.forceLoadFile(o),c(e,t,n,r,i)),s.mmap=(e,t,n,r,i)=>{K.forceLoadFile(o);var a=Oe(t);if(!a)throw new K.ErrnoError(48);return c(e,y,a,t,n),{ptr:a,allocated:!0}},o.stream_ops=s,o}},q=(e,t)=>e?U(b,e,t):``,J={DEFAULT_POLLMASK:5,calculateAt(e,t,n){if(H.isAbs(t))return t;var r=e===-100?K.cwd():J.getStreamFromFD(e).path;if(t.length==0){if(!n)throw new K.ErrnoError(44);return r}return H.join2(r,t)},doStat(e,t,n){var r=e(t);S[n>>2]=r.dev,S[n+4>>2]=r.mode,C[n+8>>2]=r.nlink,S[n+12>>2]=r.uid,S[n+16>>2]=r.gid,S[n+20>>2]=r.rdev,V=[r.size>>>0,(B=r.size,+Math.abs(B)>=1?B>0?Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],S[n+24>>2]=V[0],S[n+28>>2]=V[1],S[n+32>>2]=4096,S[n+36>>2]=r.blocks;var i=r.atime.getTime(),a=r.mtime.getTime(),o=r.ctime.getTime();return V=[Math.floor(i/1e3)>>>0,(B=Math.floor(i/1e3),+Math.abs(B)>=1?B>0?Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],S[n+40>>2]=V[0],S[n+44>>2]=V[1],C[n+48>>2]=i%1e3*1e3*1e3,V=[Math.floor(a/1e3)>>>0,(B=Math.floor(a/1e3),+Math.abs(B)>=1?B>0?Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],S[n+56>>2]=V[0],S[n+60>>2]=V[1],C[n+64>>2]=a%1e3*1e3*1e3,V=[Math.floor(o/1e3)>>>0,(B=Math.floor(o/1e3),+Math.abs(B)>=1?B>0?Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],S[n+72>>2]=V[0],S[n+76>>2]=V[1],C[n+80>>2]=o%1e3*1e3*1e3,V=[r.ino>>>0,(B=r.ino,+Math.abs(B)>=1?B>0?Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],S[n+88>>2]=V[0],S[n+92>>2]=V[1],0},doMsync(e,t,n,r,i){if(!K.isFile(t.node.mode))throw new K.ErrnoError(43);if(r&2)return 0;var a=b.slice(e,e+n);K.msync(t,a,i,n,r)},getStreamFromFD(e){return K.getStreamChecked(e)},varargs:void 0,getStr(e){return q(e)}};function Ie(e,t,n,r){try{if(t=J.getStr(t),t=J.calculateAt(e,t),n&-8)return-28;var i=K.lookupPath(t,{follow:!0}).node;if(!i)return-44;var a=``;return n&4&&(a+=`r`),n&2&&(a+=`w`),n&1&&(a+=`x`),a&&K.nodePermissions(i,a)?-2:0}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return-e.errno}}var Le=()=>{var e=S[J.varargs>>2];return J.varargs+=4,e},Re=Le;function ze(e,t,n){J.varargs=n;try{var r=J.getStreamFromFD(e);switch(t){case 0:var i=Le();if(i<0)return-28;for(;K.streams[i];)i++;var a;return a=K.dupStream(r,i),a.fd;case 1:case 2:return 0;case 3:return r.flags;case 4:var i=Le();return r.flags|=i,0;case 12:var i=Re(),o=0;return x[i+o>>1]=2,0;case 13:case 14:return 0}return-28}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return-e.errno}}function Be(e,t){try{var n=J.getStreamFromFD(e);return J.doStat(K.stat,n.path,t)}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return-e.errno}}function Ve(e,t,n){J.varargs=n;try{var r=J.getStreamFromFD(e);switch(t){case 21509:return r.tty?0:-59;case 21505:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcgets){var i=r.tty.ops.ioctl_tcgets(r),a=Re();S[a>>2]=i.c_iflag||0,S[a+4>>2]=i.c_oflag||0,S[a+8>>2]=i.c_cflag||0,S[a+12>>2]=i.c_lflag||0;for(var o=0;o<32;o++)y[a+o+17]=i.c_cc[o]||0;return 0}return 0;case 21510:case 21511:case 21512:return r.tty?0:-59;case 21506:case 21507:case 21508:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcsets){for(var a=Re(),s=S[a>>2],c=S[a+4>>2],l=S[a+8>>2],u=S[a+12>>2],d=[],o=0;o<32;o++)d.push(y[a+o+17]);return r.tty.ops.ioctl_tcsets(r.tty,t,{c_iflag:s,c_oflag:c,c_cflag:l,c_lflag:u,c_cc:d})}return 0;case 21519:if(!r.tty)return-59;var a=Re();return S[a>>2]=0,0;case 21520:return r.tty?-28:-59;case 21531:var a=Re();return K.ioctl(r,t,a);case 21523:if(!r.tty)return-59;if(r.tty.ops.ioctl_tiocgwinsz){var f=r.tty.ops.ioctl_tiocgwinsz(r.tty),a=Re();x[a>>1]=f[0],x[a+2>>1]=f[1]}return 0;case 21524:return r.tty?0:-59;case 21515:return r.tty?0:-59;default:return-28}}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return-e.errno}}function He(e,t,n,r){try{t=J.getStr(t);var i=r&256,a=r&4096;return r&=-6401,t=J.calculateAt(e,t,a),J.doStat(i?K.lstat:K.stat,t,n)}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return-e.errno}}function Ue(e,t,n,r){J.varargs=r;try{t=J.getStr(t),t=J.calculateAt(e,t);var i=r?Le():0;return K.open(t,n,i).fd}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return-e.errno}}var We=(e,t,n)=>Ce(e,b,t,n);function Ge(e,t,n,r){try{if(t=J.getStr(t),t=J.calculateAt(e,t),r<=0)return-28;var i=K.readlink(t),a=Math.min(r,Se(i)),o=y[n+a];return We(i,n,r+1),y[n+a]=o,a}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return-e.errno}}function Ke(e){try{return e=J.getStr(e),K.rmdir(e),0}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return-e.errno}}function qe(e,t){try{return e=J.getStr(e),J.doStat(K.stat,e,t)}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return-e.errno}}function Je(e,t,n){try{return t=J.getStr(t),t=J.calculateAt(e,t),n===0?K.unlink(t):n===512?K.rmdir(t):L(`Invalid flags passed to unlinkat`),0}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return-e.errno}}var Ye=()=>L(``),Xe=1,Ze=()=>Xe,Qe=(e,t,n)=>b.copyWithin(e,t,t+n),$e=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+t*4294967296:NaN;function et(e,t,n,r,i,a,o,s){var c=$e(i,a);try{if(isNaN(c))return 61;var l=J.getStreamFromFD(r),u=K.mmap(l,e,c,t,n),d=u.ptr;return S[o>>2]=u.allocated,C[s>>2]=d,0}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return-e.errno}}function tt(e,t,n,r,i,a,o){var s=$e(a,o);try{var c=J.getStreamFromFD(i);n&2&&J.doMsync(e,c,t,r,s)}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return-e.errno}}var nt=(e,t,n,r)=>{var i=new Date().getFullYear(),a=new Date(i,0,1),o=new Date(i,6,1),s=a.getTimezoneOffset(),c=o.getTimezoneOffset(),l=Math.max(s,c);C[e>>2]=l*60,S[t>>2]=+(s!=c);var u=e=>{var t=e>=0?`-`:`+`,n=Math.abs(e);return`UTC${t}${String(Math.floor(n/60)).padStart(2,`0`)}${String(n%60).padStart(2,`0`)}`},d=u(s),f=u(c);c{rt.length=0;for(var n;n=b[e++];){var r=n!=105;r&=n!=112,t+=r&&t%8?4:0,rt.push(n==112?C[t>>2]:n==105?S[t>>2]:w[t>>3]),t+=r?8:4}return rt},at=(e,t,n)=>{var r=it(t,n);return ue[e](...r)},ot=(e,t,n)=>at(e,t,n),st=()=>Date.now(),ct=()=>2147483648,lt=e=>{var t=(e-g.buffer.byteLength+65535)/65536|0;try{return g.grow(t),T(),1}catch{}},ut=e=>{var t=b.length;e>>>=0;var n=ct();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),lt(Math.min(n,W(Math.max(e,i),65536))))return!0}return!1},dt={},ft=()=>s||`./this.program`,pt=()=>{if(!pt.strings){var e={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(typeof navigator==`object`&&navigator.languages&&navigator.languages[0]||`C`).replace(`-`,`_`)+`.UTF-8`,_:ft()};for(var t in dt)dt[t]===void 0?delete e[t]:e[t]=dt[t];var n=[];for(var t in e)n.push(`${t}=${e[t]}`);pt.strings=n}return pt.strings},mt=(e,t)=>{for(var n=0;n{var n=0;return pt().forEach((r,i)=>{var a=t+n;C[e+i*4>>2]=a,mt(r,a),n+=r.length+1}),0},gt=(e,t)=>{var n=pt();C[e>>2]=n.length;var r=0;return n.forEach(e=>r+=e.length+1),C[t>>2]=r,0},_t=()=>!0,vt=e=>{_t()||(_=!0),c(e,new de(e))},yt=(e,t)=>{vt(e)};function bt(e){try{var t=J.getStreamFromFD(e);return K.close(t),0}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return e.errno}}var xt=(e,t,n,r)=>{for(var i=0,a=0;a>2],s=C[t+4>>2];t+=8;var c=K.read(e,y,o,s,r);if(c<0)return-1;if(i+=c,c>2]=i,0}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return e.errno}}function Ct(e,t,n,r,i){var a=$e(t,n);try{if(isNaN(a))return 61;var o=J.getStreamFromFD(e);return K.llseek(o,a,r),V=[o.position>>>0,(B=o.position,+Math.abs(B)>=1?B>0?Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],S[i>>2]=V[0],S[i+4>>2]=V[1],o.getdents&&a===0&&r===0&&(o.getdents=null),0}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return e.errno}}var wt=(e,t,n,r)=>{for(var i=0,a=0;a>2],s=C[t+4>>2];t+=8;var c=K.write(e,y,o,s,r);if(c<0)return-1;if(i+=c,c>2]=i,0}catch(e){if(typeof K>`u`||e.name!==`ErrnoError`)throw e;return e.errno}}K.createPreloadedFile=Ne,K.staticInit(),G.doesNotExistError=new K.ErrnoError(44),G.doesNotExistError.stack=``;var Et={a:ge,i:Ie,f:ze,x:Be,k:Ve,v:He,h:Ue,q:Ge,r:Ke,w:qe,s:Je,j:Ye,y:Ze,z:Qe,l:et,m:tt,o:nt,A:ot,c:st,p:ut,t:ht,u:gt,g:yt,b:bt,e:St,n:Ct,d:Tt},Y=le(),Dt=()=>(Dt=Y.C)(),Ot=n._webidl_free=e=>(Ot=n._webidl_free=Y.D)(e),kt=n._free=e=>(kt=n._free=Y.E)(e),At=n._webidl_malloc=e=>(At=n._webidl_malloc=Y.F)(e),jt=n._malloc=e=>(jt=n._malloc=Y.G)(e),Mt=n._emscripten_bind_VoidPtr___destroy___0=e=>(Mt=n._emscripten_bind_VoidPtr___destroy___0=Y.H)(e),Nt=n._emscripten_bind_Graphviz_Graphviz_2=(e,t)=>(Nt=n._emscripten_bind_Graphviz_Graphviz_2=Y.I)(e,t),Pt=n._emscripten_bind_Graphviz_version_0=()=>(Pt=n._emscripten_bind_Graphviz_version_0=Y.J)(),Ft=n._emscripten_bind_Graphviz_lastError_0=()=>(Ft=n._emscripten_bind_Graphviz_lastError_0=Y.K)(),It=n._emscripten_bind_Graphviz_createFile_2=(e,t,r)=>(It=n._emscripten_bind_Graphviz_createFile_2=Y.L)(e,t,r),Lt=n._emscripten_bind_Graphviz_layout_3=(e,t,r,i)=>(Lt=n._emscripten_bind_Graphviz_layout_3=Y.M)(e,t,r,i),Rt=n._emscripten_bind_Graphviz_acyclic_3=(e,t,r,i)=>(Rt=n._emscripten_bind_Graphviz_acyclic_3=Y.N)(e,t,r,i),zt=n._emscripten_bind_Graphviz_tred_3=(e,t,r,i)=>(zt=n._emscripten_bind_Graphviz_tred_3=Y.O)(e,t,r,i),Bt=n._emscripten_bind_Graphviz_unflatten_4=(e,t,r,i,a)=>(Bt=n._emscripten_bind_Graphviz_unflatten_4=Y.P)(e,t,r,i,a),Vt=n._emscripten_bind_Graphviz_get_layout_result_0=e=>(Vt=n._emscripten_bind_Graphviz_get_layout_result_0=Y.Q)(e),Ht=n._emscripten_bind_Graphviz_set_layout_result_1=(e,t)=>(Ht=n._emscripten_bind_Graphviz_set_layout_result_1=Y.R)(e,t),Ut=n._emscripten_bind_Graphviz_get_acyclic_outFile_0=e=>(Ut=n._emscripten_bind_Graphviz_get_acyclic_outFile_0=Y.S)(e),Wt=n._emscripten_bind_Graphviz_set_acyclic_outFile_1=(e,t)=>(Wt=n._emscripten_bind_Graphviz_set_acyclic_outFile_1=Y.T)(e,t),Gt=n._emscripten_bind_Graphviz_get_acyclic_num_rev_0=e=>(Gt=n._emscripten_bind_Graphviz_get_acyclic_num_rev_0=Y.U)(e),Kt=n._emscripten_bind_Graphviz_set_acyclic_num_rev_1=(e,t)=>(Kt=n._emscripten_bind_Graphviz_set_acyclic_num_rev_1=Y.V)(e,t),qt=n._emscripten_bind_Graphviz_get_tred_out_0=e=>(qt=n._emscripten_bind_Graphviz_get_tred_out_0=Y.W)(e),Jt=n._emscripten_bind_Graphviz_set_tred_out_1=(e,t)=>(Jt=n._emscripten_bind_Graphviz_set_tred_out_1=Y.X)(e,t),Yt=n._emscripten_bind_Graphviz_get_tred_err_0=e=>(Yt=n._emscripten_bind_Graphviz_get_tred_err_0=Y.Y)(e),Xt=n._emscripten_bind_Graphviz_set_tred_err_1=(e,t)=>(Xt=n._emscripten_bind_Graphviz_set_tred_err_1=Y.Z)(e,t),Zt=n._emscripten_bind_Graphviz___destroy___0=e=>(Zt=n._emscripten_bind_Graphviz___destroy___0=Y._)(e),Qt=(e,t)=>(Qt=Y.aa)(e,t);n.UTF8ToString=q;var $t;ee=function e(){$t||en(),$t||(ee=e)};function en(){if(N>0||(k(),N>0))return;function e(){$t||($t=!0,n.calledRun=!0,!_&&(A(),r(n),j()))}e()}en();function X(){}X.prototype=Object.create(X.prototype),X.prototype.constructor=X,X.prototype.__class__=X,X.__cache__={},n.WrapperObject=X;function tn(e){return(e||X).__cache__}n.getCache=tn;function nn(e,t){var n=tn(t),r=n[e];return r||(r=Object.create((t||X).prototype),r.ptr=e,n[e]=r)}n.wrapPointer=nn;function rn(e,t){return nn(e.ptr,t)}n.castObject=rn,n.NULL=nn(0);function an(e){if(!e.__destroy__)throw`Error: Cannot destroy object. (Did you create it yourself?)`;e.__destroy__(),delete tn(e.__class__)[e.ptr]}n.destroy=an;function on(e,t){return e.ptr===t.ptr}n.compare=on;function sn(e){return e.ptr}n.getPointer=sn;function cn(e){return e.__class__}n.getClass=cn;var Z={buffer:0,size:0,pos:0,temps:[],needed:0,prepare(){if(Z.needed){for(var e=0;e=Z.size?(v(i>0),Z.needed+=i,a=n._webidl_malloc(i),Z.temps.push(a)):(a=Z.buffer+Z.pos,Z.pos+=i),a},copy(e,t,n){n/=t.BYTES_PER_ELEMENT;for(var r=0;r?@[]^_`{|}~"';function Ge(e){let t=e.length,n=[],r=0,i=0,a=-1;for(let o=0;o88?13:14;do n.push(r&255),r>>=8,i-=8;while(i>7);a=-1}}return a>-1&&n.push((r|a< + +`}}function Qe(e){return e.map(Ze)}function $e(e,t){let n={images:[],files:[],...t};[...n.files,...Qe(n.images)].forEach(t=>e.createFile(t.path,t.data))}var et=class e{constructor(e){this._module=e}static load(){return Ye().then(t=>new e(t))}static unload(){Xe()}version(){return this._module.Graphviz.prototype.version()}layout(t,n=`svg`,r=`dot`,i){if(!t)return``;let a=new this._module.Graphviz(+!!i?.yInvert,i?.nop?i?.nop:0),o=``,s=``;try{$e(a,i);try{o=a.layout(t,n,r)}catch(e){s=e.message}s=a.lastError()||s}finally{this._module.destroy(a)}if(!o&&s)throw e.unload(),Error(s);return o}acyclic(t,n=!1,r=!1){if(!t)return{acyclic:!1,num_rev:0,outFile:``};let i=new this._module.Graphviz,a=!1,o=0,s=``,c=``;try{try{a=i.acyclic(t,n,r),o=i.acyclic_num_rev,s=i.acyclic_outFile}catch(e){c=e.message}c=i.lastError()||c}finally{this._module.destroy(i)}if(c)throw e.unload(),Error(c);return{acyclic:a,num_rev:o,outFile:s}}tred(t,n=!1,r=!1){if(!t)return{out:``,err:``};let i=new this._module.Graphviz,a=``,o=``,s=``;try{try{i.tred(t,n,r),a=i.tred_out,o=i.tred_err}catch(e){s=e.message}s=i.lastError()||s}finally{this._module.destroy(i)}if(!a&&s)throw e.unload(),Error(s);return{out:a,err:o}}unflatten(t,n=0,r=!1,i=0){if(!t)return``;let a=new this._module.Graphviz,o=``,s=``;try{try{o=a.unflatten(t,n,r,i)}catch(e){s=e.message}s=a.lastError()||s}finally{this._module.destroy(a)}if(!o&&s)throw e.unload(),Error(s);return o}circo(e,t=`svg`,n){return this.layout(e,t,`circo`,n)}dot(e,t=`svg`,n){return this.layout(e,t,`dot`,n)}fdp(e,t=`svg`,n){return this.layout(e,t,`fdp`,n)}sfdp(e,t=`svg`,n){return this.layout(e,t,`sfdp`,n)}neato(e,t=`svg`,n){return this.layout(e,t,`neato`,n)}osage(e,t=`svg`,n){return this.layout(e,t,`osage`,n)}patchwork(e,t=`svg`,n){return this.layout(e,t,`patchwork`,n)}twopi(e,t=`svg`,n){return this.layout(e,t,`twopi`,n)}nop(e){return this.layout(e,`dot`,`nop`)}nop2(e){return this.layout(e,`dot`,`nop2`)}};function tt(e){return Object.assign({},e)}function nt(e){return Math.round(e*100)/100}function rt(e,t){if(e.tag==`polygon`){var n=tt(e);n.tag=`path`;var r=e.attributes,i=tt(r),a=r.points;if(t.tag==`polygon`){var o=e.bbox;o.cx=o.x+o.width/2,o.cy=o.y+o.height/2;for(var s=r.points.split(` `),c=s.map(function(e){var t=e.split(`,`);return[t[0]-o.cx,t[1]-o.cy]}),l=c[c.length-1][0],u=c[c.length-1][1],d=0;d{e.layout(``,`svg`,`dot`),this.layoutSync=e.layout.bind(e),this._worker??this._dispatch.call(`initEnd`,this),this._afterInit&&this._afterInit()})}catch{}if(this._worker!=null){var e=this._vizURL,t=this;this._workerPort.onmessage=function(e){t._workerCallbacks.shift().call(t,e)},e.match(/^https?:\/\/|^\/\//i)||(e=new window.URL(e,document.location.href).href),st.call(this,{type:`layout`,dot:``,engine:`dot`,vizURL:e},function(e){switch(e.data.type){case`init`:break}}),st.call(this,{type:`version`},function(e){switch(e.data.type){case`version`:t._graphvizVersion=e.data.version,t._dispatch.call(`initEnd`,this);break}})}}function st(e,t){this._workerCallbacks.push(t),this._workerPort.postMessage(e)}function ct(e,t,n,r){if(this._worker)st.call(this,{type:`layout`,dot:e,engine:t,options:n},function(e){r.call(this,e.data)});else try{var i=this.layoutSync(e,`svg`,t,n);r.call(this,{type:`done`,svg:i})}catch(e){r.call(this,{type:`error`,error:e.message})}}function lt(e,t){var n=this;this._worker;var r=this._options.engine,i=this._images;this._dispatch.call(`start`,this),this._busy=!0,this._dispatch.call(`layoutStart`,this);var a={images:i};return!this._worker&&this.layoutSync==null?(this._afterInit=this.dot.bind(this,e,t),this):(this.layout(e,r,a,function(e){switch(e.type){case`error`:if(n._onerror)n._onerror(e.error);else throw e.error.message;break;case`done`:var r=e.svg;ut.call(this,r,t);break}}),this)}function ut(e,t){var n=this._options.keyMode,r=this._options.tweenPaths,i=this._options.tweenShapes;if(typeof this._options.tweenPrecision==`string`&&this._options.tweenPrecision.includes(`%`))var a=this._options.tweenPrecision.split(`%`)[0]/100,o=this._options.tweenPrecision.includes(`%`);else var a=this._options.tweenPrecision,o=!1;var s=this._options.growEnteringEdges,c={},l=this._dictionary||{},u={},d=this._nodeDictionary||{};function f(e,t){var r=e.tag;if(n==`index`)e.key=t;else if(r[0]!=`#`){if(n==`id`)e.key=e.attributes.id;else if(n==`title`){var a=e.children.find(function(e){return e.tag==`title`});a&&(a.children.length>0?e.key=a.children[0].text:e.key=``)}}e.key??=(i&&(r==`ellipse`||r==`polygon`)&&(r=`path`),r+`-`+t)}function p(e,t){e.id=(t?t.id+`.`:``)+e.key}function m(e){c[e.id]=e}function h(e,t){i&&e.id in l&&(t.tag==`polygon`||t.tag==`ellipse`||t.tag==`path`)&&(t.tag!=e.tag||e.tag==`polygon`)&&(t.tag!=`path`&&(e.alternativeOld=rt(t,e)),e.tag!=`path`&&(e.alternativeNew=rt(e,t)))}function g(e,t){if(r&&t&&(t.tag==`path`||e.alternativeOld&&e.alternativeOld.tag==`path`)){var n=(e.alternativeNew||e).attributes.d;if(e.alternativeOld)var i=L(e.alternativeOld);else var i=L(t);(e.alternativeOld||={}).points=fe(i,n,a,o)}}function _(e,t=0,n){f(e,t),p(e,n);var r=l[e.id];m(e),h(e,r),g(e,r);var i={};e.children.forEach(function(t){var n=t.tag;(n==`ellipse`||n==`polygon`)&&(n=`path`),i[n]??(i[n]=0),_(t,i[n]++,e)})}function v(e){var t=e.tag;if(s&&e.parent&&e.parent.attributes.class==`node`&&t==`title`){if(e.children.length>0)var n=e.children[0].text;else var n=``;u[n]=e.parent}}function y(e){var t=e.id,n=e.tag,r=l[t];if(s&&!r&&e.parent&&he(e)&&(n==`path`||n==`polygon`)){if(n==`polygon`){var i=e.parent.children.find(function(e){return e.tag==`path`});i&&(e.totalLength=i.totalLength)}var a=H(e).children[0],o=a.text.split(`->`);o.length!=2&&(o=a.text.split(`--`));var c=o[0],f=u[c];if(Object.hasOwn(d,c)){var p=d[c],m=f.children.findIndex(function(e,t){return e.tag==`g`});if(m>=0){var h=f.children[m].children.findIndex(function(e,t){return e.tag==`a`});f=f.children[m].children[h]}var m=p.children.findIndex(function(e,t){return e.tag==`g`});if(m>=0){var h=p.children[m].children.findIndex(function(e,t){return e.tag==`a`});p=p.children[m].children[h]}for(var g=f.children,m=0;m0&&this._queue.shift().call(this)}function dt(e,t){var n=this;this.dot(e,r);function r(){n.render(t)}return this}function ft(e){return e instanceof Function?this._transitionFactory=e:this._transition=b(e),this}function pt(e){var t=this._selection.selectWithoutDataPropagation(`svg`);return t.size()==0?null:N(t.node(),e)}function mt(e){if(e===void 0)return Object.assign({},this._options);for(var t of Object.keys(e))this._options[t]=e[t];return this}function ht(e){return this._options.width=e,this}function gt(e){return this._options.height=e,this}function _t(e){return this._options.scale=e,this}function vt(e){return this._options.fit=e,this}function yt(e){return this._attributer=e,this}function bt(e){return this._options.engine=e,this}function xt(e,t,n){return this._images.push({path:e,width:t,height:n}),this}function St(e){if(!this._keyModes.has(e))throw Error(`Illegal keyMode: `+e);if(e!=this._options.keyMode&&this._data!=null)throw Error(`Too late to change keyMode`);return this._options.keyMode=e,this}function Ct(e){return this._options.fade=e,this}function wt(e){return this._options.tweenPaths=e,this}function Tt(e){return this._options.tweenShapes=e,e&&(this._options.tweenPaths=!0),this}function Et(e){return this._options.convertEqualSidedPolygons=e,this}function Y(e){return this._options.tweenPrecision=e,this}function Dt(e){return this._options.growEnteringEdges=e,this}function Ot(e,t){return this._dispatch.on(e,t),this}function kt(e){return this._onerror=e,this}function At(e){var t=Date.now(),n={},r=this._eventTypes,i=Math.max(...r.map(e=>e.length));for(let c=0;c2`)(c)+` `,u+=l+` `.repeat(i-l.length),u+=h(` >5`)(e-t)+` `,l!=`initEnd`&&(u+=h(` >5`)(e-n.start[r])),l==`dataProcessEnd`&&(u+=` prepare `+h(` >5`)(e-n.layoutEnd[r])),l==`renderEnd`&&a._transition&&(u+=` transition start margin `+h(` >5`)(a._transition.delay()-(e-n.renderStart[r])),o=a._transition.delay(),s=a._transition.duration()),l==`transitionStart`){var d=e-n.renderStart[r];u+=` transition delay `+h(` >5`)(e-n.renderStart[r]),u+=` expected `+h(` >5`)(o),u+=` diff `+h(` >5`)(d-o)}if(l==`transitionEnd`){var f=e-n.transitionStart[r];u+=` transition duration `+h(` >5`)(f),u+=` expected `+h(` >5`)(s),u+=` diff `+h(` >5`)(f-s)}console.log(u),t=e}:null)}return this}function jt(){return delete this._selection.node().__graphviz__,this._worker&&this._workerPortClose(),this}function Mt(e,t,n,r){return t=-t,r=-r,[e,t]=[e*n-t*r,e*r+t*n],t=-t,[e,t]}function Nt(e,t,n,r,i,a={}){if(i=Object.assign({},i),i.style&&i.style.includes(`invis`))var o=E(null);else{var s=this._selection.selectWithoutDataPropagation(`svg`).selectWithoutDataPropagation(`g`),c=F(Vt.call(this,i)),o=s.append(`g`).data([c]);R.call(o.node(),c),Ft.call(this,o,e,t,n,r,i,a)}return this._drawnEdge={g:o,x1:e,y1:t,x2:n,y2:r,attributes:i},this}function Pt(e,t,n,r,i={},a={}){if(!this._drawnEdge)throw Error(`No edge has been drawn`);var o=this._drawnEdge.g;if(i=Object.assign(this._drawnEdge.attributes,i),this._drawnEdge.x1=e,this._drawnEdge.y1=t,this._drawnEdge.x2=n,this._drawnEdge.y2=r,o.empty()&&!(i.style&&i.style.includes(`invis`))){var o=this._selection.selectWithoutDataPropagation(`svg`).selectWithoutDataPropagation(`g`).append(`g`);this._drawnEdge.g=o}return o.empty()||Ft.call(this,o,e,t,n,r,i,a),this}function Ft(e,t,n,r,i,a,o){var s=F(Vt.call(this,a));e.data([s]),R.call(e.node(),s),It(e,t,n,r,i,a,o)}function It(e,t,n,r,i,a,o){var s=o.shortening||0,c=10,l=7,u=.1,d=[[0,-l/2],[c,0],[0,l/2],[0,-l/2]],f=r-t,p=i-n,m=Math.sqrt(f*f+p*p);if(m==0)var h=1,_=0;else var h=f/m,_=p/m;if(r=t+(m-s-c-u)*h,i=n+(m-s-c-u)*_,a.URL||a.tooltip)var v=e.selectWithoutDataPropagation(`g`).selectWithoutDataPropagation(`a`),y=v.selectWithoutDataPropagation(`path`),b=v.selectWithoutDataPropagation(`polygon`);else var y=e.selectWithoutDataPropagation(`path`),b=e.selectWithoutDataPropagation(`polygon`);var x=g();x.moveTo(t,n),x.lineTo(r,i),y.attr(`d`,x),r=t+(m-s-c)*h,i=n+(m-s-c)*_;for(var S=0;S b [`+t+`]}`,i=this.layoutSync(r,`svg`,`dot`),a=new window.DOMParser().parseFromString(i,`image/svg+xml`);return E(document.createDocumentFragment()).append(function(){return a.documentElement}).select(`.edge`)}function Ht(e,t,n,r={},i={}){if(r=Object.assign({},r),r.style&&r.style.includes(`invis`))var a=E(null);else{var o=this._selection.selectWithoutDataPropagation(`svg`).selectWithoutDataPropagation(`g`),s=F(Xt.call(this,n,r)),a=o.append(`g`).data([s]);R.call(a.node(),s),Wt.call(this,a,e,t,n,r,i)}return this._drawnNode={g:a,nodeId:n,x:e,y:t,attributes:r},this}function Ut(e,t,n,r={},i={}){if(!this._drawnNode)throw Error(`No node has been drawn`);var a=this._drawnNode.g;if(n??=this._drawnNode.nodeId,r=Object.assign(this._drawnNode.attributes,r),this._drawnNode.nodeId=n,this._drawnNode.x=e,this._drawnNode.y=t,a.empty()&&!(r.style&&r.style.includes(`invis`))){var a=this._selection.selectWithoutDataPropagation(`svg`).selectWithoutDataPropagation(`g`).append(`g`);this._drawnNode.g=a}return a.empty()||Wt.call(this,a,e,t,n,r,i),this}function Wt(e,t,n,r,i,a){var o=F(Xt.call(this,r,i));return e.data([o]),R.call(e.node(),o),Gt(e,t,n,i,a),this}function Gt(e,t,n,r,i){if(r.URL||r.tooltip)var a=e.selectWithoutDataPropagation(`g`).selectWithoutDataPropagation(`a`);else var a=e;var o=a.selectAll(`ellipse,polygon,path,polyline`),s=e.selectWithoutDataPropagation(`text`);if(o.size()!=0){var c=o.node().getBBox();c.cx=c.x+c.width/2,c.cy=c.y+c.height/2}else s.size()!=0&&(c={x:+s.attr(`x`),y:+s.attr(`y`),width:0,height:0,cx:+s.attr(`x`),cy:+s.attr(`y`)});return o.each(function(e,r){var i=E(this);if(i.attr(`cx`))i.attr(`cx`,nt(t)).attr(`cy`,nt(n));else if(i.attr(`points`)){var a=i.attr(`points`).trim();i.attr(`points`,it(a,t-c.cx,n-c.cy))}else{var o=i.attr(`d`);i.attr(`d`,at(o,t-c.cx,n-c.cy))}}),s.size()!=0&&s.attr(`x`,nt(+s.attr(`x`)+t-c.cx)).attr(`y`,nt(+s.attr(`y`)+n-c.cy)),this}function Kt(e,t,n={}){if(!this._drawnNode)throw Error(`No node has been drawn`);var r=this._drawnNode.g,i=this._drawnNode.attributes;return this._drawnNode.x=e,this._drawnNode.y=t,r.empty()||Gt(r,e,t,i,n),this}function qt(){if(!this._drawnNode)return this;var e=this._drawnNode.g;return e.empty()||e.remove(),this._drawnNode=null,this}function Jt(e){if(!this._drawnNode)throw Error(`No node has been drawn`);e??=this._drawnNode.nodeId;var t=this._drawnNode.g;if(t.empty())return this;var n=this._drawnNode.attributes;if(t.selectWithoutDataPropagation(`title`).text(e),n.URL||n.tooltip){var r=t.selectWithoutDataPropagation(`g`).selectWithoutDataPropagation(`a`);r.selectWithoutDataPropagation(`ellipse,polygon,path,polyline`);var i=r.selectWithoutDataPropagation(`text`)}else{t.selectWithoutDataPropagation(`ellipse,polygon,path,polyline`);var i=t.selectWithoutDataPropagation(`text`)}i.text(n.label||e);var a=this._selection.selectWithoutDataPropagation(`svg`).selectWithoutDataPropagation(`g`),o=a.datum(),s=this._extractData(t,o.children.length,a.datum());return o.children.push(s),re(t,s),this._drawnNode=null,this}function Yt(){return this._drawnNode?this._drawnNode.g:E(null)}function Xt(e,t){var n=``;for(var r of Object.keys(t))t[r]!=null&&(n+=` "`+r+`"="`+t[r]+`"`);var i=`graph {"`+e+`" [`+n+`]}`,a=this.layoutSync(i,`svg`,`dot`),o=new window.DOMParser().parseFromString(a,`image/svg+xml`);return E(document.createDocumentFragment()).append(function(){return o.documentElement}).select(`.node`)}function Zt(e){self.document={},e.addEventListener(`message`,function(t){let n=self[`@hpcc-js/wasm`];if(n==null&&t.data.vizURL&&(importScripts(t.data.vizURL),n=self[`@hpcc-js/wasm`]),t.data.type==`version`){n.Graphviz.load().then(t=>{e.postMessage({type:`version`,version:t.version()})});return}n.Graphviz.load().then(n=>{let r=n.layout(t.data.dot,`svg`,t.data.engine,t.data.options);r?e.postMessage({type:`done`,svg:r}):t.data.vizURL?e.postMessage({type:`init`}):e.postMessage({type:`skip`})}).catch(t=>{e.postMessage({type:`error`,error:t.message})})})}function Qt(){Zt(self)}function $t(){self.onconnect=function(e){let t=e.ports[0];Zt(t),t.start()}}function en(e,t){if(this._options={useWorker:!0,useSharedWorker:!1,engine:`dot`,keyMode:`title`,fade:!0,tweenPaths:!0,tweenShapes:!0,convertEqualSidedPolygons:!0,tweenPrecision:1,growEnteringEdges:!0,zoom:!0,zoomScaleExtent:[.1,10],zoomTranslateExtent:[[-1/0,-1/0],[1/0,1/0]],width:null,height:null,scale:1,fit:!1},t instanceof Object)for(var n of Object.keys(t))this._options[n]=t[n];else typeof t==`boolean`&&(this._options.useWorker=t);var r=this._options.useWorker,i=this._options.useSharedWorker;if(typeof Worker>`u`&&(r=!1),typeof SharedWorker>`u`&&(i=!1),r||i){var a=j(`script`).filter(function(){return E(this).attr(`type`)==`javascript/worker`||E(this).attr(`src`)&&E(this).attr(`src`).match(/.*\/@hpcc-js\/wasm/)});a.size()==0?(console.warn(`No script tag of type "javascript/worker" was found and "useWorker" is true. Not using web worker.`),r=!1,i=!1):(this._vizURL=a.attr(`src`),this._vizURL||(console.warn(`No "src" attribute of was found on the "javascript/worker" script tag and "useWorker" is true. Not using web worker.`),r=!1,i=!1))}if(i){let e=`data:application/javascript;base64,`+btoa(Zt.toString()+`(`+$t.toString()+`)()`);this._worker=this._worker=new SharedWorker(e),this._workerPort=this._worker.port,this._workerPortClose=this._worker.port.close.bind(this._workerPort),this._worker.port.start(),this._workerCallbacks=[]}else if(r){var o=new Blob([Zt.toString()+`(`+Qt.toString()+`)()`]),s=window.URL.createObjectURL(o);this._worker=new Worker(s),this._workerPort=this._worker,this._workerPortClose=this._worker.terminate.bind(this._worker),this._workerCallbacks=[]}else et.load().then((e=>{this._graphvizVersion=e.version()}).bind(this));this._selection=e,this._active=!1,this._busy=!1,this._jobs=[],this._queue=[],this._keyModes=new Set([`title`,`id`,`tag-index`,`index`]),this._images=[],this._translation=void 0,this._scale=void 0,this._eventTypes=[`initEnd`,`start`,`layoutStart`,`layoutEnd`,`dataExtractEnd`,`dataProcessPass1End`,`dataProcessPass2End`,`dataProcessEnd`,`renderStart`,`renderEnd`,`transitionStart`,`transitionEnd`,`restoreEnd`,`end`,`zoom`],this._dispatch=v(...this._eventTypes),ot.call(this),e.node().__graphviz__=this}function X(e,t){return E(e).graphviz(t)}en.prototype=X.prototype={constructor:en,engine:bt,addImage:xt,keyMode:St,fade:Ct,tweenPaths:wt,tweenShapes:Tt,convertEqualSidedPolygons:Et,tweenPrecision:Y,growEnteringEdges:Dt,zoom:z,resetZoom:ce,zoomBehavior:V,zoomSelection:ue,zoomScaleExtent:le,zoomTranslateExtent:B,render:_e,layout:ct,dot:lt,data:pe,renderDot:dt,transition:ft,active:pt,options:mt,width:ht,height:gt,scale:_t,fit:vt,attributer:yt,on:Ot,onerror:kt,logEvents:At,destroy:jt,drawEdge:Nt,updateDrawnEdge:Pt,moveDrawnEdgeEndPoint:Lt,insertDrawnEdge:zt,removeDrawnEdge:Rt,removeDrawnEdge:Rt,drawnEdgeSelection:Bt,drawnEdgeSelection:Bt,drawNode:Ht,updateDrawnNode:Ut,moveDrawnNode:Kt,insertDrawnNode:Jt,removeDrawnNode:qt,removeDrawnNode:qt,drawnNodeSelection:Yt,drawnNodeSelection:Yt,graphvizVersion:ye};function tn(e){var t=this.node().__graphviz__;return t?(t.options(e),S(function(){t._dispatch.call(`initEnd`,this)}.bind(this),0)):t=new en(this,e),t}function nn(e){return E(this.size()>0?this.node().querySelector(e):null)}w.prototype.graphviz=tn,w.prototype.selectWithoutDataPropagation=nn;var rn=e(a(),1),an=i(`div`,{target:`e15pjtvg0`})(({theme:e,shouldUseFullWidth:t,shouldUseFullHeight:n})=>({"& *":{fontFamily:e.genericFonts.bodyFont,fontSize:`calc(${e.fontSizes.twoSm} * 0.8)`},"& svg":{maxWidth:`100%`,width:t?`100%`:`auto`,height:n?`100%`:`auto`,borderRadius:e.radii.default},width:t?`100%`:`auto`,height:n?`100%`:`auto`})),on=(0,rn.getLogger)(`GraphVizChart`),sn=`http://www.w3.org/1999/xlink`;function cn(e,t){let n=e.getAttribute(t);n!==null&&c(n)&&e.setAttribute(t,`#`)}function Z(e){let t=e.getAttributeNS(sn,`href`);t!==null&&c(t)&&e.setAttributeNS(sn,`xlink:href`,`#`)}function Q(e){e.querySelectorAll(`a`).forEach(e=>{cn(e,`href`),cn(e,`xlink:href`),Z(e)})}function ln({element:e,disableFullscreenMode:t,widthConfig:i,heightConfig:a}){let c=`st-graphviz-chart-${e.elementId}`,{width:m,height:h,elementRef:g}=u(),{expanded:_,width:v,height:y,expand:b,collapse:x}=f(p),S=o(i),C=s(a);return(0,P.useEffect)(()=>{try{let t=X(`#${c}`).zoom(!1);a?.useStretch&&t.width(m<0?0:m).height(h<0?0:h),t.fit(!0).scale(1).engine(e.engine).renderDot(e.spec,()=>{let e=document.getElementById(c);e&&Q(e)})}catch(e){on.error(e)}},[c,e.engine,e.spec,m,h,_,a?.useStretch]),n(l,{width:v??0,height:_?y??void 0:a?.pixelHeight??void 0,useContainerWidth:_||S,useContainerHeight:C,children:[r(d,{target:l,isFullScreen:_,onExpand:b,onCollapse:x,disableFullscreenMode:t}),r(an,{className:`stGraphVizChart`,"data-testid":`stGraphVizChart`,id:c,shouldUseFullWidth:_||S,shouldUseFullHeight:_||C,ref:g})]})}var $=m(ln),un=(0,P.memo)($);export{on as LOG,un as default,Q as sanitizeGraphVizLinkUris}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/Hidden.Bpblr2PM.js b/venv/Lib/site-packages/streamlit/static/static/js/Hidden.Bpblr2PM.js new file mode 100644 index 0000000000000000000000000000000000000000..d16862e95d6d33ec737c326a92ad3c1302d19cae --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/Hidden.Bpblr2PM.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";var n=e(t(),1);typeof HTMLTemplateElement<`u`&&(Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.content.firstChild}}),Object.defineProperty(HTMLTemplateElement.prototype,"appendChild",{configurable:!0,enumerable:!0,value:function(e){return this.content.appendChild(e)}}),Object.defineProperty(HTMLTemplateElement.prototype,"removeChild",{configurable:!0,enumerable:!0,value:function(e){return this.content.removeChild(e)}}),Object.defineProperty(HTMLTemplateElement.prototype,"insertBefore",{configurable:!0,enumerable:!0,value:function(e,t){return this.content.insertBefore(e,t)}}));var r=(0,n.createContext)(!1);function i(e){if((0,n.useContext)(r))return n.createElement(n.Fragment,null,e.children);let t=n.createElement(r.Provider,{value:!0},e.children);return n.createElement(`template`,null,t)}function a(e){let t=(t,i)=>(0,n.useContext)(r)?null:e(t,i);return t.displayName=e.displayName||e.name,(0,n.forwardRef)(t)}function o(){return(0,n.useContext)(r)}export{i as n,o as r,a as t}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/Html.BpiXuX9J.js b/venv/Lib/site-packages/streamlit/static/static/js/Html.BpiXuX9J.js new file mode 100644 index 0000000000000000000000000000000000000000..06f31cf80de56062f1dce95568348ee60fe9bd8a --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/Html.BpiXuX9J.js @@ -0,0 +1 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{i as n,t as r}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{t as i}from"./purify.es.sLXpNpJ5.js";var a=e(t(),1),o=`data-temp-href-target`;i.addHook(`beforeSanitizeAttributes`,function(e){e instanceof HTMLElement&&e.hasAttribute(`target`)&&e.getAttribute(`target`)===`_blank`&&e.setAttribute(o,`_blank`)}),i.addHook(`afterSanitizeAttributes`,function(e){e instanceof HTMLElement&&e.hasAttribute(o)&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`),e.removeAttribute(o))});var s={USE_PROFILES:{html:!0},FORCE_BODY:!0},c=i,l=r(`div`,{target:`e1o5kn6k0`})(({theme:e})=>({width:`100%`,"ul, ol, dl":{paddingLeft:e.spacing.threeXL}})),u=(0,a.forwardRef)(function(e,t){return n(l,{className:`stHtml`,"data-testid":`stHtml`,ref:t,...e})}),d={...s,ADD_TAGS:[`script`,`style`],ADD_ATTR:[`src`,`type`,`async`,`defer`,`nonce`,`crossorigin`,`referrerpolicy`,`integrity`]};function f(e){return c.sanitize(e,d)}var p=(0,a.memo)(({body:e})=>{let t=(0,a.useRef)(null),r=(0,a.useMemo)(()=>f(e),[e]);return(0,a.useEffect)(()=>{let e=t.current;if(e)return e.innerHTML=r,Array.from(e.querySelectorAll(`script`)).forEach(e=>{let t=document.createElement(`script`);for(let{name:n,value:r}of Array.from(e.attributes))try{t.setAttribute(n,r)}catch{}e.src||(t.textContent=e.textContent),e.parentNode?.replaceChild(t,e)}),()=>{e.innerHTML=``}},[r]),n(u,{ref:t})});function m(e){return c.sanitize(e,s)}function h({body:e}){let t=(0,a.useMemo)(()=>m(e),[e]);return t?n(u,{dangerouslySetInnerHTML:{__html:t}}):null}var g=(0,a.memo)(h);function _({element:e}){let{body:t,unsafeAllowJavascript:r}=e;return n(r?p:g,{body:t})}var v=(0,a.memo)(_);export{v as default}; \ No newline at end of file diff --git a/venv/Lib/site-packages/streamlit/static/static/js/IFrame.WjlxKKes.js b/venv/Lib/site-packages/streamlit/static/static/js/IFrame.WjlxKKes.js new file mode 100644 index 0000000000000000000000000000000000000000..4fc0cd48b4c325e06497f9c210fad72caa85d759 --- /dev/null +++ b/venv/Lib/site-packages/streamlit/static/static/js/IFrame.WjlxKKes.js @@ -0,0 +1,49 @@ +import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{i as n,t as r}from"./emotion-styled.browser.esm.DsRKNFfx.js";import{n as i,t as a}from"./types.cZoyy9Y-.js";import{n as o,t as s}from"./IFrameUtil.PlC_b34Z.js";var c=e(t(),1),l=r(`iframe`,{target:`ei36xw10`})(({theme:e,disableScrolling:t,width:n,height:r})=>({width:n??`100%`,height:r??`100%`,colorScheme:`normal`,border:`none`,padding:e.spacing.none,margin:e.spacing.none,overflow:t?`hidden`:void 0})),u=`streamlit:iframe:setSize`,d=`25rem`,f=`